Skip to content

Commit

Permalink
feat: update portal release name in templates and tests
Browse files Browse the repository at this point in the history
On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
  • Loading branch information
akafazov committed Nov 25, 2024
1 parent 6883e75 commit a0166b7
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 120 deletions.
1 change: 0 additions & 1 deletion charts/account-operator/templates/cluster-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
subjects:
- kind: ServiceAccount
name: {{ include "common.entity.name" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ include "common.entity.name" . }}
Expand Down
1 change: 0 additions & 1 deletion charts/account-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.entity.name" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.webhooks.enabled }}
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "common.entity.name" . }}-serving-cert
Expand Down
1 change: 0 additions & 1 deletion charts/account-operator/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "common.entity.name" . }}
namespace: {{ .Release.Namespace }}
{{- include "common.imagePullSecret" . }}
2 changes: 0 additions & 2 deletions charts/account-operator/templates/webhook/pki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "common.entity.name" . }}-selfsigned-issuer
namespace: {{ .Release.namespace }}
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "common.entity.name" . }}-serving-cert
namespace: {{ .Release.namespace }}
spec:
dnsNames:
- {{ include "common.entity.name" . }}-webhook.{{ .Release.Namespace }}.svc
Expand Down
1 change: 0 additions & 1 deletion charts/account-operator/templates/webhook/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "common.entity.name" . }}-webhook
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ operator match the snapshot:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
rules:
- apiGroups:
- core.openmfp.io
Expand Down Expand Up @@ -265,32 +265,30 @@ operator match the snapshot:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: RELEASE-NAME-account-operator
name: account-operator
subjects:
- kind: ServiceAccount
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
4: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
spec:
revisionHistoryLimit: 3
selector:
matchLabels:
service: RELEASE-NAME-account-operator
service: account-operator
template:
metadata:
annotations: null
labels:
control-plane: controller-manager
service: RELEASE-NAME-account-operator
service: account-operator
spec:
containers:
- args:
Expand Down Expand Up @@ -359,9 +357,9 @@ operator match the snapshot:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccountName: RELEASE-NAME
serviceAccountName: account-operator
volumeMounts: null
serviceAccountName: RELEASE-NAME-account-operator
serviceAccountName: account-operator
terminationGracePeriodSeconds: 10
volumes: null
5: |
Expand All @@ -370,8 +368,7 @@ operator match the snapshot:
- name: github
kind: ServiceAccount
metadata:
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
operator match the snapshot (with kubeconfigSecret):
1: |
apiVersion: apiextensions.k8s.io/v1
Expand Down Expand Up @@ -583,7 +580,7 @@ operator match the snapshot (with kubeconfigSecret):
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
rules:
- apiGroups:
- core.openmfp.io
Expand Down Expand Up @@ -639,32 +636,30 @@ operator match the snapshot (with kubeconfigSecret):
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: RELEASE-NAME-account-operator
name: account-operator
subjects:
- kind: ServiceAccount
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
4: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
spec:
revisionHistoryLimit: 3
selector:
matchLabels:
service: RELEASE-NAME-account-operator
service: account-operator
template:
metadata:
annotations: null
labels:
control-plane: controller-manager
service: RELEASE-NAME-account-operator
service: account-operator
spec:
containers:
- args:
Expand Down Expand Up @@ -735,11 +730,11 @@ operator match the snapshot (with kubeconfigSecret):
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccountName: RELEASE-NAME
serviceAccountName: account-operator
volumeMounts:
- mountPath: /api-kubeconfig
name: external-api-server
serviceAccountName: RELEASE-NAME-account-operator
serviceAccountName: account-operator
terminationGracePeriodSeconds: 10
volumes:
- name: external-api-server
Expand All @@ -751,8 +746,7 @@ operator match the snapshot (with kubeconfigSecret):
- name: github
kind: ServiceAccount
metadata:
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
operator match the snapshot with webhook enabled:
1: |
apiVersion: apiextensions.k8s.io/v1
Expand Down Expand Up @@ -964,7 +958,7 @@ operator match the snapshot with webhook enabled:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
rules:
- apiGroups:
- core.openmfp.io
Expand Down Expand Up @@ -1020,35 +1014,33 @@ operator match the snapshot with webhook enabled:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: RELEASE-NAME-account-operator
name: account-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: RELEASE-NAME-account-operator
name: account-operator
subjects:
- kind: ServiceAccount
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
4: |
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
cert-manager.io/inject-ca-from: NAMESPACE/RELEASE-NAME-account-operator-serving-cert
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
cert-manager.io/inject-ca-from: NAMESPACE/account-operator-serving-cert
name: account-operator
spec:
revisionHistoryLimit: 3
selector:
matchLabels:
service: RELEASE-NAME-account-operator
service: account-operator
template:
metadata:
annotations:
traffic.sidecar.istio.io/excludeInboundPorts: "9443"
labels:
control-plane: controller-manager
service: RELEASE-NAME-account-operator
service: account-operator
spec:
containers:
- args:
Expand Down Expand Up @@ -1120,39 +1112,38 @@ operator match the snapshot with webhook enabled:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccountName: RELEASE-NAME
serviceAccountName: account-operator
volumeMounts:
- mountPath: /certs
name: cert
readOnly: true
serviceAccountName: RELEASE-NAME-account-operator
serviceAccountName: account-operator
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: RELEASE-NAME-account-operator-webhook-server-cert
secretName: account-operator-webhook-server-cert
5: |
apiVersion: v1
imagePullSecrets:
- name: github
kind: ServiceAccount
metadata:
name: RELEASE-NAME-account-operator
namespace: NAMESPACE
name: account-operator
6: |
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: NAMESPACE/RELEASE-NAME-account-operator-serving-cert
name: RELEASE-NAME-account-operator-mutating-webhook-configuration
cert-manager.io/inject-ca-from: NAMESPACE/account-operator-serving-cert
name: account-operator-mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: RELEASE-NAME-account-operator-webhook
name: account-operator-webhook
namespace: NAMESPACE
path: /mutate-core-openmfp-io-v1alpha1-account
failurePolicy: Fail
Expand All @@ -1171,35 +1162,32 @@ operator match the snapshot with webhook enabled:
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: RELEASE-NAME-account-operator-selfsigned-issuer
namespace: null
name: account-operator-selfsigned-issuer
spec:
selfSigned: {}
8: |
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: RELEASE-NAME-account-operator-serving-cert
namespace: null
name: account-operator-serving-cert
spec:
dnsNames:
- RELEASE-NAME-account-operator-webhook.NAMESPACE.svc
- RELEASE-NAME-account-operator-webhook.NAMESPACE.svc.cluster.local
- account-operator-webhook.NAMESPACE.svc
- account-operator-webhook.NAMESPACE.svc.cluster.local
issuerRef:
kind: Issuer
name: RELEASE-NAME-account-operator-selfsigned-issuer
secretName: RELEASE-NAME-account-operator-webhook-server-cert
name: account-operator-selfsigned-issuer
secretName: account-operator-webhook-server-cert
9: |
apiVersion: v1
kind: Service
metadata:
name: RELEASE-NAME-account-operator-webhook
namespace: NAMESPACE
name: account-operator-webhook
spec:
ports:
- port: 443
protocol: TCP
targetPort: 9443
selector:
control-plane: controller-manager
service: RELEASE-NAME-account-operator
service: account-operator
4 changes: 3 additions & 1 deletion charts/account-operator/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
suite: operator
chart:
appVersion: 0.0.0
release:
name: account-operator
tests:
- it: operator match the snapshot
asserts:
Expand Down Expand Up @@ -28,7 +30,7 @@ tests:
type: RuntimeDefault
- equal:
path: spec.template.spec.containers[0].serviceAccountName
value: RELEASE-NAME
value: account-operator
- equal:
path: spec.template.spec.containers[0].automountServiceAccountToken
value: true
1 change: 0 additions & 1 deletion charts/common/test-chart/templates/vs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: {{ include "common.entity.name" . }}
namespace: {{ .Release.Namespace }}
spec:
gateways:
- {{ .Release.Namespace }}/gateway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "common.entity.name" . }}
namespace: {{ .Release.Namespace }}
{{- include "common.imagePullSecret" . }}
Loading

0 comments on commit a0166b7

Please sign in to comment.