Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: spec.fieldToExclude
versions:
- v1
- path: status.anotherField
versions:
- v1alpha1
Expand Down Expand Up @@ -201,6 +203,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: spec.fieldToExclude
versions:
- v1
- path: status.anotherField
versions:
- v1alpha1
Expand Down Expand Up @@ -237,6 +241,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: spec.fieldToExclude
versions:
- v1
- path: spec.fieldToExclude
versions:
- v1alpha1
Expand Down Expand Up @@ -274,6 +280,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: "1invalidFieldName"
versions:
- v1
expectedError: "spec.compatibilitySchema.excludedFields[0].path: Invalid value"

- name: Should not be able to create CompatibilityRequirement with invalid DNS 1035 label in additionalVersions
Expand Down Expand Up @@ -376,6 +384,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: spec.thisFieldNameIsWayTooLongBecauseItExceedsSixtyThreeCharactersInLength
versions:
- v1
expectedError: "path must be dot-separated field names, each starting with a letter and containing only letters, digits, and underscores not exceeding 63 characters"

- name: Should not be able to create CompatibilityRequirement with excludedFields path containing more than 16 fields
Expand Down Expand Up @@ -410,6 +420,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q
versions:
- v1
expectedError: "path must be dot-separated field names, each starting with a letter and containing only letters, digits, and underscores not exceeding 63 characters. There may be at most 16 fields in the path"

- name: Should not be able to create CompatibilityRequirement with excludedFields path containing invalid characters
Expand Down Expand Up @@ -444,6 +456,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: spec.field-name
versions:
- v1
expectedError: "path must be dot-separated field names, each starting with a letter and containing only letters, digits, and underscores not exceeding 63 characters"

- name: Should be able to create CompatibilityRequirement with excludedFields path containing exactly 16 fields
Expand Down Expand Up @@ -478,6 +492,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p
versions:
- v1
expected: |
apiVersion: apiextensions.openshift.io/v1alpha1
kind: CompatibilityRequirement
Expand Down Expand Up @@ -509,6 +525,8 @@ tests:
defaultSelection: StorageOnly
excludedFields:
- path: a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p
versions:
- v1

- name: Should not be able to create CompatibilityRequirement with empty objectSchemaValidation.namespaceSelector
initial: |
Expand Down
2 changes: 1 addition & 1 deletion apiextensions/v1alpha1/types_compatibilityrequirement.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ type APIExcludedField struct {
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=32
// +listType=set
// +optional
// +required
Versions []APIVersionString `json:"versions,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ spec:
x-kubernetes-list-type: set
required:
- path
- versions
type: object
maxItems: 64
minItems: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ spec:
x-kubernetes-list-type: set
required:
- path
- versions
type: object
maxItems: 64
minItems: 1
Expand Down
2 changes: 1 addition & 1 deletion openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ spec:
x-kubernetes-list-type: set
required:
- path
- versions
type: object
maxItems: 64
minItems: 1
Expand Down