Skip to content

Commit fb297ae

Browse files
chore: add windows skeleton
1 parent a28d350 commit fb297ae

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

e2e/test_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func validateVM(ctx context.Context, s *Scenario) {
348348
ValidateNodeCanRunAPod(ctx, s)
349349
switch s.VHD.OS {
350350
case config.OSWindows:
351-
// TODO: validate something
351+
ValidateCommonWindows(ctx, s)
352352
default:
353353
ValidateCommonLinux(ctx, s)
354354
}

e2e/validation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,8 @@ func ValidateCommonLinux(ctx context.Context, s *Scenario) {
112112
"AAD client ID and secret should be present in /etc/kubernetes/azure.json")
113113
}
114114
}
115+
116+
func ValidateCommonWindows(ctx context.Context, s *Scenario) {
117+
ValidateTLSBootstrapping(ctx, s)
118+
ValidateKubeletServingCertificateRotation(ctx, s)
119+
}

e2e/validators.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ func ValidateLeakedSecrets(ctx context.Context, s *Scenario) {
8383
}
8484

8585
func ValidateKubeletServingCertificateRotation(ctx context.Context, s *Scenario) {
86+
switch s.VHD.OS {
87+
case config.OSWindows:
88+
validateKubeletServingCertificateRotationWindows(ctx, s)
89+
default:
90+
validateKubeletServingCertificateRotationLinux(ctx, s)
91+
}
92+
}
93+
94+
func validateKubeletServingCertificateRotationLinux(ctx context.Context, s *Scenario) {
8695
if _, ok := s.Runtime.VM.VMSS.Tags["aks-disable-kubelet-serving-certificate-rotation"]; ok {
8796
s.T.Logf("ValidateKubeletServingCertificateRotation - VMSS has KSCR disablement tag, will validate that KSCR has been disabled")
8897
ValidateFileExcludesContent(ctx, s, "/etc/default/kubelet", "--rotate-server-certificates=true")
@@ -107,9 +116,23 @@ func ValidateKubeletServingCertificateRotation(ctx context.Context, s *Scenario)
107116
ValidateFileExcludesContent(ctx, s, "/etc/default/kubeletconfig.json", "\"tlsPrivateKeyFile\": \"/etc/kubernetes/certs/kubeletserver.key\"")
108117
ValidateFileHasContent(ctx, s, "/etc/default/kubeletconfig.json", "\"serverTLSBootstrap\": true")
109118
}
119+
120+
}
121+
122+
func validateKubeletServingCertificateRotationWindows(ctx context.Context, s *Scenario) {
123+
110124
}
111125

112126
func ValidateTLSBootstrapping(ctx context.Context, s *Scenario) {
127+
switch s.VHD.OS {
128+
case config.OSWindows:
129+
validateTLSBootstrappingWindows(ctx, s)
130+
default:
131+
validateTLSBootstrappingLinux(ctx, s)
132+
}
133+
}
134+
135+
func validateTLSBootstrappingLinux(ctx context.Context, s *Scenario) {
113136
ValidateDirectoryContent(ctx, s, "/var/lib/kubelet", []string{"kubeconfig"})
114137
ValidateDirectoryContent(ctx, s, "/var/lib/kubelet/pki", []string{"kubelet-server-current.pem"})
115138
kubeletLogs := execScriptOnVMForScenarioValidateExitCode(ctx, s, "sudo journalctl -u kubelet", 0, "could not retrieve kubelet logs with journalctl").stdout.String()
@@ -140,6 +163,10 @@ func ValidateTLSBootstrapping(ctx context.Context, s *Scenario) {
140163
}
141164
}
142165

166+
func validateTLSBootstrappingWindows(ctx context.Context, s *Scenario) {
167+
168+
}
169+
143170
func validateKubeletClientCSRCreatedBySecureTLSBootstrapping(ctx context.Context, s *Scenario) {
144171
kubeletClientCSRs, err := s.Runtime.Cluster.Kube.Typed.CertificatesV1().CertificateSigningRequests().List(ctx, metav1.ListOptions{
145172
FieldSelector: fmt.Sprintf("spec.signerName=%s", certv1.KubeAPIServerClientKubeletSignerName),

0 commit comments

Comments
 (0)