Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Fix kubectl server-side dry-run flag #1462

Merged
merged 1 commit into from
Dec 14, 2020
Merged

Fix kubectl server-side dry-run flag #1462

merged 1 commit into from
Dec 14, 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 the bug Something isn't working label 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 <[email protected]>
Copy link
Contributor

@mjura mjura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jenting jenting requested review from thehejik and innobead December 14, 2020 08:05
@mjura mjura merged commit 4f32e41 into SUSE:maintenance-caasp-v4.2 Dec 14, 2020
@jenting jenting deleted the fix-kubectl-server-side-dry-run-flag branch December 14, 2020 11:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants