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

Drop init container annotations during conversion #59880

Merged

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Feb 14, 2018

https://github.com/kubernetes/kubernetes/pull/51816/files#diff-0fa94eafdf1c7cd2171c836b53fd6323 removed special handling of init container annotations in API conversion in 1.8

However, older clients (like 1.7 kubectl) still performed that handling in some paths, which would make an object round-tripped through kubectl show up with additional annotations.

Those additions would get flagged as disallowed mutations in some objects.

This change strips init-container annotations during conversion so that old clients sending init container annotations (which are inert in 1.8+) don't trigger validation errors around immutable fields.

Fixes #54816

Restores the ability of older clients to delete and scale jobs with initContainers

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 14, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 14, 2018
@liggitt liggitt added this to the v1.9 milestone Feb 14, 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 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 Feb 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Feb 14, 2018

/kind bug
/sig apps
/priority important-soon

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Feb 14, 2018
@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 14, 2018
@liggitt liggitt removed the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Feb 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Feb 14, 2018

cc @kubernetes/api-reviewers @janetkuo

@caesarxuchao
Copy link
Member

#54816 happens in 1.7. An 1.7 kubectl creates the additional annotations, but the latest one shouldn't. Our version skew policy states that "client should be skewed no more than one minor version from the master", so I don't think we need this fix in the master. Can we directly target it to 1.7 and 1.8?

@caesarxuchao
Copy link
Member

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Feb 14, 2018

Can we directly target it to 1.7 and 1.8?

We can't make this change in 1.7 (since 1.7 still supports 1.5 kubelets, which require the annotation), only 1.8.

@liggitt
Copy link
Member Author

liggitt commented Feb 14, 2018

I don't think we need this fix in the master

I'd like to treat init container annotations consistently... we still drop them in pod conversion. We can remove these when we remove that behavior.

@caesarxuchao
Copy link
Member

caesarxuchao commented Feb 14, 2018

I'd like to treat init container annotations consistently... we still drop them in pod conversion. We can remove these when we remove that behavior.

Perhaps I missed something, can we remove the special code in the pod conversion altogether? We are heading to 1.10, neither 1.8 kubelet or 1.9 kubectl will add the annotation.

[edit] If we decide that we need these special conversion functions, could you add a TODO saying when we can drop them?

@liggitt
Copy link
Member Author

liggitt commented Feb 19, 2018

can we remove the special code in the pod conversion altogether? We are heading to 1.10, neither 1.8 kubelet or 1.9 kubectl will add the annotation.

We have to drop the annotations from the pod until we guarantee no kubelet honoring those annotations will make use of them. We don't support kubelets older than 2 versions skewed from the apiserver, but we don't prevent them, either, so I'd keep that drop in place for the immediate future.

@liggitt
Copy link
Member Author

liggitt commented Feb 19, 2018

any other comments?

@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request Current

@caesarxuchao @janetkuo @liggitt

Pull Request Labels
  • sig/api-machinery sig/apps: Pull Request will be escalated to these SIGs if needed.
  • priority/important-soon: Escalate to the pull request owners and SIG owner; move out of milestone after several unsuccessful escalation attempts.
  • kind/bug: Fixes a bug discovered during the current release.
Help

@caesarxuchao
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2018
@caesarxuchao
Copy link
Member

We don't support kubelets older than 2 versions skewed from the apiserver, but we don't prevent them, either, so I'd keep that drop in place for the immediate future.

If you can get to it before it's merged, could you capture this in the comment of dropInitContainerAnnotations?

@liggitt
Copy link
Member Author

liggitt commented Feb 20, 2018

If you can get to it before it's merged, could you capture this in the comment of dropInitContainerAnnotations?

updated

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2018
@caesarxuchao
Copy link
Member

/lgtm

Thanks.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, liggitt

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

@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.

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 71c374d into kubernetes:master Feb 20, 2018
@janetkuo
Copy link
Member

@liggitt are we cherrypicking this into 1.8 and 1.9?

@liggitt
Copy link
Member Author

liggitt commented Feb 20, 2018

Yes. Will open them shortly

@liggitt
Copy link
Member Author

liggitt commented Feb 21, 2018

picks opened

k8s-github-robot pushed a commit that referenced this pull request Feb 24, 2018
…0-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #59880: Drop init container annotations during conversion

Cherry pick of #59880 on release-1.8.

#59880: Drop init container annotations during conversion
k8s-github-robot pushed a commit that referenced this pull request Mar 14, 2018
…0-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #59880: Drop init container annotations during conversion

Cherry pick of #59880 on release-1.9.

#59880: Drop init container annotations during conversion
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

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/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants