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

Set rawimage for containers created via play kube #13527

Conversation

machacekondra
Copy link
Contributor

@machacekondra machacekondra commented Mar 16, 2022

This commit set the containers RawImageName to default image name
specified in Pod YAML, so the containers could be used via autoupdate
feature, which needs the RawImageName to be set.

Currently RawImageName is set only for the create/run/clone podman
commands.

Previously if auto-update command was executed on containers created by podman play kube we got ouput:

$ podman auto-update --dry-run
UNIT                     CONTAINER                       IMAGE                                 POLICY      UPDATED
Error: registry auto-updating container "7f519304b0081d142b8f1802a50ed0ce7832bcc6862b44e12bd9510120b93c41": raw-image name is empty

@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2022

LGTM
@vrothberg @umohnani8 PTAL

@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2022

/approve
Thanks @machacekondra

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: machacekondra, rhatdan

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2022
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 but note that auto-update does not support containers created via play kube.

@vrothberg
Copy link
Member

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2022
@Luap99
Copy link
Member

Luap99 commented Mar 16, 2022

LGTM but note that auto-update does not support containers created via play kube.

I was just about to ask this.

@machacekondra You have to rebase to the latest main to fix the windows build test.

@machacekondra
Copy link
Contributor Author

LGTM but note that auto-update does not support containers created via play kube.

Well, the only way I was able to make it work via play kube was:

apiVersion: v1
kind: Pod
metadata:
  name: mypod
  labels:
    io.containers.autoupdate: registry
    PODMAN_SYSTEMD_UNIT: mypod.service
spec:
  containers:
    - name: test-container
      image: quay.io/bitnami/nginx:latest

The labels are propageted here: https://github.com/containers/podman/blob/main/pkg/domain/infra/abi/play.go#L440
The only problem is that we need to set manually PODMAN_SYSTEMD_UNIT, so we need to know the name of the service in advance.

This commit set the containers RawImageName to default image name
specified in Pod YAML, so the containers could be used via autoupdate
feature, which needs the RawImageName to be set.

Currently RawImageName is set only for the create/run/clone podman
commands.

[NO NEW TESTS NEEDED]

Signed-off-by: Ondra Machacek <[email protected]>
@machacekondra machacekondra force-pushed the set_raw_image_name_for_play_kube branch from 6aa8d3c to 449f2fc Compare March 16, 2022 12:38
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2022
@Luap99
Copy link
Member

Luap99 commented Mar 17, 2022

/lgtm
/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 Mar 17, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
@openshift-merge-robot openshift-merge-robot merged commit ecd2746 into containers:main Mar 17, 2022
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants