Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue the post upgrade on storage migration errors #1753

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

jkandasa
Copy link
Member

@jkandasa jkandasa commented Sep 27, 2023

Changes

Issue:

If there is an error happened on storage version upgrade, post upgrade flow stops and repeating the execution from the beginning.

Originally Storage migration is introduced in #1675

error on patching a resource:

{"level":"error","logger":"tekton-operator-lifecycle.upgrade","caller":"helper/storage_version_migrator.go:49","msg":"failed to migrate: ","commit":"70b39cc","knative.dev/pod":"openshift-pipelines-operator-548c6f67c8-h8vjx","knative.dev/controller":"github.com.tektoncd.operator.pkg.reconciler.shared.tektonconfig.Reconciler","knative.dev/kind":"operator.tekton.dev.TektonConfig","knative.dev/traceid":"46127b82-5f17-4ee7-aa31-e5951cd89b78","knative.dev/key":"config","error":"unable to patch resource /clustertask-with-optional-resources-v1beta1 (gvr: tekton.dev/v1beta1, Resource=clustertasks) - admission webhook \"validation.webhook.pipeline.tekton.dev\" denied the request: validation failed: must not set the field(s): spec.resources","stacktrace":"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/helper.MigrateStorageVersion\n\t/go/src/github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/helper/storage_version_migrator.go:49\ngithub.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.upgradeStorageVersion\n\t/go/src/github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/post_upgrade.go:69\ngithub.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).executeUpgrade\n\t/go/src/github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:99\ngithub.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).RunPostUpgrade\n\t/go/src/github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:69\ngithub.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig.(*Reconciler).ReconcileKind\n\t/go/src/github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/tektonconfig.go:207\ngithub.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig.(*reconcilerImpl).Reconcile\n\t/go/src/github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig/reconciler.go:236\nknative.dev/pkg/controller.(*Impl).processNextWorkItem\n\t/go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:542\nknative.dev/pkg/controller.(*Impl).RunContext.func3\n\t/go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:491"}

and keep on executing the post upgrade

$ oc get tektonconfigs.operator.tekton.dev config
NAME     VERSION   READY   REASON
config   1.12.0    False   Post upgrade is in progress

Fix:

copied the source https://github.com/knative/pkg/blob/2783cd8cfad9ba907e6f31cafeef3eb2943424ee/apiextensions/storageversion/migrator.go to local and modified as,

  • print the resource patching error log, if any and continue the execution
  • print the crd error log, if any and continues the execution
  • complete the post upgrade

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

@jkandasa jkandasa added the kind/bug Categorizes issue or PR as related to a bug. label Sep 27, 2023
@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 27, 2023
@tektoncd tektoncd deleted a comment from tekton-robot Sep 28, 2023
@tektoncd tektoncd deleted a comment from tekton-robot Sep 28, 2023
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/shared/tektonconfig/upgrade/helper/migrator.go Do not exist 96.9%
pkg/reconciler/shared/tektonconfig/upgrade/helper/storage_version_migrator.go 71.4% 76.9% 5.5

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 28, 2023
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 28, 2023
@tekton-robot tekton-robot merged commit 2279fca into tektoncd:main Sep 28, 2023
2 checks passed
@jkandasa jkandasa deleted the fix_storage_upgrade branch September 28, 2023 07:33
@jkandasa
Copy link
Member Author

/cherry-pick release-v0.68.x

@tekton-robot
Copy link
Contributor

@jkandasa: new pull request created: #1754

In response to this:

/cherry-pick release-v0.68.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants