-
Notifications
You must be signed in to change notification settings - Fork 100
Add resolved offerings to the AppInstance status #2377
Add resolved offerings to the AppInstance status #2377
Conversation
Signed-off-by: Grant Linville <[email protected]>
f375bd5
to
acd4a24
Compare
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.
Looking good. Found a few small things.
@@ -597,12 +597,34 @@ func containerAnnotation(container v1.Container) string { | |||
return string(json) | |||
} | |||
|
|||
func resolvedOfferingsAnnotation(appInstance *v1.AppInstance, container v1.Container) (string, error) { | |||
if resolved, exists := appInstance.Status.ResolvedOfferings.Containers[container.Name]; exists { | |||
data, err := convert.EncodeToMap(resolved) |
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.
why convert it to a map first?
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 was following the example of the containerAnnotation
func right above it.
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.
The comment above says it is converting to map first to sort the keys, but I thought json.Marshal
does that automatically.
Signed-off-by: Grant Linville <[email protected]>
@@ -597,12 +597,34 @@ func containerAnnotation(container v1.Container) string { | |||
return string(json) | |||
} | |||
|
|||
func resolvedOfferingsAnnotation(appInstance *v1.AppInstance, container v1.Container) (string, error) { | |||
if resolved, exists := appInstance.Status.ResolvedOfferings.Containers[container.Name]; exists { | |||
data, err := convert.EncodeToMap(resolved) |
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.
The comment above says it is converting to map first to sort the keys, but I thought json.Marshal
does that automatically.
resolve offerings introduced in acorn-io#2377
resolve offerings introduced in acorn-io#2377 Signed-off-by: dciangot <[email protected]>
This is the second try at resolved offerings. This time I am just adding it as an additional controller route on AppInstances, leaving Defaults alone and making nothing depend on the new resolved offerings. I have tested this and verified that the bug that caused child acorns to be deleted is not present with these changes.
The unit tests for resolved offerings are copied from the
defaults
package and modified a little bit.Checklist
This is a title (#1216)
. Here's an example