Skip to content

Commit

Permalink
fix: principal agent not starting up with the default autoNamespaceLa…
Browse files Browse the repository at this point in the history
…bels config (#202)

Signed-off-by: Mike Ng <[email protected]>
  • Loading branch information
mikeshng authored Oct 11, 2024
1 parent 3734a6f commit 0581ddb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/principal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func NewPrincipalRunCommand() *cobra.Command {
opts = append(opts, principal.WithListenerPort(listenPort))
opts = append(opts, principal.WithGRPC(true))
nsLabels := make(map[string]string)
if len(autoNamespaceLabels) > 0 {
if len(autoNamespaceLabels) > 0 &&
!(len(autoNamespaceLabels) == 1 && autoNamespaceLabels[0] == "") {
nsLabels, err = labels.StringsToMap(autoNamespaceLabels)
if err != nil {
cmd.Fatal("Could not parse auto namespace labels: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/informer/appproject/projectinformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func NewAppProjectInformer(ctx context.Context, client appclientset.Interface, n
}
i, err := informer.NewGenericInformer(&v1alpha1.AppProject{},
informer.WithListCallback(func(options v1.ListOptions, namespace string) (runtime.Object, error) {
log().Infof("Listing AppProjects %v", client.ArgoprojV1alpha1().AppProjects(namespace))
log().Infof("Listing AppProjects in namespace %s", namespace)
projects, err := client.ArgoprojV1alpha1().AppProjects(namespace).List(ctx, options)
log().Infof("Lister returned %d AppProjects", len(projects.Items))
if pi.filterFunc != nil {
Expand Down

0 comments on commit 0581ddb

Please sign in to comment.