Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Disable references for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Mar 3, 2017
1 parent 8810588 commit 0a57cdd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
17 changes: 9 additions & 8 deletions cmd/smith/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,15 @@ func TestWorkflow(t *testing.T) {
"overlappingLabel": "overlappingConfigValue",
smith.TemplateNameLabel: templateName,
}, obj.GetLabels())
a.Equal([]metav1.OwnerReference{
{
APIVersion: smith.TemplateResourceVersion,
Kind: smith.TemplateResourceKind,
Name: templateName,
UID: tmplRes.Metadata.UID,
},
}, obj.GetOwnerReferences())
// TODO uncomment when https://github.com/kubernetes/kubernetes/issues/39816 is fixed
//a.Equal([]metav1.OwnerReference{
// {
// APIVersion: smith.TemplateResourceVersion,
// Kind: smith.TemplateResourceKind,
// Name: templateName,
// UID: tmplRes.Metadata.UID,
// },
//}, obj.GetOwnerReferences())
return
}
}
Expand Down
13 changes: 7 additions & 6 deletions pkg/processor/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ func (wrk *worker) checkResource(tmpl *smith.Template, res *smith.Resource) (isR

// 1. Update OwnerReferences
// Hardcode APIVersion/Kind because of https://github.com/kubernetes/client-go/issues/60
res.Spec.SetOwnerReferences(append(res.Spec.GetOwnerReferences(), metav1.OwnerReference{
APIVersion: smith.TemplateResourceVersion,
Kind: smith.TemplateResourceKind,
Name: tmpl.Metadata.Name,
UID: tmpl.Metadata.UID,
}))
// TODO uncomment when https://github.com/kubernetes/kubernetes/issues/39816 is fixed
//res.Spec.SetOwnerReferences(append(res.Spec.GetOwnerReferences(), metav1.OwnerReference{
// APIVersion: smith.TemplateResourceVersion,
// Kind: smith.TemplateResourceKind,
// Name: tmpl.Metadata.Name,
// UID: tmpl.Metadata.UID,
//}))

name := res.Spec.GetName()
var response *unstructured.Unstructured
Expand Down

0 comments on commit 0a57cdd

Please sign in to comment.