Skip to content

Commit

Permalink
fixup! fix: Add contribution documenation to project
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <[email protected]>
  • Loading branch information
mateusoliveira43 committed Apr 10, 2024
1 parent 9796c5f commit 0a2fb7e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=non-admin-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=non-admin-controller-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace: openshift-adp-system
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: openshift-adp-
namePrefix:

# Labels to add to all resources and selectors.
#labels:
Expand Down
4 changes: 2 additions & 2 deletions config/default/manager_oadp_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: non-admin-controller-manager
name: non-admin-controller
namespace: system
spec:
template:
metadata:
annotations:
spec:
containers:
- name: non-admin-manager
- name: non-admin-controller
imagePullPolicy: Always
args:
command:
Expand Down
16 changes: 8 additions & 8 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: non-admin-controller-manager
control-plane: non-admin-controller
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
Expand All @@ -14,27 +14,27 @@ metadata:
apiVersion: apps/v1
kind: Deployment
metadata:
name: non-admin-controller-manager
name: non-admin-controller
namespace: system
labels:
control-plane: non-admin-controller-manager
control-plane: non-admin-controller
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: non-admin-controller-manager
app.kubernetes.io/instance: non-admin-controller
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: oadp-operator
app.kubernetes.io/part-of: oadp-operator
app.kubernetes.io/managed-by: kustomize
spec:
selector:
matchLabels:
control-plane: non-admin-controller-manager
control-plane: non-admin-controller
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: non-admin-controller-manager
control-plane: non-admin-controller
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
Expand Down Expand Up @@ -71,7 +71,7 @@ spec:
args:
- --leader-elect
image: controller:latest
name: non-admin-manager
name: non-admin-controller
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand All @@ -98,5 +98,5 @@ spec:
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: non-admin-controller-manager
serviceAccountName: non-admin-controller
terminationGracePeriodSeconds: 10
2 changes: 1 addition & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: non-admin-manager-role
name: non-admin-controller-role
rules:
- apiGroups:
- nac.oadp.openshift.io
Expand Down
8 changes: 4 additions & 4 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: non-admin-manager-rolebinding
app.kubernetes.io/instance: non-admin-controller-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: oadp-operator
app.kubernetes.io/part-of: oadp-operator
app.kubernetes.io/managed-by: kustomize
name: non-admin-manager-rolebinding
name: non-admin-controller-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: non-admin-manager-role
name: non-admin-controller-role
subjects:
- kind: ServiceAccount
name: non-admin-controller-manager
name: non-admin-controller
namespace: system
4 changes: 2 additions & 2 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: non-admin-controller-manager-sa
app.kubernetes.io/instance: non-admin-controller-sa
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: oadp-operator
app.kubernetes.io/part-of: oadp-operator
app.kubernetes.io/managed-by: kustomize
name: non-admin-controller-manager
name: non-admin-controller
namespace: system
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## OADP integration

Normally, to ship a controller to users, the project would present the file created by `make build-installer` command (which include various Kubernetes objects, like Namespace, ServiceAccount, Deployment, etc), to user to install the controller. But since NAC needs OADP operator to properly work, those Kubernetes objects are shipped within OADP operator (and also Kubernetes objects in `config/samples/` folder). Because of this restriction, generated Kubernetes objects names and labels in `config/` folder, may need to be updated to match OADP operator standards (and avoid duplications, by adding `non-admin-` prefix to Kubernetes object names).
Normally, to ship a controller to users, the project would present the file created by `make build-installer` command (which include various Kubernetes objects, like Namespace, ServiceAccount, Deployment, etc), to user to install the controller. But since NAC needs OADP operator to properly work, those Kubernetes objects are shipped within OADP operator (and also Kubernetes objects in `config/samples/` folder). Because of this restriction, generated Kubernetes objects names and labels in `config/` folder, may need to be updated to match OADP operator standards (for example, `oadp-nac` values are changed to `oadp-operator`) and avoid duplications, by changing Kubernetes object names to `non-admin-controller`, or adding it as a prefix.

> **NOTE:** If needed, you can test NAC alone by running `make build-installer` and `oc apply -f ./dist/install.yaml`. You may want to customize namespace (`openshift-adp-system`) and container image (`quay.io/konveyor/oadp-non-admin:latest`) in that file prior to deploying it to your cluster.
Expand Down

0 comments on commit 0a2fb7e

Please sign in to comment.