Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .dmtlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,36 @@ linters-settings:
- tools/addlicense/testdata
- test/performance/ssh
- test/e2e/legacy/testdata/sshkeys
container:
exclude-rules:
seccomp-profile:
- kind: Deployment
name: virt-operator
container: kube-rbac-proxy
- kind: Deployment
name: virt-operator
container: virt-operator
- kind: Deployment
name: dvcr
container: dvcr
- kind: Deployment
name: dvcr
container: kube-rbac-proxy
- kind: Job
name: pre-delete-hook
container: pre-delete-hook
- kind: Deployment
name: virtualization-controller
container: virtualization-controller
- kind: Deployment
name: virtualization-controller
container: kube-rbac-proxy
- kind: Deployment
name: cdi-operator
container: kube-rbac-proxy
- kind: Deployment
name: cdi-operator
container: cdi-operator
- kind: Deployment
name: virtualization-api
container: virtualization-api
20 changes: 10 additions & 10 deletions templates/dvcr/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ true
name: dvcr-secrets
key: salt

{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: "/var/lib/registry"
{{- else if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "ObjectStorage" }}
{{- else if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "ObjectStorage" }}
{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.objectStorage.type "S3" }}
- name: REGISTRY_STORAGE_S3_REGION
value: "{{ .Values.virtualization.internal.moduleConfig.dvcr.storage.objectStorage.s3.region }}"
Expand All @@ -53,7 +53,7 @@ true
{{- end }}

{{- define "dvcr.envs.garbageCollection" -}}
{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: "/var/lib/registry"
{{- end }}
Expand All @@ -64,7 +64,7 @@ true
- name: "dvcr-config"
mountPath: "/etc/docker/registry"

{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
- name: data
mountPath: /var/lib/registry/
{{- end }}
Expand All @@ -82,7 +82,7 @@ true
{{- define "dvcr.volumeMounts.garbageCollection" -}}
- name: "dvcr-config"
mountPath: "/etc/docker/registry"
{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
- name: data
mountPath: /var/lib/registry/
{{- end }}
Expand All @@ -94,7 +94,7 @@ true
configMap:
name: dvcr-config

{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
- name: data
persistentVolumeClaim:
claimName: dvcr
Expand All @@ -118,18 +118,18 @@ true
replicas: 1
strategy:
type: Recreate
{{- else if and (include "helm_lib_ha_enabled" .) (eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "ObjectStorage") }}
{{- else if and (include "helm_lib_ha_enabled" .) (eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "ObjectStorage") }}
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
{{- else if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "ObjectStorage" }}
{{- else if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "ObjectStorage" }}
replicas: 1
strategy:
type: RollingUpdate
{{- else if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- else if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
replicas: 1
strategy:
type: Recreate
Expand All @@ -140,7 +140,7 @@ strategy:
{{- $context := index . 0 -}}
{{- $yes := index . 1 -}}
{{- $no := index . 2 -}}
{{- if and (include "helm_lib_ha_enabled" $context) (eq $context.Values.virtualization.internal.moduleConfig.dvcr.storage.type "ObjectStorage") }}
{{- if and (include "helm_lib_ha_enabled" $context) (eq ($context.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "ObjectStorage") }}
{{- $yes -}}
{{- else }}
{{- $no -}}
Expand Down
2 changes: 2 additions & 0 deletions templates/dvcr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ spec:
maxAllowed:
cpu: 100m
memory: 250Mi
{{- if eq (include "dvcr.isGarbageCollection" . ) "true" }}
- containerName: dvcr-garbage-collection
minAllowed:
{{- include "dvcr.resources.garbageCollection" . | nindent 8 }}
maxAllowed:
cpu: 100m
memory: 250Mi
{{- end }}
{{- end }}
---
apiVersion: policy/v1
Expand Down
2 changes: 1 addition & 1 deletion templates/dvcr/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if eq (include "dvcr.isEnabled" . ) "true"}}
{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "PersistentVolumeClaim" }}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "PersistentVolumeClaim" }}
{{- $storageClassName := dig "storageClassName" "" .Values.virtualization.internal.moduleConfig.dvcr.storage.persistentVolumeClaim }}
kind: PersistentVolumeClaim
apiVersion: v1
Expand Down
3 changes: 2 additions & 1 deletion templates/dvcr/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ type: kubernetes.io/dockerconfigjson
data:
{{- include "dvcr.generate_dockercfg" (list . $registry "admin" .Values.virtualization.internal.dvcr.passwordRW) | nindent 2 }}

{{- if eq .Values.virtualization.internal.moduleConfig.dvcr.storage.type "ObjectStorage"}}
{{- if eq (.Values.virtualization.internal.moduleConfig | dig "dvcr" "storage" "type" "") "ObjectStorage"}}

---
apiVersion: v1
kind: Secret
Expand Down
Loading