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

Deleted variables from API remain in configmap #136

Open
shreddedbacon opened this issue May 29, 2020 · 8 comments · May be fixed by #397
Open

Deleted variables from API remain in configmap #136

shreddedbacon opened this issue May 29, 2020 · 8 comments · May be fixed by #397
Labels

Comments

@shreddedbacon
Copy link
Member

shreddedbacon commented May 29, 2020

Describe the bug

When deleting an environment variable from the API, it doesn't remove it from the lagoon-env configmap. This is a problem when using the existence of the variable to enable/disable a feature. Like BASIC_AUTH_USERNAME and BASIC_AUTH_PASSWORD.

To Reproduce

Steps to reproduce the behavior:

  1. Add global|runtime variable to the API
  2. Deploy environment
  3. See variable is added to the config map
  4. Delete variable from the API
  5. Deploy environment
  6. See that deleted variable is still in the config map

Expected behavior

Deleted API variables should be removed from the configmap

Impacted customers

At least 2 large customers in APJ are impacted by this.

@shreddedbacon
Copy link
Member Author

shreddedbacon commented May 29, 2020

It should be possible to directly(or via msgqueue) patch the configmap when adding or deleting global|runtime variables directly via the API?

@seanhamlin
Copy link
Contributor

I like your idea @shreddedbacon, because then customers can still manually manipulate the configmap (if needed), and we can still delete environment variables.

@seanhamlin
Copy link
Contributor

This issue is impacting another large customer in APJ.

@chandanatk
Copy link

As reported by a customer, if a user tries deleting and recreating environments as a workaround for this issue, it exposes another bug. When an environment is deleted, the environment variables are still seen with lagoon cli, but when a new deploy recreates the environment, variables are actually deleted. The user then needs to recreate the variables in time for the deployment that is already running.

Steps to reproduce the behaviour:

  1. Delete environment
  2. Check the variables using Lagoon CLI and see they exist
  3. Deploy the environment
  4. Again check the variables using Lagoon CLI and see they don't exist
  5. Add the variables

@shreddedbacon
Copy link
Member Author

As reported by a customer, if a user tries deleting and recreating environments as a workaround for this issue, it exposes another bug. When an environment is deleted, the environment variables are still seen with lagoon cli, but when a new deploy recreates the environment, variables are actually deleted. The user then needs to recreate the variables in time for the deployment that is already running.

Steps to reproduce the behaviour:

  1. Delete environment
  2. Check the variables using Lagoon CLI and see they exist
  3. Deploy the environment
  4. Again check the variables using Lagoon CLI and see they don't exist
  5. Add the variables

This is a funky one.
When deleting an environment, the environment remains in the API still (its still accessible from a historical data perspective) so the variables attached to that environment will remain available.

But as it has been deleted, when a new deployment starts, it will create an entirely new environment in the API making the old one no longer accessible by the same name (only by ID), and this will have no variables attached to it, even though the old one did.

I'm not sure if this is related to this issue, or if its better raised as a new issue entirely, where we support adding variables to environments, before the environment is created. Or being able to pre-seed an environment, then deploy it afterwards.

@grahamethompson
Copy link

As a customer we're obviously experiencing this issue. Would be great to have this resolved - thanks, much appreciated!

@tobybellwood tobybellwood transferred this issue from uselagoon/lagoon Oct 31, 2022
@shreddedbacon
Copy link
Member Author

As we were discussing this, https://github.com/uselagoon/lagoon/pull/2348/files#diff-e77377f4b63b4a8a4d877d7a1adb7aa9cab7252db63dd9c3f43b64d5dc972408R1073 with the new implementation of this PR, when the op-remove runs on the api-only variable configmap, we could also do an op-remove on the existing lagoon-env configmap

@shreddedbacon
Copy link
Member Author

@rocketeerbkw have you had a chance to work on this?

@shreddedbacon shreddedbacon linked a pull request Nov 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants