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

test/e2e_kubeadm: add test for the kubeadm:cluster-admins CRB #121674

Merged
merged 1 commit into from Nov 2, 2023

Conversation

neolit123
Copy link
Member

What type of PR is this?

/kind feature
/area test

What this PR does / why we need it:

Add a test that checks if the CRB (kubeadm:cluster-admins) used for binding admin.conf file users (part of the kubeadm:cluster-admins Group) to the "cluster-admins" ClusterRole exists in kubeadm clusters.

It does that only for versions newer than the version when this feature was added.

Which issue(s) this PR fixes:

xref kubernetes/kubeadm#2414

Special notes for your reviewer:

NONE

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/feature Categorizes issue or PR as related to a new feature. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 1, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2023
@neolit123
Copy link
Member Author

not a strict requirement but a nice to have in the kubeadm e2e test framework.

/triage accepted
/priority important-longterm
/milestone v1.29
/kind feature

/cc @chendave @SataQiu

@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Nov 1, 2023
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 1, 2023
Copy link
Member Author

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

tested locally:

# create a kubeadm cluster with artifacts from latest HEAD
# ...

# build the e2e suite
make WHAT=test/e2e_kubeadm/e2e_kubeadm.test

# run the suite
sudo ./_output/local/go/bin/e2e_kubeadm.test --kubeconfig /etc/kubernetes/admin.conf --ginkgo.focus=admin --ginkgo.v

  Nov  1 16:33:01.830: INFO: The --provider flag is not set. Continuing as if --provider=skeleton had been used.
Running Suite: E2EKubeadm suite - /home/lubo/go/src/k8s.io/kubernetes
=====================================================================
Random Seed: 1698849181 - will randomize all specs

Will run 1 of 38 specs
SSSSSSSSSSSSS
------------------------------
[sig-cluster-lifecycle] [area-kubeadm] admin CRB must exist and be bound to the cluster-admin ClusterRole
test/e2e_kubeadm/admin_test.go:49
  STEP: Creating a kubernetes client @ 11/01/23 16:33:01.838
  Nov  1 16:33:01.838: INFO: >>> kubeConfig: /etc/kubernetes/admin.conf
  Nov  1 16:33:01.875: INFO: Waiting up to 7m0s for all (but 0) nodes to be ready
• [0.044 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSS

Ran 1 of 38 Specs in 0.050 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 37 Skipped
PASS

@neolit123
Copy link
Member Author

/retest

@neolit123 neolit123 force-pushed the 1.29-super-admin-conf branch 5 times, most recently from 09f0c3b to da999c3 Compare November 2, 2023 07:27
Copy link
Member

@chendave chendave left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

feel free to unhold pls.

}

// If the version is older than the version when this feature was added, skip this test
minVer := version.MustParseSemantic("v1.29.0-alpha.2.186+30ed50d32e3557")
Copy link
Member

@chendave chendave Nov 2, 2023

Choose a reason for hiding this comment

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

How about moving ahead the version (05076de57fc49f) a little bit when the flaky issue was fixed?

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, updating.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@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 Nov 2, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 629b5d64d83bc62adae427d5e1b16391f0e8bc8f

Add a test that checks if the CRB (kubeadm:cluster-admins)
used for binding admin.conf file users (part of the
kubeadm:cluster-admins Group) to the "cluster-admins"
ClusterRole exists in kubeadm clusters.

It does that only for versions newer than the version
when this feature was added.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2023
@chendave
Copy link
Member

chendave commented Nov 2, 2023

/lgtm
/unhold

thanks @neolit123 !

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 2, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 902e787ac29b19fed03ce6bb6296b85a746fc80f

@neolit123
Copy link
Member Author

/retest

@neolit123
Copy link
Member Author

pull-kubernetes-unit

logged ticket for flakes
#121696

@k8s-ci-robot k8s-ci-robot merged commit 3240e2b into kubernetes:master Nov 2, 2023
15 checks passed
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/kubeadm area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants