Last active
February 6, 2025 01:40
-
-
Save aaron-prindle/305ddd14a0bc9304061457d6f2e88b3b to your computer and use it in GitHub Desktop.
valid.yaml for ReplicationController.Replicas
This file contains 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 characters
# Base valid ReplicationController object | |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: valid-rc | |
spec: | |
replicas: 1 # Valid: default value | |
selector: | |
app: my-app | |
template: | |
metadata: | |
labels: | |
app: my-app | |
spec: | |
containers: | |
- name: my-container | |
image: nginx:latest | |
--- | |
# Test Case 1: Replicas = 3 (replace) | |
name: valid replicas - 3 (replace) | |
replace: | |
"spec.replicas": 3 | |
--- | |
# Test Case 2: Replicas = 0 (replace) | |
name: valid replicas - 0 (replace) | |
replace: | |
"spec.replicas": 0 | |
--- | |
# Test Case 3: Replicas = 10 (applyConfiguration) | |
name: valid replicas - 10 (applyConfiguration) | |
applyConfiguration: | |
spec: | |
replicas: 10 | |
--- | |
# Test Case 4: Replicas = 5 (jsonPatch) | |
name: valid replicas - 5 (jsonPatch) | |
jsonPatch: | |
- { "op": "replace", "path": "/spec/replicas", "value": 5 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is super promising. It's interesting the generated output uses all possible patch mechanisms instead of favoring one