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

Fix setup of configmap/secret/projected/downwardapi #64855

Merged

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Jun 6, 2018

Only call setup after they are found; otherwise
we are left with orphan directories that are never
cleaned up.

Fixes #64788 and #64779

cc @aveshagarwal @saad-ali

/sig storage

Fix setup of configmap/secret/projected/downwardapi volumes

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 6, 2018
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 6, 2018
@gnufied
Copy link
Member Author

gnufied commented Jun 6, 2018

btw - I chose not to manually call teardown on other errors because that code path is harder to test and very less likely to occur. I think, this should be good enough for majority of cases.

if err := wrapped.SetUpAt(dir, fsGroup); err != nil {
return err
}
if err := volumeutil.MakeNestedMountpoints(b.volName, dir, b.pod); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

My concern is that any of the steps after this can fail and we won't clean up the result of this method. Maybe we can add a clean up routine to execute if any of the subsequent steps fail?

Copy link
Member

Choose a reason for hiding this comment

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

Ditto for other plugins.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah - so as I commented above, I omitted that case on purpose and there were 2 reasons of that:

  1. It is much harder to test other failures and hence much smaller chance of them happening in real world.
  2. cleaning up after both wrapped emptydir and nested mount points has been created is messier and since configmap/secrets are such core k8s constructs, I want to approach that cautiously. Problem is - first we have to remove the mount points we created and then unmount emptydir and I am worried we do not have enough test coverage around that area. :(

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I guess this will take care of the worst cases. So it is better then nothing.

@gnufied gnufied force-pushed the fix-configmap-cleanup-on-fail branch from f4dc5a5 to ea6539c Compare June 6, 2018 22:14
Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

Thanks for writing a test to verify and prevent regressions!!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2018
@saad-ali saad-ali added kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. status/approved-for-milestone labels Jun 6, 2018
@saad-ali saad-ali added this to the v1.11 milestone Jun 6, 2018
@dims
Copy link
Member

dims commented Jun 6, 2018

@gnufied the verify job errors are legit. the node-e2e are probably flakes.

@gnufied
Copy link
Member Author

gnufied commented Jun 7, 2018

@dims yeah pushing a fix shortly.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

3 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@dims
Copy link
Member

dims commented Jun 7, 2018

/lgtm cancel

(stop the bot from trying again and again)

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2018
@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process

@dims @gnufied @saad-ali

Pull Request Labels
  • sig/storage: Pull Request will be escalated to these SIGs if needed.
  • priority/critical-urgent: Never automatically move pull request out of a release milestone; continually escalate to contributor and SIG through all available channels.
  • kind/bug: Fixes a bug discovered during the current release.
Help

Only call setup after they are found; otherwise
we are left with orphan directories that are never
cleaned up.
@gnufied gnufied force-pushed the fix-configmap-cleanup-on-fail branch from ea6539c to f44d1b9 Compare June 7, 2018 13:15
@gnufied
Copy link
Member Author

gnufied commented Jun 7, 2018

@dims fixed the problems with verify. can you lgtm please?

@dims
Copy link
Member

dims commented Jun 7, 2018

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, gnufied, saad-ali

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-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 63905, 64855). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 1a4d063 into kubernetes:master Jun 7, 2018
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 12, 2018
k8s-github-robot pushed a commit that referenced this pull request Jun 15, 2018
…5-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #64855: Fix setup of configmap/secret/projected/downwardapi

Cherry pick of #64855 on release-1.10.

#64855: Fix setup of configmap/secret/projected/downwardapi

```release-note
Fix setup of configmap/secret/projected/downwardapi volumes
```
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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

6 participants