Skip to content

Commit

Permalink
fix tinkerbell unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Oct 3, 2023
1 parent 5886541 commit decba43
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pkg/providers/tinkerbell/controlplane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,24 @@ spec:
imageTag: v1.8.3-eks-1-21-4
apiServer:
extraArgs:
audit-policy-file: /etc/kubernetes/audit-policy.yaml
audit-log-path: /var/log/kubernetes/api-audit.log
audit-log-maxage: "30"
audit-log-maxbackup: "10"
audit-log-maxsize: "512"
authentication-token-webhook-config-file: /etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml
feature-gates: ServiceLoadBalancerClass=true
extraVolumes:
- hostPath: /etc/kubernetes/audit-policy.yaml
mountPath: /etc/kubernetes/audit-policy.yaml
name: audit-policy
pathType: File
readOnly: true
- hostPath: /var/log/kubernetes
mountPath: /var/log/kubernetes
name: audit-log-dir
pathType: DirectoryOrCreate
readOnly: false
- hostPath: /var/lib/kubeadm/aws-iam-authenticator/
mountPath: /etc/kubernetes/aws-iam-authenticator/
name: authconfig
Expand Down Expand Up @@ -322,6 +337,8 @@ spec:
status: {}
owner: root:root
path: /etc/kubernetes/manifests/kube-vip.yaml
- owner: root:root
path: /etc/kubernetes/audit-policy.yaml
- content: |
# clusters refers to the remote service.
clusters:
Expand Down Expand Up @@ -395,9 +412,24 @@ spec:
clusterConfiguration:
apiServer:
extraArgs:
audit-policy-file: /etc/kubernetes/audit-policy.yaml
audit-log-path: /var/log/kubernetes/api-audit.log
audit-log-maxage: "30"
audit-log-maxbackup: "10"
audit-log-maxsize: "512"
authentication-token-webhook-config-file: /etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml
feature-gates: ServiceLoadBalancerClass=true
extraVolumes:
- hostPath: /etc/kubernetes/audit-policy.yaml
mountPath: /etc/kubernetes/audit-policy.yaml
name: audit-policy
pathType: File
readOnly: true
- hostPath: /var/log/kubernetes
mountPath: /var/log/kubernetes
name: audit-log-dir
pathType: DirectoryOrCreate
readOnly: false
- hostPath: /var/lib/kubeadm/aws-iam-authenticator/
mountPath: /etc/kubernetes/aws-iam-authenticator/
name: authconfig
Expand Down Expand Up @@ -476,6 +508,8 @@ spec:
status: {}
owner: root:root
path: /etc/kubernetes/manifests/kube-vip.yaml
- owner: root:root
path: /etc/kubernetes/audit-policy.yaml
- content: |
# clusters refers to the remote service.
clusters:
Expand Down
4 changes: 4 additions & 0 deletions pkg/providers/tinkerbell/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,10 @@ func tinkerbellCP(clusterName string, opts ...cpOpt) *tinkerbell.ControlPlane {
Content: "apiVersion: v1\nkind: Pod\nmetadata:\n creationTimestamp: null\n name: kube-vip\n namespace: kube-system\nspec:\n containers:\n - args:\n - manager\n env:\n - name: vip_arp\n value: \"true\"\n - name: port\n value: \"6443\"\n - name: vip_cidr\n value: \"32\"\n - name: cp_enable\n value: \"true\"\n - name: cp_namespace\n value: kube-system\n - name: vip_ddns\n value: \"false\"\n - name: vip_leaderelection\n value: \"true\"\n - name: vip_leaseduration\n value: \"15\"\n - name: vip_renewdeadline\n value: \"10\"\n - name: vip_retryperiod\n value: \"2\"\n - name: address\n value: 1.1.1.1\n image: \n imagePullPolicy: IfNotPresent\n name: kube-vip\n resources: {}\n securityContext:\n capabilities:\n add:\n - NET_ADMIN\n - NET_RAW\n volumeMounts:\n - mountPath: /etc/kubernetes/admin.conf\n name: kubeconfig\n hostNetwork: true\n volumes:\n - hostPath:\n path: /etc/kubernetes/admin.conf\n name: kubeconfig\nstatus: {}\n",
ContentFrom: nil,
},
{
Path: "/etc/kubernetes/audit-policy.yaml",
Owner: "root:root",
},
},
Users: []bootstrapv1.User{
{
Expand Down

0 comments on commit decba43

Please sign in to comment.