Skip to content

Commit

Permalink
make
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Wall <[email protected]>
  • Loading branch information
cameronmwall committed Nov 15, 2024
1 parent ac2452f commit 9854ac8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CRD_OPTIONS ?= "crd:crdVersions=v1"
ENVTEST_K8S_VERSION = 1.25

# Namespace to deploy resources into
NAMESPACE ?= open-cluster-management
NAMESPACE ?= multicluster-engine

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -88,7 +88,7 @@ secret: ## Generate secret for OCM access
config: ## Create custom resources
cd config/samples && $(KUSTOMIZE) edit set namespace $(NAMESPACE)
$(KUSTOMIZE) build config/samples | kubectl apply -f -
cd config/samples && $(KUSTOMIZE) edit set namespace open-cluster-management
cd config/samples && $(KUSTOMIZE) edit set namespace multicluster-engine

logs: ## Print operator logs
@kubectl logs -f $(shell kubectl get pod -l app=discovery-operator -o jsonpath="{.items[0].metadata.name}")
Expand Down
19 changes: 10 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,17 @@ func addDiscoverySecretWatch(ctx context.Context, mgr ctrl.Manager, uncachedClie
err := discoveryConfigController.Watch(source.Kind(mgr.GetCache(), &corev1.Secret{},
handler.TypedFuncs[*corev1.Secret]{
UpdateFunc: func(ctx context.Context, e event.TypedUpdateEvent[*corev1.Secret], q workqueue.RateLimitingInterface) {
name := config.Spec.Credential
namespace := config.Namespace
q.Add(
reconcile.Request{
NamespacedName: types.NamespacedName{
Name: name,
Namespace: namespace,
updatedSecret := e.ObjectNew
if updatedSecret.Name == config.Spec.Credential && updatedSecret.Namespace == config.Namespace {
q.Add(
reconcile.Request{
NamespacedName: types.NamespacedName{
Name: config.Name,
Namespace: config.Namespace,
},
},
},
)
)
}
},
}))
if err == nil {
Expand Down

0 comments on commit 9854ac8

Please sign in to comment.