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 issue focuses on adding another field change validation to the CRD Upgrade Safety checks to prevent changes to a fields default value for a given CRD version during an upgrade
As a potential source of inspiration, here is how a couple of the existing validations are implemented:
Definitions:
func NoScopeChange(old, new v1.CustomResourceDefinition) error {
if old.Spec.Scope != new.Spec.Scope {
return fmt.Errorf("scope changed from %q to %q", old.Spec.Scope, new.Spec.Scope)
}
return nil
}
func NoStoredVersionRemoved(old, new v1.CustomResourceDefinition) error {
newVersions := sets.New[string]()
for _, version := range new.Spec.Versions {
if !newVersions.Has(version.Name) {
newVersions.Insert(version.Name)
}
}
for _, storedVersion := range old.Status.StoredVersions {
if !newVersions.Has(storedVersion) {
return fmt.Errorf("stored version %q removed", storedVersion)
}
}
return nil
}
Now that there is a base CRDUpgradeSafety preflight check in place, we can continue adding validation logic based on the CRDUpgradeSafety preflight check proposal.
This issue focuses on adding another field change validation to the CRD Upgrade Safety checks to prevent changes to a fields default value for a given CRD version during an upgrade
As a potential source of inspiration, here is how a couple of the existing validations are implemented:
The text was updated successfully, but these errors were encountered: