Created
February 5, 2025 19:47
Revisions
-
aaron-prindle created this gist
Feb 5, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ # Base valid ReplicationController object (must be the SAME as in valid.yaml) apiVersion: v1 kind: ReplicationController metadata: name: valid-rc spec: replicas: 1 selector: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-container image: nginx:latest --- # Test Case 1: Replicas = -1 (replace) name: invalid replicas - -1 (replace) replace: "spec.replicas": -1 # Invalid: negative value expectedErrors: - field: spec.replicas type: FieldValueInvalid detail: must be greater than or equal to 0 --- #Test Case 2: Replicas are a string not a number name: invalid replicas - string replace: "spec.replicas": "foo" expectedErrors: - field: spec.replicas type: FieldValueInvalid detail: "invalid type" --- # Test Case 3: Replicas = -5 (applyConfiguration) name: invalid replicas - -5 (applyConfiguration) applyConfiguration: spec: replicas: -5 # Invalid: negative value expectedErrors: - field: spec.replicas type: FieldValueInvalid detail: must be greater than or equal to 0 --- # Test Case 4: Replicas = -2 (jsonPatch) name: invalid replicas - -2 (jsonPatch) jsonPatch: - { "op": "replace", "path": "/spec/replicas", "value": -2 } # Invalid: negative value expectedErrors: - field: spec.replicas type: FieldValueInvalid detail: must be greater than or equal to 0