Skip to content

Commit

Permalink
Run go-makefile-maker, run controller-gen, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Oct 8, 2024
1 parent ba74ba7 commit 42e87f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ check: FORCE static-check build/cover.html build-all

generate: install-controller-gen
@printf "\e[1;36m>> controller-gen\e[0m\n"
@controller-gen rbac:roleName=maintenance-controller paths="./..." output:crd:artifacts:config=crd
@controller-gen crd rbac:roleName=maintenance-controller webhook paths="./..." output:crd:artifacts:config=crd
@controller-gen object paths="./..."

run-golangci-lint: FORCE prepare-static-check
Expand Down
17 changes: 3 additions & 14 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ kind: ClusterRole
metadata:
name: maintenance-controller
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand All @@ -28,6 +16,7 @@ rules:
- ""
resources:
- nodes
- pods
verbs:
- create
- delete
Expand All @@ -45,9 +34,9 @@ rules:
- patch
- update
- apiGroups:
- ""
- coordination.k8s.io
resources:
- pods
- leases
verbs:
- create
- delete
Expand Down
4 changes: 2 additions & 2 deletions controllers/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
conf, err := ucfgwrap.FromYAMLFile(constants.MaintenanceConfigFilePath, ucfg.VarExp, ucfg.ResolveEnv)
if err != nil {
r.Log.Error(err, "Failed to parse configuration file (syntax error)")
// the controller is missconfigured, no need to requeue before the configuration is fixed
// the controller is misconfigured, no need to requeue before the configuration is fixed
return ctrl.Result{}, nil
}
config, err := LoadConfig(&conf)
if err != nil {
r.Log.Error(err, "Failed to parse configuration file (semantic error)")
// the controller is missconfigured, no need to requeue before the configuration is fixed
// the controller is misconfigured, no need to requeue before the configuration is fixed
return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 42e87f5

Please sign in to comment.