kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

kubectl should accept --to-revision option

Open pierluigilenoci opened this issue 6 years ago • 50 comments

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

What happened:

I want to patch an annotation of an older revision of a deployment

What you expected to happen:

I want to use this command to patch it

kubectl patch deployment mydeployment --patch '{"metadata": {"annotations": {"kubernetes.io/change-cause": "custom message"}}}' --namespace mynamespace --record=false --to-revision 3

How to reproduce it (as minimally and precisely as possible):

There is nothing to reproduce

Anything else we need to know?:

Environment:

  • Kubernetes version: all-version

pierluigilenoci avatar Oct 05 '18 13:10 pierluigilenoci

/sig api-machinery

pierluigilenoci avatar Oct 05 '18 13:10 pierluigilenoci

/sig cli /remove-sig api-machinery

jennybuckley avatar Oct 11 '18 20:10 jennybuckley

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jan 09 '19 20:01 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Jan 11 '19 08:01 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Apr 11 '19 09:04 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Apr 11 '19 11:04 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jul 10 '19 11:07 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Jul 10 '19 15:07 pierluigilenoci

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 avatar May 12 '23 21:05 k8s-ci-robot

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Oct 08 '19 15:10 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Oct 09 '19 08:10 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jan 07 '20 08:01 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Jan 09 '20 11:01 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Apr 08 '20 12:04 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Apr 08 '20 14:04 pierluigilenoci

/kind feature

brianpursley avatar Apr 29 '20 13:04 brianpursley

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jul 28 '20 14:07 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Jul 28 '20 14:07 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Oct 26 '20 15:10 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Oct 27 '20 08:10 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jan 25 '21 08:01 fejta-bot

Valid resource types for kubectl rollout:

  • deployments
  • daemonsets
  • statefulsets

--to-revision is restricted to those resources.

However, kubectl patch can apply to any resources.

kubectl patch deployment mydeployment --patch '{"metadata": {"annotations": {"kubernetes.io/change-cause": "custom message"}}}' --namespace mynamespace --record=false
--to-revision 3

For this example, I think adding a command like kubectl rollout amend or kubectl rollout update can solve your problem.


[root@daocloud ~]# kubectl rollout history deploy/mysql
deployment.apps/mysql
REVISION  CHANGE-CAUSE
2         <none>
3         custom message 3

[root@daocloud ~]# kubectl rollout amend deploy/mysql --revision=2  "new change message"
REVISION  CHANGE-CAUSE
2         new change message
3         custom message 3

This is an example for implementation.

pacoxu avatar Jan 25 '21 09:01 pacoxu

/remove-lifecycle stale

pierluigilenoci avatar Jan 25 '21 10:01 pierluigilenoci

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot avatar Apr 25 '21 13:04 fejta-bot

/remove-lifecycle stale

pierluigilenoci avatar Apr 26 '21 09:04 pierluigilenoci

@rikatz could you please take a look?

pierluigilenoci avatar Apr 26 '21 09:04 pierluigilenoci

/assign Sorry, missed this notification. Will try to check next week

rikatz avatar Jul 21 '21 16:07 rikatz

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 19 '21 16:10 k8s-triage-robot

@rikatz any news about this?

pierluigilenoci avatar Oct 25 '21 09:10 pierluigilenoci

/remove-lifecycle stale Sorry @pierluigilenoci I'm a bit busy with other stuff, I will leave this open here and try to look by the end of this week

rikatz avatar Oct 25 '21 13:10 rikatz