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

Options with quarkus.openshift.init-containers prefix are ignored #39230

Open
fedinskiy opened this issue Mar 6, 2024 · 6 comments · May be fixed by #45296
Open

Options with quarkus.openshift.init-containers prefix are ignored #39230

fedinskiy opened this issue Mar 6, 2024 · 6 comments · May be fixed by #45296
Labels
area/kubernetes kind/bug Something isn't working

Comments

@fedinskiy
Copy link
Contributor

Describe the bug

I have an application, which uses flyway and deployed on openshift via quarkus extension. I want to change init container by using properties quarkus.openshift.init-containers.wait-for-flyway and quarkus.openshift.init-containers.wait-for-flyway.image-pull-policy described in the guide[1]. However, these changes are not reflected in generated openshift.yml file.

[1] https://quarkus.io/guides/init-tasks#using-a-custom-wait-for-container-image

Expected behavior

Generated openshift.yml file contains custom image and pull policy in its initContainers section, quay.io/quarkusqeteam/wait and Always respectively.

Actual behavior

Generated openshift.yml file contains default image and pull policy in its initContainers section, groundnuty/k8s-wait-for:no-root-v1.7 and IfNotPresent respectively.

How to Reproduce?

  1. git clone -b configure-container [email protected]:fedinskiy/reproducer.git
  2. cd reproducer && mvn clean verify -Popenshift
  3. grep -B4 "wait" target/kubernetes/openshift.yml

Output of uname -a or ver

6.7.3-200.fc39.x86_64

Output of java -version

Java version: 21.0.1, vendor: Eclipse Adoptium

Quarkus version or git rev

3.8.1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

Container image can be changed via quarkus.openshift.init-task-defaults.wait-for-container.image property, but a) for all tasks b) there is no way to change pull policy.

@fedinskiy fedinskiy added the kind/bug Something isn't working label Mar 6, 2024
Copy link

quarkus-bot bot commented Mar 6, 2024

/cc @geoand (kubernetes,openshift), @iocanel (kubernetes,openshift)

@fedinskiy
Copy link
Contributor Author

The changes were added here: #35918 and are related to this task: #35455

@appiepollo14
Copy link
Contributor

Would like to give this one a try

@appiepollo14
Copy link
Contributor

@fedinskiy did some digging, controlling the image works when using the following config:
quarkus.openshift.init-tasks.flyway.image=quay.io/quarkusqeteam/wait
However, this is not according to the documentation page.

Trying to control the IPP in the same way, results in nothing as there is no imagePullPolicy config in the initTasks class.
quarkus.openshift.init-tasks.flyway.image-pull-policy=Always
I can create an extra initContainer using for example:

quarkus.openshift.init-tasks.xx.image=quay.io/quarkusqeteam/wait
quarkus.openshift.init-containers.xx.image-pull-policy=IfNotPresent

I just can't combine the two things above to work as intended.

@geoand @iocanel do you have any directions to continue solving the issue? I don't know how to proceed.

Do you have pointers for a way to debug what is going on in the Quarkus sources when compiling for example the reproducer project?

@appiepollo14
Copy link
Contributor

Looks to me like for example the Flyway extension, creates an initTask as a buildStep. https://github.com/quarkusio/quarkus/blob/main/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java#L265-L273

The initTaskConfig doesn't have that many config properties, like for example the image-pull-policy isn't available. https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/InitTaskConfig.java

gsmet added a commit to gsmet/quarkus that referenced this issue Dec 27, 2024
The documentation was not in line with the implementation so I fixed
things in both (and also fixed some typos in passing).

Fixes quarkusio#39230
@gsmet gsmet linked a pull request Dec 27, 2024 that will close this issue
@gsmet
Copy link
Member

gsmet commented Dec 27, 2024

Good report and good reproducer, thanks. And thanks @appiepollo14 for the additional insights.

Both the implementation and the documentation were problematic. I tried to fix both in #45296 .

I experimented using your reproducer and things look fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants