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

Fix kubectl server-side dry-run flag (backport to v4.5) #1463

Merged
merged 1 commit into from
Dec 19, 2020
Merged

Fix kubectl server-side dry-run flag (backport to v4.5) #1463

merged 1 commit into from
Dec 19, 2020

Conversation

jenting
Copy link

@jenting jenting commented Dec 14, 2020

Why is this PR needed?

The flag of server-side dry-run is different at k8s client < 1.18.0 and k8s client >= 1.18.0.

What does this PR do?

Check the kubectl client version and return the corresponding server-side dry-run flag.
If k8s client version < v1.18.0, the server-side dry-run flag is --server-dry-run.
If k8s client version >= v1.18.0, the server-side dry-run flag is --dry-run=server.

Anything else a reviewer needs to know?

N/A

Info for QA

This is info for QA so that they can validate this. This is mandatory if this PR fixes a bug.
If this is a new feature, a good description in "What does this PR do" may be enough.

Related info

N/A

Status BEFORE applying the patch

  1. The local kubectl CLI version < 1.18.0
  2. Deploy a cluster by previous skuba CLI.
  3. Use the new skuba CLI to perform cluster upgrade and add-on upgrade.
  4. The error message display on the console.

Status AFTER applying the patch

  1. The local kubectl CLI version < 1.18.0
  2. Deploy a cluster by previous skuba CLI.
  3. Use the new skuba CLI to perform cluster upgrade and add-on upgrade.
  4. The add-on upgrade success.

AND

  1. The local kubectl CLI version >= 1.18.0
  2. Deploy a cluster by previous skuba CLI.
  3. Use the new skuba CLI to perform cluster upgrade and add-on upgrade.
  4. The add-on upgrade success.

Docs

N/A

Merge restrictions

(Please do not edit this)

We are in v4-maintenance phase, so we will restrict what can be merged to prevent unexpected surprises:

What can be merged (merge criteria):
    2 approvals:
        1 developer: code is fine
        1 QA: QA is fine
    there is a PR for updating documentation (or a statement that this is not needed)

@jenting jenting self-assigned this Dec 14, 2020
@jenting jenting added bug Something isn't working backport labels Dec 14, 2020
If k8s client version < v1.18.0, the server-side dry-run flag is `--server-dry-run`.
If k8s client version >= v1.18.0, the server-side dry-run flag is `--dry-run=server`.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
@jenting jenting merged commit 21795fd into SUSE:master Dec 19, 2020
@jenting jenting deleted the fix-kubectl-server-side-dry-run-flag-backport branch December 19, 2020 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants