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

Fixing a small bug with GMSA support and adding an e2e test on it. #74708

Closed
wants to merge 1 commit into from

Conversation

wk8
Copy link
Contributor

@wk8 wk8 commented Feb 28, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:

A previous PR (#73726)
added GMSA support to the dockershim. Unfortunately, there was a
bug in there: the registry keys used to pass the cred specs down
to Docker were being cleaned up too early, right after the containers'
creation - before Docker would ever try to read them, when trying to
actually start the container.

This patch fixes this, and also adds an e2e test on this.

Which issue(s) this PR fixes:
@yujuhong requested an e2e test on this at #73726 (review).

Special notes for your reviewer:
The e2e test has been verified to pass on a cluster with a Windows node with the
WindowsGMSA=true feature gate enabled; however, I don't believe that's the case
when running a "regular" build. Would it be possible to:

  1. enable that feature gate when running Windows e2e tests in a build?
  2. or else enable dynamic Kubelet config for these tests, so that each spec can
    set the config it needs?

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 28, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @wk8. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 28, 2019
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 28, 2019
@wk8
Copy link
Contributor Author

wk8 commented Feb 28, 2019

@yujuhong @dchen1107 @michmike @PatrickLang : guidance appreciated as to how to make sure that e2e test can run successfully as part of builds (see the Special notes for your reviewer section in the PR message). Thanks!

@wk8
Copy link
Contributor Author

wk8 commented Feb 28, 2019

/assign @yujuhong @michmike

A previous PR (kubernetes#73726)
added GMSA support to the dockershim. Unfortunately, there was a
bug in there: the registry keys used to pass the cred specs down
to Docker were being cleaned up too early, right after the containers'
creation - before Docker would ever try to read them, when trying to
actually start the container.

This patch fixes this, and also adds an e2e test on this.

Signed-off-by: Jean Rouge <rougej+github@gmail.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wk8
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers: deads2k, yujuhong

If they are not already assigned, you can assign the PR to them by writing /assign @deads2k @yujuhong in a comment when ready.

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

@ddebroy
Copy link
Member

ddebroy commented Feb 28, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 28, 2019
Copy link
Member

@ddebroy ddebroy left a comment

Choose a reason for hiding this comment

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

The changes look good. However I think it will be better at this point to split the PRs into at least different commits or maybe independent PRs for:

  1. The GMSA dockershim bugfix
  2. The e2e test for GMSA plus other Windows test refactoring
  3. Enhancements in hack/make-rules/test-e2e-node.sh

echo "Running on CGE, not asking for sudo credentials"
elif sudo --non-interactive "$(which /bin/bash)" -c true 2> /dev/null; then
# if we can run bash without a password, it's a pretty safe bet that either
# we can run any commant without a password, or that sudo credentials
Copy link
Member

Choose a reason for hiding this comment

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

typo: commant => command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to #74733

@@ -438,3 +447,20 @@ func (ds *dockerService) UpdateContainerResources(_ context.Context, r *runtimea
}
return &runtimeapi.UpdateContainerResourcesResponse{}, nil
}

func (ds *dockerService) performPlatformSpecificContainerCleanupForContainer(containerID string) {
Copy link
Member

Choose a reason for hiding this comment

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

How about calling this performPlatformSpecificCleanupForContainer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

}

for _, err := range ds.performPlatformSpecificContainerCleanup(cleanupInfo) {
klog.Warningf("error when cleaning up after container %q's: %v", containerNameOrID, err)
Copy link
Member

Choose a reason for hiding this comment

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

The 's can be removed in the message after container %q's

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Typo.

f := framework.NewDefaultFramework("density-test-windows")

BeforeEach(func() {
Copy link
Member

Choose a reason for hiding this comment

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

This block seems relevant for a Windows test. Should this be removed?

Copy link
Member

Choose a reason for hiding this comment

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

Realized this has been shifted to the top-level down below in test/e2e/windows/framework.go .. makes sense.

@wk8
Copy link
Contributor Author

wk8 commented Feb 28, 2019

Split up in 3 different PRs: #74738, #74737 and #74733. Closing this one.

@wk8 wk8 closed this Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants