Skip to content

Commit

Permalink
add test case reproducing convert bug
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Bojanowski <[email protected]>
  • Loading branch information
hidalgopl committed Dec 13, 2024
1 parent fa41bde commit 971a3f0
Showing 1 changed file with 161 additions and 0 deletions.
161 changes: 161 additions & 0 deletions config/legacyconfig/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,167 @@ controlPlane:
`,
ExpectedErr: "migrate legacy k8s values: config is already in correct format",
},
{
Name: "statefulset affinity added",
Distro: "k8s",
In: `isolation:
# nodeProxyPermission:
# enabled: true
enabled: true
podSecurityStandard: baseline
resourceQuota:
enabled: true
quota:
count/endpoints: null
count/pods: null
count/services: null
count/configmaps: null
count/secrets: null
count/persistentvolumeclaims: null
limits.cpu: 256
limits.memory: 1Ti
requests.storage: 10Ti
requests.ephemeral-storage: null
requests.memory: 128Gi
requests.cpu: 120
services.loadbalancers: null
services.nodeports: null
limitRange:
enabled: true
defaultRequest:
cpu: 24m
memory: 32Mi
ephemeral-storage: null
default:
ephemeral-storage: null
memory: 2Gi
cpu: 512m
# max:
# cpu: 32
# memory: 64Gi
# ephemeral-storage: 512Gi
networkPolicy:
enabled: false
storage:
className: px-pool
sync:
secrets:
enabled: true
nodes:
enabled: true
networkpolicies:
enabled: true
hoststorageclasses:
enabled: true
# enableHA: true
embeddedEtcd:
enabled: true
syncer:
resources:
limits:
cpu: '8'
ephemeral-storage: 8Gi
memory: 10Gi
# extraArgs:
# - '--sync-labels=namespace,aussiebb.io/,..aussiebb.io/'
replicas: 3
labels:
aussiebb.io/profile: "true"
storage:
size: 50Gi
className: px-pool-etcd
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- vcluster
topologyKey: "kubernetes.io/hostname"
coredns:
replicas: 3
resources:
limits:
cpu: '2'
memory: '1Gi'
api:
extraArgs:
- "-v=4"`,
Expected: `controlPlane:
backingStore:
etcd:
embedded:
enabled: true
coredns:
deployment:
replicas: 3
resources:
limits:
cpu: "2"
memory: 1Gi
distro:
k8s:
apiServer:
extraArgs:
- -v=4
enabled: true
statefulSet:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- vcluster
topologyKey: "kubernetes.io/hostname"
highAvailability:
replicas: 3
persistence:
volumeClaim:
size: 50Gi
storageClass: px-pool-etcd
resources:
limits:
cpu: "8"
memory: 10Gi
scheduling:
podManagementPolicy: OrderedReady
policies:
limitRange:
default:
cpu: 512m
memory: 2Gi
ephemeral-storage: null
defaultRequest:
cpu: 24m
memory: 32Mi
ephemeral-storage: null
enabled: true
podSecurityStandard: baseline
resourceQuota:
enabled: true
quota:
limits.cpu: 256
limits.memory: 1Ti
requests.cpu: 120
requests.memory: 128Gi
requests.storage: 10Ti
requests.ephemeral-storage: null
sync:
fromHost:
nodes:
enabled: true
storageClasses:
enabled: true
toHost:
networkPolicies:
enabled: true`,
ExpectedErr: "",
},
}

for _, testCase := range testCases {
Expand Down

0 comments on commit 971a3f0

Please sign in to comment.