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

introduce --replace flag for play kube #11671

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

chenzhiwei
Copy link
Contributor

[NO TESTS NEEDED] With this flag, users can easily sync up
the yaml content with the existing pods.

Fixes #11481

cmd/podman/play/kube.go Outdated Show resolved Hide resolved
@rhatdan
Copy link
Member

rhatdan commented Sep 21, 2021

This is not a docs only change.

You need to add tests. Just make sure the second run does not fail, would be simplest, with containers being different.
Needs man page updates.

@rhatdan rhatdan changed the title [CI:DOCS] introduce --replace flag for play kube introduce --replace flag for play kube Sep 21, 2021
@chenzhiwei chenzhiwei force-pushed the kube-replace branch 2 times, most recently from 24c23cb to 071d007 Compare September 22, 2021 09:50
@baude
Copy link
Member

baude commented Sep 22, 2021

is their an objection to using podman play kube --down my.yaml and then podman play kube my.yaml ?

@mheon
Copy link
Member

mheon commented Sep 22, 2021

/approve

Change itself looks fine to me. If there's a serious desire for a one-command solution to deploy, I see no reason not to include it.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2021
@@ -150,6 +155,11 @@ func kube(cmd *cobra.Command, args []string) error {
if kubeOptions.Down {
return teardown(yamlfile)
}
if kubeOptions.Replace {
if err := teardown(yamlfile); err != nil && !errorhandling.Contains(err, define.ErrNoSuchPod) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the delete pod API of podman remote service returns untyped errors, so use string compare here.

@chenzhiwei
Copy link
Contributor Author

is their an objection to using podman play kube --down my.yaml and then podman play kube my.yaml ?

The --replace flag is used to ensure:

  1. The pod container images are up to date
  2. Sync up the pods and Kubernetes YAML file

I think this is a common use case when play with Kubernetes YAML file.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 27, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chenzhiwei, Luap99, mheon

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

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 3, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 5, 2021
@umohnani8
Copy link
Member

LGTM but tests are unhappy

With this flag, users can easily sync up the yaml content with the existing pods.

Fixes containers#11481

Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
@chenzhiwei
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 8, 2021

@chenzhiwei: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@rhatdan
Copy link
Member

rhatdan commented Oct 8, 2021

/ok-to-test

@mheon
Copy link
Member

mheon commented Oct 8, 2021

CI is green.

@mheon
Copy link
Member

mheon commented Oct 8, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2021
@openshift-merge-robot openshift-merge-robot merged commit bd4d9a0 into containers:main Oct 8, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suggest a --replace flag for play kube
8 participants