Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: remove repair-malformed-updates deprecated flag (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritazh authored and jackfrancis committed Feb 13, 2019
1 parent 0a6c592 commit b37cda9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/topics/clusterdefinitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ Below is a list of apiserver options that are _not_ currently user-configurable,
| "--etcd-keyfile" | "/etc/kubernetes/certs/etcdclient.key" |
| "--etcd-servers" | _calculated value that represents etcd servers_ |
| "--profiling" | "false" |
| "--repair-malformed-updates" | "false" |
| "--repair-malformed-updates" | "false" (_deprecated in v1.14_) |
| "--tls-cert-file" | "/etc/kubernetes/certs/apiserver.crt" |
| "--tls-private-key-file" | "/etc/kubernetes/certs/apiserver.key" |
| "--client-ca-file" | "/etc/kubernetes/certs/ca.crt" |
Expand Down
7 changes: 7 additions & 0 deletions pkg/api/defaults-apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ func (cs *ContainerService) setAPIServerConfig() {
delete(o.KubernetesConfig.APIServerConfig, key)
}
}
// Enforce flags removal that don't work with specific versions, to accommodate upgrade
// Remove flags that are not compatible with 1.14
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.14.0-alpha.1") {
for _, key := range []string{"--repair-malformed-updates"} {
delete(o.KubernetesConfig.APIServerConfig, key)
}
}
}

func getDefaultAdmissionControls(cs *ContainerService) (string, string) {
Expand Down
20 changes: 20 additions & 0 deletions pkg/api/defaults-apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,23 @@ func TestAPIServerConfigEnableProfiling(t *testing.T) {
a["--profiling"])
}
}

func TestAPIServerConfigRepairMalformedUpdates(t *testing.T) {
// Test default
cs := CreateMockContainerService("testcluster", "1.13.0", 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--repair-malformed-updates"] != "false" {
t.Fatalf("got unexpected default value for '--repair-malformed-updates' API server config: %s",
a["--repair-malformed-updates"])
}

// Validate that 1.14.0 doesn't include --repair-malformed-updates at all
cs = CreateMockContainerService("testcluster", "1.14.0", 3, 2, false)
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if _, ok := a["--repair-malformed-updates"]; ok {
t.Fatalf("got a value for the deprecated '--repair-malformed-updates' API server config: %s",
a["--repair-malformed-updates"])
}
}

0 comments on commit b37cda9

Please sign in to comment.