-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add TopoRef struct and common functions #594
Conversation
00e666b
to
27cca91
Compare
5618886
to
f3ec112
Compare
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
8cbe0a8
to
2005db7
Compare
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
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.
/lgtm
297cfdc
to
13607ec
Compare
TopoRef represents a struct referenced by the service operators to retrieve a Topology that is eventually applied to the resulting Deployments/StatefulSets. This patch allows to reduce the amount of code duplication across the operators, providing both the TopoRef struct that can be added in the Services' API, as well as "EnsureTopologyRef" and "EnsureDeletedTopologyRef" where the basic logic of retrieving and managing finalizers is implemented. Signed-off-by: Francesco Pantano <[email protected]>
@olliewalsh @stuggi this change is ready, and as you can see I cleaned up the implementation for glance that consumes this patch [1]. |
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.
lgtm, thanks!
|
||
// no Topology is passed at all or some data is missing | ||
if topologyRef == nil || (topologyRef.Name == "" || topologyRef.Namespace == "") { | ||
return ctrl.Result{}, nil |
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 is treated as an error on L43, but I agree it's OK to "quietly succeed" here and not return an error.
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
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.
/lgtm
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
…mmon This patch updates the glance-operator to consume a TopologyRef struct and the related functions from lib-common [1]. This allows to avoid code duplication while spreading the pattern across the board. [1] openstack-k8s-operators/lib-common#594 Signed-off-by: Francesco Pantano <[email protected]>
TopologyRef
represents a struct referenced by the service operators to retrieve aTopology
CR that is eventually processed and applied to the resultingDeployments
/StatefulSets
.This patch allows to reduce the amount of code duplication across the operators, providing both
TopologyRef
struct that can be added in the Services' API, as well asEnsureTopologyRef
andEnsureDeletedTopologyRef
where the basic logic of retrieving and managingfinalizers
is implemented.