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

Add a kubectl rollout undo e2e test #119915

Merged
merged 4 commits into from Oct 9, 2023
Merged

Conversation

AxeZhan
Copy link
Member

@AxeZhan AxeZhan commented Aug 12, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Currently we don't have test for kubectl rollout undo,some code changes may affect this behavior(take #116759 as an example). We should add some tests to always ensure kubectl rollout undo is not broken. This pr adds a simple e2e test for it.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 12, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.28 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.28.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Sat Aug 12 10:37:24 UTC 2023.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 12, 2023
@k8s-ci-robot k8s-ci-robot added area/test sig/cli Categorizes an issue or PR as relevant to SIG CLI. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 12, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 12, 2023
@AxeZhan AxeZhan force-pushed the rollout_e2e branch 4 times, most recently from 9f0eaf6 to 2c55f16 Compare August 12, 2023 14:32
@AxeZhan
Copy link
Member Author

AxeZhan commented Aug 12, 2023

/cc @atiratree

test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2023
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
@atiratree
Copy link
Member

thx for the update
/lgtm

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 24, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 24, 2023
@aojea
Copy link
Member

aojea commented Aug 24, 2023

/hold cancel

Thanks

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 24, 2023
@AxeZhan
Copy link
Member Author

AxeZhan commented Aug 24, 2023

@aojea Updated, PTAL

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

A few minor nits, pls ping me when you get them updated.

test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl/kubectl.go Outdated Show resolved Hide resolved
@AxeZhan
Copy link
Member Author

AxeZhan commented Aug 25, 2023

@soltysh

test/e2e/kubectl/rollout.go Outdated Show resolved Hide resolved
test/e2e/kubectl/rollout.go Outdated Show resolved Hide resolved
})

ginkgo.Describe("undo", func() {
deploymentYaml := commonutils.SubstituteImageName(string(readTestFileOrDie(labeledDeploymentFilename)))
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't understand why you can't use the existing files, rather than creating yet another one?

Copy link
Member Author

Choose a reason for hiding this comment

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

We want to test that the deployment has only the original set of labels and annotations? To confirm this, it might be good to add some to the original yaml. And I'm not sure whether changing the existing files will break sth, so I created a new one. If it's ok I can add some labels to the existing file and then use it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

kindly ping @soltysh :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but you only inject new envs, thus re-using all the labels and annotations just to ensure they don't change after rollback, so what's stopping you from using an existing deployment file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it's not that complicated. I'm just not sure if it's ok to modify an existing file. Updated to use httpd yaml now. I'll squash if the rest is ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

ping @soltysh

@AxeZhan AxeZhan requested a review from soltysh August 29, 2023 02:00
@AxeZhan
Copy link
Member Author

AxeZhan commented Sep 19, 2023

@soltysh

@AxeZhan
Copy link
Member Author

AxeZhan commented Oct 8, 2023

ping @soltysh

@pacoxu
Copy link
Member

pacoxu commented Oct 8, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AxeZhan, dims, pacoxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dims
Copy link
Member

dims commented Oct 8, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 7c5313f9ceee271159240e6e76cedc04bd7d6cd1

@AxeZhan
Copy link
Member Author

AxeZhan commented Oct 9, 2023

/retest

@pacoxu
Copy link
Member

pacoxu commented Oct 9, 2023

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/119915/pull-kubernetes-e2e-gce/1711034185398882304 failed for a recent top flake #121013 that was fixed early today.
To avoid it, you may retest or rebase with the latest master branch.

@k8s-ci-robot k8s-ci-robot merged commit cdc026f into kubernetes:master Oct 9, 2023
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants