Skip to content

Commit

Permalink
change name from cosi-driver to cosi
Browse files Browse the repository at this point in the history
  • Loading branch information
mdutka-dell committed Aug 28, 2023
1 parent 0068140 commit 1279038
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion charts/cosi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License

apiVersion: v2
name: cosi-driver
name: cosi
description: Container Object Storage Interface (COSI) Driver for Dell ObjectScale

# A chart can be either an 'application' or a 'library' chart.
Expand Down
52 changes: 26 additions & 26 deletions charts/cosi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "cosi-driver.name" }}
{{- define "cosi.name" }}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "cosi-driver.fullname" }}
{{- define "cosi.fullname" }}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,7 +26,7 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cosi-driver.chart" }}
{{- define "cosi.chart" }}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -35,7 +35,7 @@ Create chart name and version as used by the chart label.
# Possible values: "trace" "debug" "info" "warn" "error" "fatal" "panic"
# Default value: "debug"
*/}}
{{- define "cosi-driver.logLevel" }}
{{- define "cosi.logLevel" }}
{{- $logLevelValues := list "trace" "debug" "info" "warn" "error" "fatal" "panic" }}
{{- if (has .Values.provisioner.logLevel $logLevelValues) }}
{{- .Values.provisioner.logLevel }}
Expand All @@ -48,7 +48,7 @@ Create chart name and version as used by the chart label.
# COSI driver sidecar log level
# Values are set to the integer value, higher value means more verbose logging
*/}}
{{- define "cosi-driver.provisionerSidecarVerbosity" }}
{{- define "cosi.provisionerSidecarVerbosity" }}
{{- if (kindIs "int" .Values.sidecar.verbosity) }}
{{- .Values.sidecar.verbosity }}
{{- else }}
Expand All @@ -61,7 +61,7 @@ Create chart name and version as used by the chart label.
# Possible values: "json" "text"
# Default value: "json"
*/}}
{{- define "cosi-driver.logFormat" }}
{{- define "cosi.logFormat" }}
{{- $logFormatValues := list "json" "text" }}
{{- if (has .Values.provisioner.logFormat $logFormatValues) }}
{{- .Values.provisioner.logFormat }}
Expand All @@ -75,7 +75,7 @@ Create chart name and version as used by the chart label.
# Default value is left empty on purpose, to not start any tracing if no argument was provided.
# Default value: ""
*/}}
{{- define "cosi-driver.otelEndpoint" }}
{{- define "cosi.otelEndpoint" }}
{{- if .Values.provisioner.otelEndpoint }}
{{- .Values.provisioner.otelEndpoint }}
{{- else }}
Expand All @@ -86,9 +86,9 @@ Create chart name and version as used by the chart label.
{{/*
Common labels
*/}}
{{- define "cosi-driver.labels" }}
helm.sh/chart: {{ include "cosi-driver.chart" . }}
{{- include "cosi-driver.selectorLabels" . }}
{{- define "cosi.labels" }}
helm.sh/chart: {{ include "cosi.chart" . }}
{{- include "cosi.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -98,17 +98,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "cosi-driver.selectorLabels" }}
app.kubernetes.io/name: {{ include "cosi-driver.name" . }}
{{- define "cosi.selectorLabels" }}
app.kubernetes.io/name: {{ include "cosi.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the role to use
*/}}
{{- define "cosi-driver.roleName" }}
{{- define "cosi.roleName" }}
{{- if and .Values.rbac.create }}
{{- default (printf "%s" (include "cosi-driver.fullname" .)) .Values.rbac.role.name }}
{{- default (printf "%s" (include "cosi.fullname" .)) .Values.rbac.role.name }}
{{- else }}
{{- .Values.rbac.role.name }}
{{- end }}
Expand All @@ -117,9 +117,9 @@ Create the name of the role to use
{{/*
Create the name of the role binding to use
*/}}
{{- define "cosi-driver.roleBindingName" }}
{{- define "cosi.roleBindingName" }}
{{- if and .Values.rbac.create }}
{{- default (printf "%s" (include "cosi-driver.fullname" .)) .Values.rbac.roleBinding.name }}
{{- default (printf "%s" (include "cosi.fullname" .)) .Values.rbac.roleBinding.name }}
{{- else }}
{{- .Values.rbac.roleBinding.name }}
{{- end }}
Expand All @@ -128,9 +128,9 @@ Create the name of the role binding to use
{{/*
Create the name of the service account to use
*/}}
{{- define "cosi-driver.serviceAccountName" -}}
{{- define "cosi.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "cosi-driver.fullname" .) .Values.serviceAccount.name }}
{{ default (include "cosi.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
Expand All @@ -139,37 +139,37 @@ Create the name of the service account to use
{{/*
Create the name of provisioner container
*/}}
{{- define "cosi-driver.provisionerContainerName" }}
{{- define "cosi.provisionerContainerName" }}
{{- default "objectstorage-provisioner" .Values.provisioner.name }}
{{- end }}

{{/*
Create the name of provisioner sidecar container
*/}}
{{- define "cosi-driver.provisionerSidecarContainerName" }}
{{- define "cosi.provisionerSidecarContainerName" }}
{{- default "objectstorage-provisioner-sidecar" .Values.sidecar.name }}
{{- end }}

{{/*
Create the full name of provisioner image from repository and tag
*/}}
{{- define "cosi-driver.provisionerImageName" }}
{{- define "cosi.provisionerImageName" }}
{{- .Values.provisioner.image.repository }}:{{ .Values.provisioner.image.tag | default .Chart.AppVersion }}
{{- end }}

{{/*
Create the full name of provisioner sidecar image from repository and tag
*/}}
{{- define "cosi-driver.provisionerSidecarImageName" }}
{{- define "cosi.provisionerSidecarImageName" }}
{{- .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}
{{- end }}

{{/*
Create the secret name
*/}}
{{- define "cosi-driver.secretName" }}
{{- define "cosi.secretName" }}
{{- if .Values.configuration.create }}
{{- default (printf "%s-config" (include "cosi-driver.name" . )) .Values.configuration.secretName }}
{{- default (printf "%s-config" (include "cosi.name" . )) .Values.configuration.secretName }}
{{- else }}
{{- .Values.configuration.secretName }}
{{- end }}
Expand All @@ -178,6 +178,6 @@ Create the secret name
{{/*
Create the name for secret volume
*/}}
{{- define "cosi-driver.secretVolumeName" }}
{{- printf "%s-config" (include "cosi-driver.name" . ) }}
{{- define "cosi.secretVolumeName" }}
{{- printf "%s-config" (include "cosi.name" . ) }}
{{- end }}
32 changes: 16 additions & 16 deletions charts/cosi/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cosi-driver.fullname" . }}
name: {{ include "cosi.fullname" . }}
labels:
{{- include "cosi-driver.labels" . | trim | nindent 4 }}
{{- include "cosi.labels" . | trim | nindent 4 }}
{{- with .Values.rbac.role.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -14,11 +14,11 @@ spec:
{{- end }}
selector:
matchLabels:
{{- include "cosi-driver.selectorLabels" . | trim | nindent 6 }}
{{- include "cosi.selectorLabels" . | trim | nindent 6 }}
template:
metadata:
labels:
{{- include "cosi-driver.labels" . | trim | nindent 8 }}
{{- include "cosi.labels" . | trim | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
Expand All @@ -28,37 +28,37 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "cosi-driver.serviceAccountName" . }}
serviceAccountName: {{ include "cosi.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ include "cosi-driver.provisionerContainerName" . }}
- name: {{ include "cosi.provisionerContainerName" . }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "cosi-driver.provisionerImageName" . }}
image: {{ include "cosi.provisionerImageName" . }}
imagePullPolicy: {{ .Values.provisioner.image.pullPolicy }}
args:
- "--log-level={{ include "cosi-driver.logLevel" . }}"
- "--log-format={{ include "cosi-driver.logFormat" . }}"
- "--otel-endpoint={{ include "cosi-driver.otelEndpoint" . }}"
- "--log-level={{ include "cosi.logLevel" . }}"
- "--log-format={{ include "cosi.logFormat" . }}"
- "--otel-endpoint={{ include "cosi.otelEndpoint" . }}"
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: {{ include "cosi-driver.secretVolumeName" . }}
- name: {{ include "cosi.secretVolumeName" . }}
mountPath: /cosi
- name: cosi-socket-dir
mountPath: /var/lib/cosi
- name: {{ include "cosi-driver.provisionerSidecarContainerName" . }}
image: {{ include "cosi-driver.provisionerSidecarImageName" . }}
- name: {{ include "cosi.provisionerSidecarContainerName" . }}
image: {{ include "cosi.provisionerSidecarImageName" . }}
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
args:
- "-v={{ include "cosi-driver.provisionerSidecarVerbosity" . }}"
- "-v={{ include "cosi.provisionerSidecarVerbosity" . }}"
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand All @@ -83,8 +83,8 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: {{ include "cosi-driver.secretVolumeName" . }}
- name: {{ include "cosi.secretVolumeName" . }}
secret:
secretName: {{ include "cosi-driver.secretName" . }}
secretName: {{ include "cosi.secretName" . }}
- name: cosi-socket-dir
emptyDir: {}
4 changes: 2 additions & 2 deletions charts/cosi/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "cosi-driver.roleName" . }}
name: {{ include "cosi.roleName" . }}
labels:
{{- include "cosi-driver.labels" . | trim | nindent 4 }}
{{- include "cosi.labels" . | trim | nindent 4 }}
{{- with .Values.rbac.roleBinding.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/cosi/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "cosi-driver.roleBindingName" . }}
name: {{ include "cosi.roleBindingName" . }}
labels:
{{- include "cosi-driver.labels" . | trim | nindent 4 }}
{{- include "cosi.labels" . | trim | nindent 4 }}
{{- with .Values.rbac.roleBinding.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ include "cosi-driver.serviceAccountName" . }}
name: {{ include "cosi.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ include "cosi-driver.roleName" . }}
name: {{ include "cosi.roleName" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
4 changes: 2 additions & 2 deletions charts/cosi/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "cosi-driver.secretName" . }}
name: {{ include "cosi.secretName" . }}
labels:
{{- include "cosi-driver.labels" . | trim | nindent 4 }}
{{- include "cosi.labels" . | trim | nindent 4 }}
{{- with .Values.configuration.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/cosi/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "cosi-driver.serviceAccountName" . }}
name: {{ include "cosi.serviceAccountName" . }}
labels:
{{- include "cosi-driver.labels" . | trim | nindent 4 }}
{{- include "cosi.labels" . | trim | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
10 changes: 5 additions & 5 deletions charts/cosi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License

# Default values for cosi-driver.
# Default values for cosi.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

Expand Down Expand Up @@ -63,7 +63,7 @@ configuration:
# If set to false, you must set `configuration.secretName` field to an existing configuration secret name.
create: true
annotations: {}
# name can be used to specify an existing secret name to use for the driver configuration or override the generated name (default `cosi-driver`).
# name can be used to specify an existing secret name to use for the driver configuration or override the generated name (default `cosi`).
secretName: ""
# data should be provided when installing chart, it will be used to create the Secret with the driver configuration.
# `configuration.create` must be set to `true` for this to work.
Expand All @@ -77,13 +77,13 @@ rbac:
role:
# annotations to add to the Role resource
annotations: {}
# name of the Role to create (efault `cosi-driver-role`).
# name of the Role to create (efault `cosi-role`).
name: ""
# roleBinding specifies parameters for the COSI driver RoleBinding.
roleBinding:
# Annotations to add to the RoleBinding
annotations: {}
# name of the RoleBinding to create (default `cosi-driver-rolebinding`).
# name of the RoleBinding to create (default `cosi-rolebinding`).
name: ""

# serviceAccount specifies parameters for the COSI driver ServiceAccount.
Expand All @@ -92,7 +92,7 @@ serviceAccount:
create: true
# Annotations to add to the ServiceAccount
annotations: {}
# The name of the ServiceAccount to create (or just use if `rbac.create=false`, default `cosi-driver-sa`).
# The name of the ServiceAccount to create (or just use if `rbac.create=false`, default `cosi-sa`).
name: ""

# replicaCount specifies the number of replicas of the COSI driver.
Expand Down

0 comments on commit 1279038

Please sign in to comment.