Skip to content

Commit

Permalink
fix: only calculate installed hash after changes have been applied
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 13, 2021
1 parent 0c055d2 commit 9172dc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions controllers/bus/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ func (i installer) apply(ctx context.Context, namespace string, item *unstructur
if item.GetLabels() == nil {
item.SetLabels(map[string]string{})
}
annotations := item.GetAnnotations()
annotations[dfv1.KeyHash] = util.MustHash(item)
item.SetAnnotations(annotations)

labels := item.GetLabels()
labels["app.kubernetes.io/managed-by"] = "argo-dataflow"
Expand Down Expand Up @@ -177,6 +174,10 @@ func (i installer) apply(ctx context.Context, namespace string, item *unstructur
}
}

annotations := item.GetAnnotations()
annotations[dfv1.KeyHash] = util.MustHash(item)
item.SetAnnotations(annotations)

resourceInterface := i.resourceInterface(item, namespace)
if _, err := resourceInterface.Create(ctx, item, metav1.CreateOptions{}); err != nil {
if apierr.IsAlreadyExists(err) {
Expand Down

0 comments on commit 9172dc7

Please sign in to comment.