Skip to content

Commit 126e904

Browse files
Fix #186 - Add Nexus finalizers to ClusterRole (#189)
* Fix #186 - Add Nexus finalizers to ClusterRole Signed-off-by: Ricardo Zanini <zanini@redhat.com> * Reverting back to Controller Gen 0.3.0 Signed-off-by: Ricardo Zanini <zanini@redhat.com>
1 parent cb5c748 commit 126e904

6 files changed

Lines changed: 51 additions & 22 deletions

File tree

bundle/manifests/nexus-operator.clusterserviceversion.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ spec:
111111
- patch
112112
- update
113113
- watch
114+
- apiGroups:
115+
- apps.m88i.io
116+
resources:
117+
- nexus/finalizers
118+
verbs:
119+
- get
120+
- patch
121+
- update
114122
- apiGroups:
115123
- apps.m88i.io
116124
resources:
@@ -206,17 +214,6 @@ spec:
206214
control-plane: controller-manager
207215
spec:
208216
containers:
209-
- args:
210-
- --secure-listen-address=0.0.0.0:8443
211-
- --upstream=http://127.0.0.1:8080/
212-
- --logtostderr=true
213-
- --v=10
214-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
215-
name: kube-rbac-proxy
216-
ports:
217-
- containerPort: 8443
218-
name: https
219-
resources: {}
220217
- args:
221218
- --metrics-addr=127.0.0.1:8080
222219
- --enable-leader-election
@@ -228,6 +225,17 @@ spec:
228225
requests:
229226
cpu: 100m
230227
memory: 20Mi
228+
- args:
229+
- --secure-listen-address=0.0.0.0:8443
230+
- --upstream=http://127.0.0.1:8080/
231+
- --logtostderr=true
232+
- --v=10
233+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
234+
name: kube-rbac-proxy
235+
ports:
236+
- containerPort: 8443
237+
name: https
238+
resources: {}
231239
terminationGracePeriodSeconds: 10
232240
permissions:
233241
- rules:

config/rbac/role.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ rules:
4242
- patch
4343
- update
4444
- watch
45+
- apiGroups:
46+
- apps.m88i.io
47+
resources:
48+
- nexus/finalizers
49+
verbs:
50+
- get
51+
- patch
52+
- update
4553
- apiGroups:
4654
- apps.m88i.io
4755
resources:

controllers/nexus_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type NexusReconciler struct {
6262

6363
// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus,verbs=get;list;watch;create;update;patch;delete
6464
// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus/status,verbs=get;update;patch
65+
// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus/finalizers,verbs=get;update;patch
6566
// +kubebuilder:rbac:groups=core,resources=services;persistentvolumeclaims;events;secrets;serviceaccounts,verbs=create;delete;get;list;patch;update;watch
6667
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;create
6768
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get

hack/generate-toc.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
declare readme_changed=$(git status -s | grep 'README.md' || :)
17+
if [ -z "${readme_changed}" ]; then
18+
exit 0
19+
fi
1620

1721
command -v bin/gh-md-toc > /dev/null || curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o bin/gh-md-toc && chmod +x bin/gh-md-toc
1822

hack/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
VERSION=$1
1818

19-
if [ -z ${VERSION} ]; then
19+
if [ -z "${VERSION}" ]; then
2020
VERSION=$(curl https://api.github.com/repos/m88i/nexus-operator/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
2121
fi
2222

nexus-operator.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ rules:
420420
- patch
421421
- update
422422
- watch
423+
- apiGroups:
424+
- apps.m88i.io
425+
resources:
426+
- nexus/finalizers
427+
verbs:
428+
- get
429+
- patch
430+
- update
423431
- apiGroups:
424432
- apps.m88i.io
425433
resources:
@@ -590,16 +598,6 @@ spec:
590598
control-plane: controller-manager
591599
spec:
592600
containers:
593-
- args:
594-
- --secure-listen-address=0.0.0.0:8443
595-
- --upstream=http://127.0.0.1:8080/
596-
- --logtostderr=true
597-
- --v=10
598-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
599-
name: kube-rbac-proxy
600-
ports:
601-
- containerPort: 8443
602-
name: https
603601
- args:
604602
- --metrics-addr=127.0.0.1:8080
605603
- --enable-leader-election
@@ -611,6 +609,16 @@ spec:
611609
requests:
612610
cpu: 100m
613611
memory: 20Mi
612+
- args:
613+
- --secure-listen-address=0.0.0.0:8443
614+
- --upstream=http://127.0.0.1:8080/
615+
- --logtostderr=true
616+
- --v=10
617+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
618+
name: kube-rbac-proxy
619+
ports:
620+
- containerPort: 8443
621+
name: https
614622
terminationGracePeriodSeconds: 10
615623
---
616624
apiVersion: monitoring.coreos.com/v1

0 commit comments

Comments
 (0)