-
Notifications
You must be signed in to change notification settings - Fork 64
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
Singular realizer #857
Singular realizer #857
Conversation
ddfd0ac
to
de7c71c
Compare
"carto.run/template-kind": resource.TemplateRef.Kind, | ||
"carto.run/cluster-template-name": resource.TemplateRef.Name, | ||
} | ||
case *v1alpha1.ClusterDelivery: |
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 noticed that in deliverable_reconciler we're doing
func buildDeliverableResourceLabeler(owner, blueprint client.Object) realizer.ResourceLabeler {
return func(resource realizer.OwnerResource) templates.Labels {
return templates.Labels{
"carto.run/deliverable-name": owner.GetName(),
"carto.run/deliverable-namespace": owner.GetNamespace(),
"carto.run/delivery-name": blueprint.GetName(),
"carto.run/resource-name": resource.Name,
"carto.run/template-kind": resource.TemplateRef.Kind,
"carto.run/cluster-template-name": resource.TemplateRef.Name,
}
}
}
while here we're actually doing the switch on the type - is there a particular reason for such difference?
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.
for
func MakeSupplychainOwnerResources(supplyChain *v1alpha1.ClusterSupplyChain) []OwnerResource {
var resources []
we pass straight v1alpha1.ClusterSupplyChain
in there - given that build(Deliverable|Workload)
already includes the concrete type in the name of the function itself, wdyt of passing *v1alpha1.(deliverable|workload)
in the args directly?
(assuming we want to keep the distinct methods)
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.
@idoru I dont think we need the switch on type at all? the reconciler is building for Workloads/SCs only?
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.
good spot. forgot to remove the switch when we split 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.
consolidate much duplication across delivery and supply chain