diff --git a/pkg/kapp/crdupgradesafety/change_validator.go b/pkg/kapp/crdupgradesafety/change_validator.go index 8b2f6de98..a12ac64b1 100644 --- a/pkg/kapp/crdupgradesafety/change_validator.go +++ b/pkg/kapp/crdupgradesafety/change_validator.go @@ -72,8 +72,8 @@ func EnumChangeValidation(diff FieldDiff) (bool, error) { // ChangeValidator is a Validation implementation focused on // handling updates to existing fields in a CRD type ChangeValidator struct { - // Validations is a slice of ChangeValidations - // to run against each changed field + // Validations is a slice of ChangeValidations + // to run against each changed field Validations []ChangeValidation } @@ -146,23 +146,27 @@ type FlatSchema map[string]*v1.JSONSchemaProps // FlattenSchema takes in a CRD version OpenAPIV3Schema and returns // a flattened representation of it. For example, a CRD with a schema of: // ```yaml -// ... -// spec: -// type: object -// properties: -// foo: -// type: string -// bar: -// type: string -// ... +// +// ... +// spec: +// type: object +// properties: +// foo: +// type: string +// bar: +// type: string +// ... +// // ``` // would be represented as: -// map[string]*v1.JSONSchemaProps{ -// "^": {}, -// "^.spec": {}, -// "^.spec.foo": {}, -// "^.spec.bar": {}, -// } +// +// map[string]*v1.JSONSchemaProps{ +// "^": {}, +// "^.spec": {}, +// "^.spec.foo": {}, +// "^.spec.bar": {}, +// } +// // where "^" represents the "root" schema func FlattenSchema(schema *v1.JSONSchemaProps) FlatSchema { fieldMap := map[string]*v1.JSONSchemaProps{}