From b39da996f3837f4548c87bbbba3a1fa95a8c7805 Mon Sep 17 00:00:00 2001 From: Kristiyan Gostev Date: Mon, 13 Jun 2022 17:03:23 +0300 Subject: [PATCH] Adapting the unit tests to the new changes --- .../admission/auditpolicy/admission_test.go | 8 ++++---- .../botanist/component/coredns/coredns_test.go | 1 + .../component/kubeproxy/configcodec_test.go | 5 +++++ .../botanist/component/kubeproxy/kube_proxy_test.go | 13 +++++++++---- .../botanist/component/vpnshoot/vpnshoot_test.go | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pkg/admissioncontroller/webhooks/admission/auditpolicy/admission_test.go b/pkg/admissioncontroller/webhooks/admission/auditpolicy/admission_test.go index 1c1d06c69b6d..8a3300f4d056 100644 --- a/pkg/admissioncontroller/webhooks/admission/auditpolicy/admission_test.go +++ b/pkg/admissioncontroller/webhooks/admission/auditpolicy/admission_test.go @@ -78,7 +78,7 @@ var _ = Describe("handler", func() { validAuditPolicy = ` --- -apiVersion: audit.k8s.io/v1beta1 +apiVersion: audit.k8s.io/v1 kind: Policy rules: - level: RequestResponse @@ -92,7 +92,7 @@ rules: ` anotherValidAuditPolicy = ` --- -apiVersion: audit.k8s.io/v1beta1 +apiVersion: audit.k8s.io/v1 kind: Policy rules: - level: RequestResponse @@ -106,7 +106,7 @@ rules: ` missingKeyAuditPolicy = ` --- -apiVersion: audit.k8s.io/v1beta1 +apiVersion: audit.k8s.io/v1 kind: Policy rules: - level: RequestResponse @@ -116,7 +116,7 @@ rules: ` invalidAuditPolicy = ` --- -apiVersion: audit.k8s.io/v1beta1 +apiVersion: audit.k8s.io/v1 kind: Policy rules: - level: FakeLevel diff --git a/pkg/operation/botanist/component/coredns/coredns_test.go b/pkg/operation/botanist/component/coredns/coredns_test.go index bf08c4d2b0be..3a3b7e648f23 100644 --- a/pkg/operation/botanist/component/coredns/coredns_test.go +++ b/pkg/operation/botanist/component/coredns/coredns_test.go @@ -228,6 +228,7 @@ spec: policyTypes: - Ingress - Egress +status: {} ` deploymentYAMLFor = func(apiserverHost string, podAnnotations map[string]string) string { out := `apiVersion: apps/v1 diff --git a/pkg/operation/botanist/component/kubeproxy/configcodec_test.go b/pkg/operation/botanist/component/kubeproxy/configcodec_test.go index 7db463ac28ef..b7e4d2cf9b02 100644 --- a/pkg/operation/botanist/component/kubeproxy/configcodec_test.go +++ b/pkg/operation/botanist/component/kubeproxy/configcodec_test.go @@ -49,6 +49,9 @@ conntrack: min: null tcpCloseWaitTimeout: null tcpEstablishedTimeout: null +detectLocal: + bridgeInterface: "" + interfaceNamePrefix: "" detectLocalMode: "" enableProfiling: false healthzBindAddress: "" @@ -77,7 +80,9 @@ showHiddenMetricsForVersion: "" udpIdleTimeout: 0s winkernel: enableDSR: false + forwardHealthCheckVip: false networkName: "" + rootHnsEndpointName: "" sourceVip: "" ` ) diff --git a/pkg/operation/botanist/component/kubeproxy/kube_proxy_test.go b/pkg/operation/botanist/component/kubeproxy/kube_proxy_test.go index f3d886136597..8a957437ab82 100644 --- a/pkg/operation/botanist/component/kubeproxy/kube_proxy_test.go +++ b/pkg/operation/botanist/component/kubeproxy/kube_proxy_test.go @@ -187,9 +187,9 @@ type: Opaque configMapNameFor = func(ipvsEnabled bool) string { if !ipvsEnabled { - return "kube-proxy-config-1212aab2" + return "kube-proxy-config-1c3aa913" } - return "kube-proxy-config-b9f4a324" + return "kube-proxy-config-ef237614" } configMapYAMLFor = func(ipvsEnabled bool) string { out := `apiVersion: v1 @@ -218,6 +218,9 @@ data: min: null tcpCloseWaitTimeout: null tcpEstablishedTimeout: null + detectLocal: + bridgeInterface: "" + interfaceNamePrefix: "" detectLocalMode: "" enableProfiling: false featureGates: @@ -256,7 +259,9 @@ data: udpIdleTimeout: 0s winkernel: enableDSR: false + forwardHealthCheckVip: false networkName: "" + rootHnsEndpointName: "" sourceVip: "" immutable: true kind: ConfigMap @@ -424,16 +429,16 @@ subjects: if ipvsEnabled { annotations = []string{ - references.AnnotationKey(references.KindConfigMap, configMapNameFor(ipvsEnabled)) + `: ` + configMapNameFor(ipvsEnabled), references.AnnotationKey(references.KindConfigMap, configMapConntrackFixScriptName) + `: ` + configMapConntrackFixScriptName, + references.AnnotationKey(references.KindConfigMap, configMapNameFor(ipvsEnabled)) + `: ` + configMapNameFor(ipvsEnabled), references.AnnotationKey(references.KindConfigMap, configMapCleanupScriptName) + `: ` + configMapCleanupScriptName, references.AnnotationKey(references.KindSecret, secretName) + `: ` + secretName, } } else { annotations = []string{ references.AnnotationKey(references.KindConfigMap, configMapConntrackFixScriptName) + `: ` + configMapConntrackFixScriptName, - references.AnnotationKey(references.KindConfigMap, configMapCleanupScriptName) + `: ` + configMapCleanupScriptName, references.AnnotationKey(references.KindConfigMap, configMapNameFor(ipvsEnabled)) + `: ` + configMapNameFor(ipvsEnabled), + references.AnnotationKey(references.KindConfigMap, configMapCleanupScriptName) + `: ` + configMapCleanupScriptName, references.AnnotationKey(references.KindSecret, secretName) + `: ` + secretName, } } diff --git a/pkg/operation/botanist/component/vpnshoot/vpnshoot_test.go b/pkg/operation/botanist/component/vpnshoot/vpnshoot_test.go index 2e4acbecf1ff..bd43621ebbd5 100644 --- a/pkg/operation/botanist/component/vpnshoot/vpnshoot_test.go +++ b/pkg/operation/botanist/component/vpnshoot/vpnshoot_test.go @@ -166,6 +166,7 @@ spec: policyTypes: - Egress - Ingress +status: {} ` serviceAccountYAML = `apiVersion: v1 automountServiceAccountToken: false