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

Prevent automatic image building in kube play #13285

Closed
Korijn opened this issue Feb 18, 2022 · 6 comments · Fixed by #13286
Closed

Prevent automatic image building in kube play #13285

Korijn opened this issue Feb 18, 2022 · 6 comments · Fixed by #13286
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Korijn
Copy link

Korijn commented Feb 18, 2022

/kind feature

Description

In #11180 support was added to build images automatically in podman play kube.

However, this is undesirable if your images cannot be built without additional custom commands such as build secrets/arguments.

Our project's repository structure just happens to be organized according to the structure described the command's reference:

If there is a directory named foobar in the current working directory with a file
named Containerfile or Dockerfile, Podman play kube will build that image and name it foobar. 

So, if no prebuilt image is available, and can be pulled, podman still decides to try and build, and of course fail.

The only workaround is to manually pull the individual images beforehand, or build them manually. Annoying and time consuming!

This is on podman version 3.4.2.

I see a couple of options:

  • Instead of building automatically, add a flag --build-missing to opt-in
  • Add a flag to opt-out of automatic building --no-build
@Luap99
Copy link
Member

Luap99 commented Feb 18, 2022

I think you can use --build=false already

@Korijn
Copy link
Author

Korijn commented Feb 18, 2022

I think you can use --build=false already

Really? I didn't realize the flag took an argument. I'll try.

@Luap99
Copy link
Member

Luap99 commented Feb 18, 2022

All bool flags can be used with =true|false
Looking at the code the default is already false so there is something wrong here if it builds without setting --build.

@Korijn
Copy link
Author

Korijn commented Feb 18, 2022

(I haven't found time to try yet)

Well, in pkg/domain/infra/abi/play.go the following if statement is used:

if (len(buildFile) > 0 && !existsLocally) || (len(buildFile) > 0 && options.Build) {

That doesn't seem to really honor the --build=false case. Even if options.Build is false, the first part of the || statement will evaluate to true. That's what makes this "automatic", I suppose.

@flouthoc
Copy link
Collaborator

@Korijn I think above PR should close this. I think --build was meant to be true by default according to docs here https://github.com/containers/podman/blob/main/docs/source/markdown/podman-play-kube.1.md but I agree it should honor false value.

@Korijn
Copy link
Author

Korijn commented Feb 21, 2022

Sure, thanks !

@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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 a pull request may close this issue.

3 participants