-
Notifications
You must be signed in to change notification settings - Fork 105
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
Allow dynamic KC config updates #591
Conversation
Implementation Notes:What happens if I update my ca bundle whilst KC is running?
But what about KC process? Does it pick up the change?It does not. I added in a
What about GoRoutine race conditions whilst
|
6e88fb4
to
72faf4f
Compare
Hmm, I need to give some more thought on our |
This seems like a bug:
I think it's because we noop if we don't find a ConfigMap or Secret, when instead we need to somehow revert to defaults |
Good point @benmoss ! I updated the code a bit to accommodate that case. Basically always apply the config (even if there doesn't exist one) -- therefore just set the default (empty string) values. |
Nice, I was confused by that |
bbe1ac9
to
a6f11af
Compare
c25c95c
to
2fa8bb7
Compare
- Dynamically update config based on secret or configmap updates for KC Signed-off-by: Neil Hickey <nhickey@vmware.com>
Signed-off-by: Neil Hickey <nhickey@vmware.com>
- We don't need to check if the secret or config exists anymore - we just always set the values (even if empty) - This allows us to restore the values to defaults when the config is deleted Signed-off-by: Neil Hickey <nhickey@vmware.com>
- Allows test to skip the os.File() calls in addTrustedCerts() Signed-off-by: Neil Hickey <nhickey@vmware.com>
- This allows testing of each use case (create, update, delete) - Added a stub for the other tests to mock the os.File() calls with temp files Signed-off-by: Neil Hickey <nhickey@vmware.com>
- explicitly unset environment variables on empty values provided - error check on close() files Signed-off-by: Neil Hickey <nhickey@vmware.com>
Signed-off-by: Neil Hickey <nhickey@vmware.com>
Signed-off-by: Neil Hickey <nhickey@vmware.com>
- As rename is an atomic operation, this should prevent any read/write issues from other programs (think ytt, imgpkg, git) from reading the ca-bundle file whilst something is writing to it Signed-off-by: Neil Hickey <nhickey@vmware.com>
- Turns out returning an error forces the reconciler to requeue and this is not what we want - Use tempDir() for instead of hardcoding - Remove tempfile after use Signed-off-by: Neil Hickey <nhickey@vmware.com>
- This is required for an os.Rename() - Pass the ns into the attachwatches() using KAPPCTRL_SYSTEM_NAMESPACE Signed-off-by: Neil Hickey <nhickey@vmware.com>
2fa8bb7
to
8f3f0a3
Compare
Signed-off-by: Neil Hickey <nhickey@vmware.com>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #179
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
See this comment for some concerns and questions before I implemented this feature
kubectl exec
was failing from the test suite - always with errors likeRunning 'kubectl exec -n kapp-controller deployment/kapp-controller -- bash -c ls'... OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash -c ls": executable file not found in $PATH: unknown
Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.: