@@ -83,6 +83,15 @@ func ValidateLeakedSecrets(ctx context.Context, s *Scenario) {
8383}
8484
8585func 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
112126func 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+
143170func 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