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

Custom image name and tag overwritten by default values #144

Closed
iromli opened this issue Jul 25, 2020 · 1 comment · Fixed by #146
Closed

Custom image name and tag overwritten by default values #144

iromli opened this issue Jul 25, 2020 · 1 comment · Fixed by #146
Assignees
Labels
bug Something isn't working

Comments

@iromli
Copy link
Contributor

iromli commented Jul 25, 2020

Describe the bug

Existing image name and tag in settings.json are overwritten by values from gluu_versions.json.

To Reproduce

Steps to reproduce the behavior:

  1. Run pygluu-kubernetes generate-settings
  2. When asked to modify image name and tag, choose Y
  3. Enter LDAP image tag to 4.2.1_dev
  4. Wait until command finished
  5. Re-run pygluu-kubernetes generate-settings or pygluu-kubernetes install(no prompts appear)
  6. Check the value of LDAP_IMAGE_TAG in settings.json

Expected behavior

The value of LDAP_IMAGE_TAG should be 4.2.1_dev as entered when running generate-settings for the first time.

Additional context

Reading from source code, this line is problematic:

self.settings.update(image_names_and_tags)

as it will (eventually) overwrite existing keys in settings.json.

@iromli iromli added the bug Something isn't working label Jul 25, 2020
@iromli
Copy link
Contributor Author

iromli commented Jul 25, 2020

We can add check for non-empty image name and tag before merging values from gluu_versions.json into settings, for example:

self.settings.update({
    k: v for k, v in image_names_and_tags.items()
    if not self.settings.get(k, "")
})

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

Successfully merging a pull request may close this issue.

2 participants