You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I recently tried to upgrade from 1.2 to 1.3 and run into this error:
$ helm upgrade longhorn longhorn/longhorn --namespace longhorn-system --values longhorn.yaml --debug
upgrade.go:139: [debug] preparing upgrade for longhorn
upgrade.go:147: [debug] performing update for longhorn
upgrade.go:319: [debug] creating upgraded release for longhorn
client.go:218: [debug] checking 37 resources for changes
client.go:501: [debug] Looks like there are no changes for ServiceAccount "longhorn-service-account"
client.go:501: [debug] Looks like there are no changes for ConfigMap "longhorn-default-setting"
client.go:501: [debug] Looks like there are no changes for ConfigMap "longhorn-storageclass"
client.go:250: [debug] error updating the resource "engineimages.longhorn.io":
cannot patch "engineimages.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "engineimages.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
client.go:250: [debug] error updating the resource "nodes.longhorn.io":
cannot patch "nodes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "nodes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
client.go:250: [debug] error updating the resource "volumes.longhorn.io":
cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
client.go:501: [debug] Looks like there are no changes for ClusterRole "longhorn-role"
client.go:501: [debug] Looks like there are no changes for ClusterRoleBinding "longhorn-bind"
client.go:501: [debug] Looks like there are no changes for Role "longhorn-psp-role"
client.go:501: [debug] Looks like there are no changes for RoleBinding "longhorn-psp-binding"
client.go:501: [debug] Looks like there are no changes for Service "longhorn-backend"
client.go:501: [debug] Looks like there are no changes for Service "longhorn-conversion-webhook"
client.go:501: [debug] Looks like there are no changes for Service "longhorn-admission-webhook"
client.go:501: [debug] Looks like there are no changes for Service "longhorn-engine-manager"
client.go:501: [debug] Looks like there are no changes for Service "longhorn-replica-manager"
client.go:501: [debug] Looks like there are no changes for Deployment "longhorn-driver-deployer"
client.go:501: [debug] Looks like there are no changes for Deployment "longhorn-conversion-webhook"
client.go:501: [debug] Looks like there are no changes for Deployment "longhorn-admission-webhook"
client.go:501: [debug] Looks like there are no changes for Ingress "longhorn-ingress"
upgrade.go:420: [debug] warning: Upgrade "longhorn" failed: cannot patch "engineimages.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "engineimages.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "nodes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "nodes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
Error: UPGRADE FAILED: cannot patch "engineimages.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "engineimages.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "nodes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "nodes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
helm.go:88: [debug] cannot patch "engineimages.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "engineimages.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "nodes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "nodes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
helm.sh/helm/v3/pkg/kube.(*Client).Update
helm.sh/helm/v3/pkg/kube/client.go:263
helm.sh/helm/v3/pkg/action.(*Upgrade).releasingUpgrade
helm.sh/helm/v3/pkg/action/upgrade.go:365
runtime.goexit
runtime/asm_amd64.s:1371
UPGRADE FAILED
main.newUpgradeCmd.func2
helm.sh/helm/v3/cmd/helm/upgrade.go:200
github.com/spf13/cobra.(*Command).execute
github.com/spf13/cobra@v1.2.1/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/cobra@v1.2.1/command.go:974
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/cobra@v1.2.1/command.go:902
main.main
helm.sh/helm/v3/cmd/helm/helm.go:87
runtime.main
runtime/proc.go:225
runtime.goexit
runtime/asm_amd64.s:1371
@tristanlins Did you encounter this issue when upgrading from 1.2 or 1.0 to 1.3? because we would assume users only hit this when upgrading from 1.0.
The official upgrade path should be at most one minor version less than the target version you want to upgrade to. For 1.3.0, you should upgrade from 1.2.x.
@tristanlins Did you encounter this issue when upgrading from1.2 or 1.0 to 1.3? because we would assume users only hit this when upgrading from 1.0.
The official upgrade path should be at most one minor version less than the target version you want to upgrade to. For 1.3.0, you should upgrade from 1.2.x.
Ok, it's clarified now. @tristanlins actually upgraded from 1.2 to 1.3, but started using Longhorn from 1.0 version which is based on v1beta CustomResourceDefinition.apiextensions.k8s.io, so this will keep spec.preserveUnknownFieldstrue (this value is true by default in v1beta1, but false for v1) along the time until upgrading to 1.3, the validation error was encountered when the helm was trying to patch the update from the new version of CustomResourceDefinition.apiextensions.k8s.io CRD w/ webhook strategy introduction.
note: backingimages & backuptargets have no this issues, because they are introduced from 1.2 which uses v1 CustomResourceDefinition.apiextensions.k8s.io and the default value of spec.preserveUnknownFields is false.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently tried to upgrade from 1.2 to 1.3 and run into this error:
I found a solution here: projectcalico/calico#4237 (comment)
Adding
preserveUnknownFields: false
to the CRD spec fixes the problem.Environment
Workaround
#4198 (comment)