Skip to content

Commit 9d6e064

Browse files
BradleyMayoBradley Mayo
andauthored
Auto generate kubectl-install artifacts (#437)
* Added files for kubectl install generation and some functionality * Kubectl install autoupdate except image SHA * Update to latest makefile to remove merge conflict * Call kustomize on kubectl artifacts during build * Update output from `make bundle` * Updated controller-gen and removed olm tag * Prevent merge conflict * Update "make bundle" output files --------- Co-authored-by: Bradley Mayo <[email protected]>
1 parent ad572c6 commit 9d6e064

File tree

13 files changed

+7358
-4582
lines changed

13 files changed

+7358
-4582
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ bundle: manifests setup kustomize ## Generate bundle manifests and metadata, the
204204

205205
mv config/manifests/patches/csvAnnotations.yaml.bak config/manifests/patches/csvAnnotations.yaml
206206
rm internal/deploy/kustomize/daily/base/websphere-liberty-deployment.yaml.bak
207+
208+
$(KUSTOMIZE) build config/kubectl/crd -o internal/deploy/kubectl/websphereliberty-app-crd.yaml
209+
$(KUSTOMIZE) build config/kubectl/operator -o internal/deploy/kubectl/websphereliberty-app-operator.yaml
210+
$(KUSTOMIZE) build config/kubectl/rbac-watch-all -o internal/deploy/kubectl/websphereliberty-app-rbac-watch-all.yaml
211+
$(KUSTOMIZE) build config/kubectl/rbac-watch-another -o internal/deploy/kubectl/websphereliberty-app-rbac-watch-another.yaml
212+
207213
operator-sdk bundle validate ./bundle
208214

209215
.PHONY: fmt

bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ metadata:
5959
capabilities: Auto Pilot
6060
categories: Application Runtime
6161
containerImage: icr.io/cpopen/websphere-liberty-operator:daily
62-
createdAt: "2023-04-13T20:19:54Z"
62+
createdAt: "2023-04-21T10:02:12Z"
6363
description: Deploy and manage containerized Liberty applications
6464
olm.skipRange: '>=1.0.0 <1.2.0'
6565
operators.openshift.io/infrastructure-features: '["disconnected"]'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../crd
5+
6+
# Adds namespace to all resources.
7+
namePrefix: wlo-
8+
9+
# Labels to add to all resources and selectors.
10+
commonLabels:
11+
app.kubernetes.io/instance: websphere-liberty-operator
12+
app.kubernetes.io/name: websphere-liberty-operator
13+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../rbac
5+
- ../../manager
6+
7+
namePrefix: wlo-
8+
9+
# Labels to add to all resources and selectors.
10+
commonLabels:
11+
app.kubernetes.io/instance: websphere-liberty-operator
12+
app.kubernetes.io/name: websphere-liberty-operator
13+
14+
patches:
15+
- path: patches/delete-namespace.yaml
16+
target:
17+
kind: Namespace
18+
19+
patchesJson6902:
20+
- target:
21+
namespace: system
22+
name: .*
23+
patch: |-
24+
- op: remove
25+
path: /metadata/namespace
26+
- target:
27+
namespace: websphere-liberty-operator
28+
name: .*
29+
patch: |-
30+
- op: remove
31+
path: /metadata/namespace
32+
- target:
33+
kind: RoleBinding
34+
name: .*
35+
patch: |-
36+
- op: remove
37+
path: /subjects/0/namespace
38+
- target:
39+
kind: Deployment
40+
name: wlo-controller-manager
41+
patch: |-
42+
- op: remove
43+
path: /spec/template/spec/containers/0/env/1/valueFrom
44+
- op: add
45+
path: /spec/template/spec/containers/0/env/1/value
46+
value: WEBSPHERE_LIBERTY_WATCH_NAMESPACE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$patch: delete
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: system
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../rbac
5+
6+
namePrefix: wlo-cluster-
7+
8+
# Labels to add to all resources and selectors.
9+
commonLabels:
10+
app.kubernetes.io/instance: websphere-liberty-operator
11+
app.kubernetes.io/name: websphere-liberty-operator
12+
13+
patches:
14+
- path: patches/delete-service-account.yaml
15+
target:
16+
kind: ServiceAccount
17+
18+
patchesJson6902:
19+
- target:
20+
namespace: websphere-liberty-operator
21+
name: .*
22+
patch: |-
23+
- op: remove
24+
path: /metadata/namespace
25+
- target:
26+
kind: Role
27+
name: .*
28+
patch: |-
29+
- op: replace
30+
path: /kind
31+
value: ClusterRole
32+
- target:
33+
kind: RoleBinding
34+
name: .*
35+
patch: |-
36+
- op: replace
37+
path: /kind
38+
value: ClusterRoleBinding
39+
- target:
40+
kind: ClusterRoleBinding
41+
name: .*
42+
patch: |-
43+
- op: replace
44+
path: /subjects/0/name
45+
value: wlo-controller-manager
46+
- op: replace
47+
path: /subjects/0/namespace
48+
value: WEBSPHERE_LIBERTY_OPERATOR_NAMESPACE
49+
- op: replace
50+
path: /roleRef/kind
51+
value: ClusterRole
52+
- target:
53+
kind: ClusterRoleBinding
54+
name: wlo-cluster-leader-election-rolebinding
55+
patch: |-
56+
- op: replace
57+
path: /roleRef/name
58+
value: wlo-cluster-leader-election-role
59+
- target:
60+
kind: ClusterRoleBinding
61+
name: wlo-cluster-manager-rolebinding
62+
patch: |-
63+
- op: replace
64+
path: /roleRef/name
65+
value: wlo-cluster-manager-role
66+
- target:
67+
kind: ClusterRole
68+
name: wlo-cluster-manager-role
69+
patch: |-
70+
- op: add
71+
path: /rules/-
72+
value: {"apiGroups":[""],"resources":["namespaces"],"verbs":["get","list","watch"]}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$patch: delete
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: wlo-controller-manager
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../rbac
5+
6+
namePrefix: wlo-watched-
7+
8+
# Labels to add to all resources and selectors.
9+
commonLabels:
10+
app.kubernetes.io/instance: websphere-liberty-operator
11+
app.kubernetes.io/name: websphere-liberty-operator
12+
13+
patches:
14+
- path: patches/delete-service-account.yaml
15+
target:
16+
kind: ServiceAccount
17+
18+
patchesJson6902:
19+
- target:
20+
name: .*
21+
patch: |-
22+
- op: replace
23+
path: /metadata/namespace
24+
value: WEBSPHERE_LIBERTY_WATCH_NAMESPACE
25+
- target:
26+
kind: RoleBinding
27+
name: .*
28+
patch: |-
29+
- op: replace
30+
path: /subjects/0/namespace
31+
value: WEBSPHERE_LIBERTY_OPERATOR_NAMESPACE
32+
- op: replace
33+
path: /subjects/0/name
34+
value: wlo-controller-manager
35+
- target:
36+
kind: RoleBinding
37+
name: wlo-watched-leader-election-rolebinding
38+
patch: |-
39+
- op: replace
40+
path: /roleRef/name
41+
value: wlo-watched-leader-election-role
42+
- target:
43+
kind: RoleBinding
44+
name: wlo-watched-manager-rolebinding
45+
patch: |-
46+
- op: replace
47+
path: /roleRef/name
48+
value: wlo-watched-manager-role
49+
50+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$patch: delete
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: wlo-controller-manager

0 commit comments

Comments
 (0)