Skip to content

Commit

Permalink
Fix #186 - Add Nexus finalizers to ClusterRole (#189)
Browse files Browse the repository at this point in the history
* Fix #186 - Add Nexus finalizers to ClusterRole

Signed-off-by: Ricardo Zanini <[email protected]>

* Reverting back to Controller Gen 0.3.0

Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini authored Nov 7, 2020
1 parent cb5c748 commit 126e904
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 22 deletions.
30 changes: 19 additions & 11 deletions bundle/manifests/nexus-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ spec:
- patch
- update
- watch
- apiGroups:
- apps.m88i.io
resources:
- nexus/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- apps.m88i.io
resources:
Expand Down Expand Up @@ -206,17 +214,6 @@ spec:
control-plane: controller-manager
spec:
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
resources: {}
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
Expand All @@ -228,6 +225,17 @@ spec:
requests:
cpu: 100m
memory: 20Mi
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
resources: {}
terminationGracePeriodSeconds: 10
permissions:
- rules:
Expand Down
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- apps.m88i.io
resources:
- nexus/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- apps.m88i.io
resources:
Expand Down
1 change: 1 addition & 0 deletions controllers/nexus_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type NexusReconciler struct {

// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=apps.m88i.io,resources=nexus/finalizers,verbs=get;update;patch
// +kubebuilder:rbac:groups=core,resources=services;persistentvolumeclaims;events;secrets;serviceaccounts,verbs=create;delete;get;list;patch;update;watch
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;create
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get
Expand Down
4 changes: 4 additions & 0 deletions hack/generate-toc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

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

Expand Down
2 changes: 1 addition & 1 deletion hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

VERSION=$1

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

Expand Down
28 changes: 18 additions & 10 deletions nexus-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- apps.m88i.io
resources:
- nexus/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- apps.m88i.io
resources:
Expand Down Expand Up @@ -590,16 +598,6 @@ spec:
control-plane: controller-manager
spec:
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
Expand All @@ -611,6 +609,16 @@ spec:
requests:
cpu: 100m
memory: 20Mi
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
terminationGracePeriodSeconds: 10
---
apiVersion: monitoring.coreos.com/v1
Expand Down

0 comments on commit 126e904

Please sign in to comment.