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

Commit

Permalink
Remove versioned secret watch from generated_variable_controller
Browse files Browse the repository at this point in the history
This is also not user controlled and cfo will not mutate it. It will
create a new versioned secret for every change.
  • Loading branch information
Mario Manno committed Sep 2, 2019
1 parent 6acad49 commit 0155d47
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package boshdeployment
import (
"context"
"fmt"
"reflect"
"strings"

"github.com/pkg/errors"
Expand Down Expand Up @@ -60,21 +59,7 @@ func AddGeneratedVariable(ctx context.Context, config *config.Config, mgr manage
},
DeleteFunc: func(e event.DeleteEvent) bool { return false },
GenericFunc: func(e event.GenericEvent) bool { return false },
UpdateFunc: func(e event.UpdateEvent) bool {
oldSecret := e.ObjectOld.(*corev1.Secret)
newSecret := e.ObjectNew.(*corev1.Secret)
shouldProcessEvent := isManifestWithOps(newSecret.Name) && !reflect.DeepEqual(oldSecret.Data, newSecret.Data)

if shouldProcessEvent {
ctxlog.NewPredicateEvent(newSecret).Debug(
ctx, e.MetaNew, bdv1.SecretReference,
fmt.Sprintf("Update predicate passed for %s, existing secret with the %s suffix has been updated",
e.MetaNew.GetName(), names.DeploymentSecretTypeManifestWithOps.String()),
)
}

return shouldProcessEvent
},
UpdateFunc: func(e event.UpdateEvent) bool { return false },
}

// This is a manifest with ops files secret that has changed.
Expand Down

0 comments on commit 0155d47

Please sign in to comment.