Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 10 additions & 30 deletions pkg/controller/kubelet-config/kubelet_config_features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,19 @@ func TestFeatureGateDrift(t *testing.T) {
fgAccess := createNewDefaultFeatureGateAccess()
ctrl := f.newController(fgAccess)

kubeletConfig, err := generateOriginalKubeletConfigIgn(cc, ctrl.templatesDir, "master")
if err != nil {
t.Errorf("could not generate kubelet config from templates %v", err)
}
contents, err := ctrlcommon.DecodeIgnitionFileContents(kubeletConfig.Contents.Source, kubeletConfig.Contents.Compression)
require.NoError(t, err)
originalKubeConfig, err := decodeKubeletConfig(contents)
// Generate kubelet config with feature gates applied
kubeletConfig, err := generateOriginalKubeletConfigWithFeatureGates(cc, ctrl.templatesDir, "master", fgAccess)
require.NoError(t, err)

t.Logf("Generated Kubelet Config Feature Gates: %v", kubeletConfig.FeatureGates)

defaultFeatureGates, err := generateFeatureMap(fgAccess)
if err != nil {
t.Errorf("could not generate defaultFeatureGates: %v", err)
}
if !reflect.DeepEqual(originalKubeConfig.FeatureGates, *defaultFeatureGates) {
var found = map[string]bool{}
for featureGate := range originalKubeConfig.FeatureGates {
for apiGate := range *defaultFeatureGates {
if featureGate == apiGate {
found[apiGate] = true
}
}
}
for featureGate := range originalKubeConfig.FeatureGates {
if _, ok := found[featureGate]; !ok {
t.Logf("%s is not present in api", featureGate)
}
}
for featureGate := range *defaultFeatureGates {
if _, ok := found[featureGate]; !ok {
t.Logf("%s is not present in template", featureGate)
}
}
t.Errorf("template FeatureGates do not match openshift/api FeatureGates: (tmpl=[%v], api=[%v]", originalKubeConfig.FeatureGates, defaultFeatureGates)
require.NoError(t, err)

t.Logf("Expected Feature Gates: %v", *defaultFeatureGates)

if !reflect.DeepEqual(kubeletConfig.FeatureGates, *defaultFeatureGates) {
t.Errorf("Generated kubelet configuration feature gates do not match expected feature gates: generated=%v, expected=%v", kubeletConfig.FeatureGates, *defaultFeatureGates)
}
})
}
Expand Down
15 changes: 0 additions & 15 deletions templates/master/01-master-kubelet/_base/files/kubelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ contents:
systemCgroups: /system.slice
nodeStatusUpdateFrequency: 10s
nodeStatusReportFrequency: 5m
featureGates:
AlibabaPlatform: true
AzureWorkloadIdentity: true
BuildCSIVolumes: true
CloudDualStackNodeIPs: true
DisableKubeletCloudCredentialProviders: false
ExternalCloudProvider: true
ExternalCloudProviderAzure: true
ExternalCloudProviderGCP: true
ExternalCloudProviderExternal: true
KMSv1: true
NetworkLiveMigration: true
OpenShiftPodSecurityAdmission: true
PrivateHostedZoneAWS: true
VSphereControlPlaneMachineSet: true
serverTLSBootstrap: true
tlsMinVersion: VersionTLS12
tlsCipherSuites:
Expand Down
15 changes: 0 additions & 15 deletions templates/worker/01-worker-kubelet/_base/files/kubelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ contents:
systemCgroups: /system.slice
nodeStatusUpdateFrequency: 10s
nodeStatusReportFrequency: 5m
featureGates:
AlibabaPlatform: true
AzureWorkloadIdentity: true
BuildCSIVolumes: true
CloudDualStackNodeIPs: true
DisableKubeletCloudCredentialProviders: false
ExternalCloudProvider: true
ExternalCloudProviderAzure: true
ExternalCloudProviderGCP: true
ExternalCloudProviderExternal: true
KMSv1: true
NetworkLiveMigration: true
OpenShiftPodSecurityAdmission: true
PrivateHostedZoneAWS: true
VSphereControlPlaneMachineSet: true
serverTLSBootstrap: true
tlsMinVersion: VersionTLS12
tlsCipherSuites:
Expand Down