Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --set instead of deprecated --override flag #14838

Merged
merged 1 commit into from
Dec 21, 2022
Merged
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
2 changes: 1 addition & 1 deletion docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ kubetest2 kops \
If you don't specify any additional flags, the kOps deployer Go module will create a kubernetes cluster using the following defaults.

```shell
kops create cluster --name my.testcluster.com --admin-access <Client Public IP> --cloud aws --kubernetes-version v1.20.2 --master-count 1 --master-volume-size 48 --node-count 4 --node-volume-size 48 --override cluster.spec.nodePortAccess=0.0.0.0/0 --ssh-public-key /home/ubuntu/.ssh/id_rsa.pub --yes --zones <Random Zone> --master-size c5.large --networking calico
kops create cluster --name my.testcluster.com --admin-access <Client Public IP> --cloud aws --kubernetes-version v1.20.2 --master-count 1 --master-volume-size 48 --node-count 4 --node-volume-size 48 --set cluster.spec.nodePortAccess=0.0.0.0/0 --ssh-public-key /home/ubuntu/.ssh/id_rsa.pub --yes --zones <Random Zone> --master-size c5.large --networking calico
```

For the `--zones` flag, the kOps deployer will select a random zone based on the `--cloud-provider` flag, for `aws` the full list of AWS zones can be found [here](https://github.com/kubernetes/kops/blob/master/tests/e2e/kubetest2-kops/aws/zones.go) and for `gce` the full list of GCE zones can be found [here](https://github.com/kubernetes/kops/blob/master/tests/e2e/kubetest2-kops/gce/zones.go).
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
"--cloud", d.CloudProvider,
"--kubernetes-version", d.KubernetesVersion,
"--ssh-public-key", d.SSHPublicKeyPath,
"--override", "cluster.spec.nodePortAccess=0.0.0.0/0",
"--set", "cluster.spec.nodePortAccess=0.0.0.0/0",
}
if yes {
args = append(args, "--yes")
Expand All @@ -138,7 +138,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
args = appendIfUnset(args, "--master-volume-size", "48")
args = appendIfUnset(args, "--node-count", "4")
args = appendIfUnset(args, "--node-volume-size", "48")
args = appendIfUnset(args, "--override", adminAccess)
args = appendIfUnset(args, "--set", adminAccess)
args = appendIfUnset(args, "--zones", strings.Join(zones, ","))

switch d.CloudProvider {
Expand Down Expand Up @@ -294,7 +294,7 @@ func (d *deployer) zones() ([]string, error) {
}

// appendIfUnset will append an argument and its value to args if the arg is not already present
// This shouldn't be used for arguments that can be specified multiple times like --override
// This shouldn't be used for arguments that can be specified multiple times like --set
func appendIfUnset(args []string, arg, value string) []string {
for _, existingArg := range args {
existingKey := strings.Split(existingArg, "=")
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/scenarios/addon-resource-tracking/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ KOPS_BASE_URL="https://artifacts.k8s.io/binaries/kops/1.21.5"
KOPS=$(kops-download-from-base)

# Start with a cluster running nodeTerminationHandler
ARGS="--override=cluster.spec.nodeTerminationHandler.enabled=true"
ARGS="${ARGS} --override=cluster.spec.nodeTerminationHandler.enableSQSTerminationDraining=false"
ARGS="--set=cluster.spec.nodeTerminationHandler.enabled=true"
ARGS="${ARGS} --set=cluster.spec.nodeTerminationHandler.enableSQSTerminationDraining=false"

${KUBETEST2} \
--up \
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/scenarios/cilium-connectivity-test/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export KOPS_BASE_URL
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
KOPS=$(kops-download-from-base)

ARGS="--override=cluster.spec.networking.cilium.hubble.enabled=true --override=cluster.spec.certManager.enabled=true"
ARGS="--set=cluster.spec.networking.cilium.hubble.enabled=true --set=cluster.spec.certManager.enabled=true"

if [[ $1 == "kube-proxy" ]]; then
ARGS="${ARGS} --override=cluster.spec.networking.cilium.enableNodePort=false --override=cluster.spec.kubeProxy.enabled=true"
ARGS="${ARGS} --set=cluster.spec.networking.cilium.enableNodePort=false --set=cluster.spec.kubeProxy.enabled=true"
# This test requires private topology, which kubetest2 does not support.
#elif [[ $1 == "eni"]]
# ARGS="${ARGS} --override=cluster.spec.cilium.ipam=eni --override=cluster.spec.cilium.disable-masquerade"
# ARGS="${ARGS} --set=cluster.spec.cilium.ipam=eni --set=cluster.spec.cilium.disable-masquerade"
# ARGS="${ARGS} --topology private"
elif [[ $1 == "node-local-dns" ]]; then
ARGS="${ARGS} --override=cluster.spec.kubeDNS.provider=CoreDNS --override=cluster.spec.kubeDNS.nodeLocalDNS.enabled=true"
ARGS="${ARGS} --set=cluster.spec.kubeDNS.provider=CoreDNS --set=cluster.spec.kubeDNS.nodeLocalDNS.enabled=true"
fi

${KUBETEST2} \
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/scenarios/metrics-server/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh

kops-acquire-latest

OVERRIDES="${OVERRIDES-} --override=cluster.spec.metricsServer.enabled=true"
OVERRIDES="$OVERRIDES --override=cluster.spec.certManager.enabled=true"
OVERRIDES="${OVERRIDES-} --set=cluster.spec.metricsServer.enabled=true"
OVERRIDES="$OVERRIDES --set=cluster.spec.certManager.enabled=true"
OVERRIDES="${OVERRIDES} --master-size=t4g.medium --node-size=t4g.medium"

kops-up
Expand Down