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: fix matching UnversionedKubeletConfigMap defaults #108127

Conversation

neolit123
Copy link
Member

@neolit123 neolit123 commented Feb 15, 2022

/kind failing-test

What this PR does / why we need it:

The kubeadm defaults in features.go differ between versions.
e2e_kubeadm tests cannot import the kubeadm features.go,
or easily detect the versioned of the kubeadm binary used
to create the cluster.

Check for the existence of both versioned and unversioned
objects independent of the value of the FG. Once the FG
goes GA only the unversioned objects should be checked.

Without this change kubeadm e2e skew tests will fail where kubeadm
is at 1.24 (has the FG defaulted to true), the FG is not
explicitly set by the user and the k8s version is at 1.23.

Which issue(s) this PR fixes:

xref kubernetes/kubeadm#1582 (comment)
https://k8s-testgrid.appspot.com/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-latest-on-1-23

Special notes for your reviewer:

need to backport this to 1.23. technically we only need to fix the 1.23 branch, but having this in master first is accurate.

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. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 15, 2022
@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 approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm area/test 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 Feb 15, 2022
@neolit123
Copy link
Member Author

/triage accepted
/priority important-soon
/cc @pacoxu

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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 Feb 15, 2022
@neolit123
Copy link
Member Author

/hold need to revist as something is not right

@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 Feb 15, 2022
The kubeadm defaults in features.go differ between versions.
e2e_kubeadm tests cannot import the kubeadm features.go,
or easily detect the versioned of the kubeadm binary used
to create the cluster.

Check for the existence of both versioned and unversioned
objects independent of the value of the FG. Once the FG
goes GA only the unversioned objects should be checked.

Without this change kubeadm e2e skew tests will fail where kubeadm
is at 1.24 (has the FG defaulted to true), the FG is not
explicitly set by the user and the k8s version is at 1.23.
@neolit123 neolit123 force-pushed the 1.24-fix-e2e-kubeadm-unversioned-kubelet-cm-defaults branch from e4f932b to 2fba7c8 Compare February 15, 2022 16:38
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 15, 2022
Comment on lines -40 to -45
kubeletConfigConfigMapResource = &authv1.ResourceAttributes{
Namespace: kubeSystemNamespace,
Name: "",
Resource: "configmaps",
Verb: "get",
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this object was unused

if err != nil {
cm, err = f.ClientSet.CoreV1().
ConfigMaps(kubeSystemNamespace).
Get(context.TODO(), kubeletConfigConfigMapNameVersioned, metav1.GetOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

just remove lines like this after the feature gate is removed.

/lgtm
hadn't thought about the kubeadm n-1 kubelet skew when reviewing last PR.
/unhold

@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 Feb 16, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 16, 2022
@pacoxu
Copy link
Member

pacoxu commented Feb 16, 2022

/retest

1 similar comment
@pacoxu
Copy link
Member

pacoxu commented Feb 16, 2022

/retest

@k8s-ci-robot k8s-ci-robot merged commit a06e272 into kubernetes:master Feb 16, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Feb 16, 2022
k8s-ci-robot added a commit that referenced this pull request Feb 24, 2022
…08127-origin-release-1.23

Automated cherry pick of #108127: test/e2e_kubeadm: fix matching UnversionedKubeletConfigMap
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/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants