Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
voigt committed Jan 28, 2024
1 parent fc6226a commit 8737f6a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
25 changes: 12 additions & 13 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"flag"
"fmt"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -52,18 +51,18 @@ func init() {
}

// getWatchNamespace returns the Namespace the operator should be watching for changes
func getWatchNamespace() string {
// WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
// which specifies the Namespace to watch.
// An empty value means the operator will fail to start.
watchNamespaceEnvVar := "CONTROLLER_NAMESPACE"

ns, found := os.LookupEnv(watchNamespaceEnvVar)
if !found {
panic(fmt.Sprintf("env var '%s' must be set", watchNamespaceEnvVar))
}
return ns
}
// func getWatchNamespace() string {
// // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
// // which specifies the Namespace to watch.
// // An empty value means the operator will fail to start.
// watchNamespaceEnvVar := "CONTROLLER_NAMESPACE"

// ns, found := os.LookupEnv(watchNamespaceEnvVar)
// if !found {
// panic(fmt.Sprintf("env var '%s' must be set", watchNamespaceEnvVar))
// }
// return ns
// }

func main() {
var metricsAddr string
Expand Down
5 changes: 4 additions & 1 deletion internal/controller/shim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func (sr *ShimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl

// 4. Deploy job to each node in list
if len(nodes.Items) != 0 {
sr.handleDeployJob(ctx, &shimResource, nodes, req)
_, err = sr.handleDeployJob(ctx, &shimResource, nodes, req)
if err != nil {
return ctrl.Result{}, err
}
} else {
log.Info().Msg("No nodes found")
}
Expand Down

0 comments on commit 8737f6a

Please sign in to comment.