Skip to content

Commit

Permalink
add missing nil check
Browse files Browse the repository at this point in the history
Signed-off-by: everettraven <[email protected]>
  • Loading branch information
everettraven committed Apr 10, 2024
1 parent c19a35e commit fe02b9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kapp/crdupgradesafety/change_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func (cv *ChangeValidator) Validate(old, new v1.CustomResourceDefinition) error
errs := []error{}
for _, version := range old.Spec.Versions {
newVersion := manifestcomparators.GetVersionByName(&new, version.Name)
if newVersion == nil {
// if the new version doesn't exist skip this version
continue
}
flatOld := FlattenSchema(version.Schema.OpenAPIV3Schema)
flatNew := FlattenSchema(newVersion.Schema.OpenAPIV3Schema)

Expand Down

0 comments on commit fe02b9c

Please sign in to comment.