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

awx image tag ignored #27

Closed
gmisura opened this issue Aug 20, 2021 · 5 comments
Closed

awx image tag ignored #27

gmisura opened this issue Aug 20, 2021 · 5 comments

Comments

@gmisura
Copy link

gmisura commented Aug 20, 2021

I wanted to try some older versions of AWX to match my client's tower version (not entirely sure what AWX == to Tower 3.7.5)

I added

image:
  tag: "16.0.0"

To my values.yml but it was overridden and I got 17.0.1 (not the default 17.1.0).
There any way to use different awx tags?

Thanks

@jbielick
Copy link
Member

Yep, image.repository and image.tag are interpolated for the deployment here:

image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"

I have no suggestions based on the code sample you provided. There are a lot of ways to provide values in helm, so that may have something to do with what you're seeing.

@jbielick
Copy link
Member

I've added some tests that I believe verify things work correctly.

@test "$name: uses correct image tag" {
template_with_defaults $name
[ "$status" -eq 0 ]
local actual=$(get '.spec.template.spec.containers[] | select(.name == "web") | .image')
[ "$actual" = "ansible/awx:17.1.0" ]
}
@test "$name: uses custom image tag" {
template_with_defaults $name --set image.tag=16.0.0
[ "$status" -eq 0 ]
local actual=$(get '.spec.template.spec.containers[] | select(.name == "web") | .image')
[ "$actual" = "ansible/awx:16.0.0" ]
}
@test "$name: task uses correct image tag" {
template_with_defaults $name
[ "$status" -eq 0 ]
local actual=$(get '.spec.template.spec.containers[] | select(.name == "task") | .image')
[ "$actual" = "ansible/awx:17.1.0" ]
}
@test "$name: task uses custom image tag" {
template_with_defaults $name --set image.tag=16.0.0
[ "$status" -eq 0 ]
local actual=$(get '.spec.template.spec.containers[] | select(.name == "task") | .image')
[ "$actual" = "ansible/awx:16.0.0" ]
}

Let me know if I've missed something.

@gmisura
Copy link
Author

gmisura commented Aug 27, 2021

@jbielick
I agree your test proves it is working, but doesn't explain how the values.yaml should be constructed to override the tag.
I've tried both

image:
tag: "16.0.0"

and

image.tag: "16.0.0"

and I still end up with v17.x

@jbielick
Copy link
Member

jbielick commented Aug 27, 2021

@gmisura there are quite a few ways of providing values to helm and using this chart. In my experience, some combination of how you're using -f (values file), --set and how and what order those command line args and files are being read is usually the issue in situations like this.

Since I have no info about how you're invoking helm, how you're providing or layering values files, what command line flags you're providing to helm, I simply cannot provide any additional insight.

The tests demonstrate that when the values are provided via the command-line as image.tag, the chart works correctly. Unless I've missed something egregious, the problem likely exists in your invocation of helm and using this chart.

If you can provide a minimal reproducible case, I might be able to help find your issue.

Here's a minimal reproducible case of things working correctly:

› cat test.yaml
image:
  tag: "1.2.3"
› helm install adwerx/awx \
    --dry-run --debug --generate-name \
    --set defaultAdminExistingSecret=test \
    --set secretKeyExistingSecret=test \
    --set postgresqlExistingSecret=test \
    --set postgresql.postgresqlPassword='abc' \
    -f test.yaml | grep ansible/awx 
install.go:172: [debug] Original chart version: ""
install.go:189: [debug] CHART PATH: /Users/me/Library/Caches/helm/repository/awx-3.2.1.tgz

  repository: ansible/awx
          image: "ansible/awx:1.2.3"
          image: "ansible/awx:1.2.3"

@gmisura
Copy link
Author

gmisura commented Aug 28, 2021

What the heck? I tried exactly that and it didn't work before and now it does! Shesh.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants