Skip to content

Commit 71373b9

Browse files
ciaranRocheclaude
andcommitted
HYPERFLEET-1405 - fix: regenerate stale manager RBAC, restore lint rules, fill in README
manager-role still granted get;list;watch on core pods, a leftover from before HyperFleetConfig existed. It never picked up the hyperfleetconfigs CRUD/status/finalizers permissions the controller's kubebuilder:rbac markers declare, so the deployed operator had no access to its own CR. Regenerated via `make manifests`. Also restores the depguard (sort->slices) and modernize lint rules dropped in the operator-sdk re-scaffold, and replaces the placeholder README overview/description with real content. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 921cb47 commit 71373b9

4 files changed

Lines changed: 44 additions & 10 deletions

File tree

.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ linters:
55
default: none
66
enable:
77
- copyloopvar
8+
- depguard
89
- dupl
910
- errcheck
1011
- ginkgolinter
@@ -13,6 +14,7 @@ linters:
1314
- govet
1415
- ineffassign
1516
- lll
17+
- modernize
1618
- misspell
1719
- nakedret
1820
- prealloc
@@ -22,10 +24,20 @@ linters:
2224
- unparam
2325
- unused
2426
settings:
27+
depguard:
28+
rules:
29+
forbid-sort-pkg:
30+
deny:
31+
- pkg: sort
32+
desc: Should be replaced with slices package
2533
revive:
2634
rules:
2735
- name: comment-spacings
2836
- name: import-shadowing
37+
modernize:
38+
disable:
39+
- omitzero
40+
- newexpr
2941
exclusions:
3042
generated: lax
3143
rules:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# hyperfleet-operator
2-
// TODO(user): Add simple overview of use/purpose
2+
3+
A Kubernetes operator for HyperFleet cluster lifecycle management.
34

45
## Description
5-
// TODO(user): An in-depth paragraph about your project and overview of use
6+
7+
hyperfleet-operator packages and delivers HyperFleet as a standard Kubernetes operator, installed and managed through OLM. It exposes a single cluster-scoped custom resource, `HyperFleetConfig`, as the entire partner-facing surface: install, configure, and observe HyperFleet through that one CR and its status conditions, with everything else the operator manages kept internal.
68

79
## Getting Started
810

config/rbac/role.yaml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1+
---
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: ClusterRole
34
metadata:
4-
labels:
5-
app.kubernetes.io/name: hyperfleet-operator
6-
app.kubernetes.io/managed-by: kustomize
75
name: manager-role
86
rules:
9-
- apiGroups: [""]
10-
resources: ["pods"]
11-
verbs: ["get", "list", "watch"]
7+
- apiGroups:
8+
- hyperfleet.redhat.com
9+
resources:
10+
- hyperfleetconfigs
11+
verbs:
12+
- create
13+
- delete
14+
- get
15+
- list
16+
- patch
17+
- update
18+
- watch
19+
- apiGroups:
20+
- hyperfleet.redhat.com
21+
resources:
22+
- hyperfleetconfigs/finalizers
23+
verbs:
24+
- update
25+
- apiGroups:
26+
- hyperfleet.redhat.com
27+
resources:
28+
- hyperfleetconfigs/status
29+
verbs:
30+
- get
31+
- patch
32+
- update

test/utils/utils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ func LoadImageToKindClusterWithName(name string) error {
181181
// according to line breakers, and ignores the empty elements in it.
182182
func GetNonEmptyLines(output string) []string {
183183
var res []string
184-
elements := strings.Split(output, "\n")
185-
for _, element := range elements {
184+
for element := range strings.SplitSeq(output, "\n") {
186185
if element != "" {
187186
res = append(res, element)
188187
}

0 commit comments

Comments
 (0)