This PR adds the ability to attach the owner of a container object to a ContainerEvent payload.
There are two things I want to call out here:
1) I pulled out ObjectKind from EventsPayload to be its own enum, so that it could be shared between both EventsPayload and Owner. I am not sure if this refactor is against best practice or anything, as the type that was autogenerated changed (but the possible values, and the field name, did not).
2) I pulled ObjectKind out from EventsPayload so that we would not need to update two different enums when adding support for more event types, like say ECS tasks. However, this could lead to some confusion, where an owner kind of Container is technically valid at the payload level for an owner attached to a ContainerEvent, which seems not ideal.
Both of my concerns above would be fixed by defining a new enum for Container Owner Type, but I wanted to avoid doing this to prevent repeating ourselves. I am happy to make this change though.
This PR adds the ability to attach the owner of a container object to a ContainerEvent payload.
There are two things I want to call out here: 1) I pulled out
ObjectKind
fromEventsPayload
to be its own enum, so that it could be shared between bothEventsPayload
andOwner
. I am not sure if this refactor is against best practice or anything, as the type that was autogenerated changed (but the possible values, and the field name, did not). 2) I pulledObjectKind
out fromEventsPayload
so that we would not need to update two different enums when adding support for more event types, like say ECS tasks. However, this could lead to some confusion, where an owner kind ofContainer
is technically valid at the payload level for an owner attached to aContainerEvent
, which seems not ideal.Both of my concerns above would be fixed by defining a new enum for Container Owner Type, but I wanted to avoid doing this to prevent repeating ourselves. I am happy to make this change though.
Reviewers: please see the review guidelines.