-
Notifications
You must be signed in to change notification settings - Fork 27
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
[2/3] Add Inline Solution for ConfigMaps #593
base: master
Are you sure you want to change the base?
Conversation
16324de
to
f4ab763
Compare
c463eef
to
4371dc9
Compare
9c57062
to
f732160
Compare
f732160
to
bb4468a
Compare
bb4468a
to
ee45eb2
Compare
ee45eb2
to
d24e5a4
Compare
pkg/core/stack_resources.go
Outdated
|
||
base := &v1.ConfigMap{ | ||
ObjectMeta: metaObj, | ||
Data: configResource.ConfigMap.Data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the (original) reference approach, we could just do a
client.CoreV1().ConfigMaps(metaObj.Namespace).Get(ctx, configResource.GetName(), metav1.GetOptions{})
to fetch the reference ConfigMap's data and other fields. We'd need to pass-in the Kubernetes client for that but everything else would stay the same.
Still leaves the race condition problem...
// ConfigMap removed | ||
if desiredConfigMap == nil { | ||
if existingConfigMap != nil { | ||
err := c.client.CoreV1().ConfigMaps(existingConfigMap.Namespace).Delete(ctx, existingConfigMap.Name, metav1.DeleteOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't handle the case where a ConfigMap with the same name already exists in the cluster but isn't defined in the StackSet definition as a configurationResource
. In that case the resource would be deleted. I think the same would happen for HPAs, Ingress, RouteGroups etc. but maybe we want to do an owner check similar to how we already do it for reference ConfigMaps (where we don't touch the resource if it's not owned by us).
d24e5a4
to
df18af0
Compare
df18af0
to
b6abb34
Compare
b6abb34
to
19a2f7a
Compare
433bc16
to
ef7d88d
Compare
This is a solution for Inline ConfigMaps. It follows the design of other inline resources such as HPAs. It could be used as a blueprint for inline PCS as well.
Please also see the previous and follow up PRs that are based on this one:
Let's also do this: