Skip to content

Commit

Permalink
fixup! reorg kustomize
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Short <tshort@redhat.com>
  • Loading branch information
tmshort committed Jun 28, 2024
1 parent e0cf679 commit 9a210c9
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 42 deletions.
20 changes: 11 additions & 9 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,28 @@ This provides additional configuration support for end-to-end testing, including

This configuration requires cert-manager.

## Overlays
## Components

### config/overlays/tls
Each of the `kustomization.yaml` files specify a `Component`, rather than an overlay.

### config/components/tls

This provides a basic configuration of operator-controller with TLS support for catalogd.

This configuration specifies the `olmv1-system` namespace.
This component specifies the `olmv1-system` namespace.

This configuration requires cert-manager.
This component requires cert-manager.

### config/overlays/coverage
### config/components/coverage

Provides configuration for code coverage.

This configuration specifies the `olmv1-system` namespace.
This component specifies the `olmv1-system` namespace.

### config/overlays/ca
### config/components/ca

Procides a CA for operator-controller operation.

This configuration specifies the the `cert-manager` namespace for the CA components.
This component _does not_ specify a namespace, and must be included last.

This configuration requires cert-manager.
This component requires cert-manager.
File renamed without changes.
5 changes: 5 additions & 0 deletions config/components/ca/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
# No namespace is specified here, otherwise, it will overwrite _all_ the other namespaces!
resources:
- issuers.yaml
8 changes: 8 additions & 0 deletions config/components/coverage/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- manager_e2e_coverage_pvc.yaml
- manager_e2e_coverage_copy_pod.yaml
patches:
- path: manager_e2e_coverage_patch.yaml
21 changes: 21 additions & 0 deletions config/components/coverage/manager_e2e_coverage_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: kube-rbac-proxy
- name: manager
env:
- name: GOCOVERDIR
value: /e2e-coverage
volumeMounts:
- name: e2e-coverage-volume
mountPath: /e2e-coverage
volumes:
- name: e2e-coverage-volume
persistentVolumeClaim:
claimName: e2e-coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- resources/manager_cert.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
value: {"name":"catalogd-certificate", "secret":{"secretName":"catalogd-catalogserver-cert", "optional": false, "items": [{"key": "ca.crt", "path": "catalogd.crt"}]}}
- op: add
path: /spec/template/spec/volumes/-
value: {"name":"olmv1-cert", "secret":{"secretName":"olmv1-cert", "optional": false, "items": [{"key": "ca.crt", "path": "olm-ca.crt"}]}}
value: {"name":"olmv1-certificate", "secret":{"secretName":"olmv1-cert", "optional": false, "items": [{"key": "ca.crt", "path": "olm-ca.crt"}]}}
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value: {"name":"catalogd-certificate", "readOnly": true, "mountPath":"/var/certs/catalogd.crt", "subPath":"catalogd.crt"}
Expand Down
8 changes: 5 additions & 3 deletions config/e2e/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- ../overlays/tls
- ../overlays/ca
- ../overlays/coverage
components:
- ../components/tls
- ../components/coverage
# ca must be last or (tls|coverage) will overwrite the namespaces
- ../components/ca
5 changes: 0 additions & 5 deletions config/overlays/ca/kustomization.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions config/overlays/coverage/kustomization.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions config/overlays/coverage/manager_e2e_coverage_patch.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions config/secure/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- ../overlays/tls
- ../overlays/ca
components:
- ../components/tls
# ca must be last or tls will overwrite the namespaces
- ../components/ca

0 comments on commit 9a210c9

Please sign in to comment.