kabanero-io / kabanero-command-line-services

This repo will be archived soon.
Apache License 2.0
3 stars 7 forks source link

Set an owner reference when creating new stacks #102

Closed kaczyns closed 4 years ago

kaczyns commented 4 years ago

When the CLI creates a new stack, it should set the Kabanero owner, like the operator does. The object ownership ensures that when a Kabanero CR instance is deleted, all of its Stack CRs (and their pipelines, tasks, etc) are also deleted.

For reference, the operator code that does this is here: https://github.com/kabanero-io/kabanero-operator/blob/cbf1390648075914e26a139c21de629ffc2dea30/pkg/controller/kabaneroplatform/featured_collections.go#L40

It's basically taking a bunch of fields from the Kabanero CR instance (UID, group, version, kind) and copying them to the metadata of the new Stack CR instance, in the OwnerReference field.

davco01a commented 4 years ago

completed