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

podman: run --replace prints only the new container id #20189

Merged

Conversation

giuseppe
Copy link
Member

Does this PR introduce a user-facing change?

run --replace prints only the ID for the new container, instead of the ID if the old one was stopped

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 28, 2023
@giuseppe giuseppe force-pushed the run--replace-print-only-cid branch from 7de16bc to 720afad Compare September 28, 2023 13:43
@giuseppe giuseppe changed the title Run replace print only cid podman: run --replace prints only the new container id Sep 28, 2023
@giuseppe giuseppe force-pushed the run--replace-print-only-cid branch from 720afad to de0882a Compare September 28, 2023 13:44
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

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

// make sure Podman prints only one ID
Expect(session.OutputToStringArray()).To(HaveLen(1))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: In case you have to repush, I'd like to check that it's really the CID.

Copy link
Member

Choose a reason for hiding this comment

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

I'll second this. Very easy fix:

diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 036cd4569..423c2e44c 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1622,3 +1622,3 @@ VOLUME %s`, ALPINE, volPath, volPath)
 			// make sure Podman prints only one ID
-			Expect(session.OutputToStringArray()).To(HaveLen(1))
+			Expect(session.OutputToString()).To(HaveLen(64))
 		}

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Sep 28, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, Luap99, vrothberg

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:
  • OWNERS [Luap99,giuseppe,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@giuseppe giuseppe force-pushed the run--replace-print-only-cid branch from de0882a to 0fc5e74 Compare September 28, 2023 19:38
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 28, 2023
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

// make sure Podman prints only one ID
Expect(session.OutputToStringArray()).To(HaveLen(64))
Copy link
Member

@edsantiago edsantiago Sep 28, 2023

Choose a reason for hiding this comment

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

Oops, I think this is going to fail - it should be OutputToString(), not ...Array()

UPDATE: yep, tested. It fails.

@TomSweeneyRedHat
Copy link
Member

TomSweeneyRedHat commented Sep 28, 2023

LGTM
once the test is adjusted

print only the new container ID when using --replace instead of the
terminated container ID if it was stopped.

Closes: containers#20185

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the run--replace-print-only-cid branch from 0fc5e74 to f21c1d2 Compare September 28, 2023 21:32
@edsantiago
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 29, 2023
@rhatdan
Copy link
Member

rhatdan commented Sep 29, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2023
@openshift-merge-robot openshift-merge-robot merged commit d602038 into containers:main Sep 29, 2023
@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 Dec 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants