Skip to content

Commit

Permalink
controller/v1beta2: Label StatefulSets
Browse files Browse the repository at this point in the history
Before `apps/v1beta2`, labels were added to resources
automatically. Now we have to do it ourselves, to make sure that we can
find the Habitat from the sub-resource.

See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.8.md#behavioral-changes

Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
  • Loading branch information
Lorenzo Manacorda committed Apr 25, 2018
1 parent db01473 commit 34d7dff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/v1beta2/stateful_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (hc *HabitatController) newStatefulSet(h *habv1beta1.Habitat) (*appsv1beta2
base := &appsv1beta2.StatefulSet{
ObjectMeta: metav1.ObjectMeta{
Name: h.Name,
Labels: map[string]string{
habv1beta1.HabitatLabel: "true",
habv1beta1.HabitatNameLabel: h.Name,
},
OwnerReferences: []metav1.OwnerReference{
metav1.OwnerReference{
APIVersion: habv1beta1.SchemeGroupVersion.String(),
Expand Down

0 comments on commit 34d7dff

Please sign in to comment.