Skip to content

Commit

Permalink
Merge pull request #334 from mcrowson/pod-name-trunc
Browse files Browse the repository at this point in the history
SHRA truncating long pod names
  • Loading branch information
gpontejos authored Nov 14, 2024
2 parents faccad6 + 42b0fc3 commit 4abe394
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This repository is a collection of CrowdStrike Helm Charts. The Helm Charts deve
| [Falcon Integration Gateway](helm-charts/falcon-integration-gateway) | Deploys the Falcon Integration Gateway. See [the README](helm-charts/falcon-integration-gateway/README.md) for more info. |
| [Falcon Kubernetes Admission Controller](helm-charts/falcon-kac) | Deploy the Falcon Kubernetes Admission Controller. See [the README](helm-charts/falcon-kac/README.md) for more info. |
| [Falcon Image Analyzer](helm-charts/falcon-image-analyzer) | Deploy the Falcon Image Analyzer. See [the README](helm-charts/falcon-image-analyzer/README.md) for more info. |
| [Falcon Self Hosted Registry Assessment](helm-charts/falcon-self-hosted-registry-assessment) | Deploy the Falcon Self Hosted Registry Assessment. See [the README](helm-charts/falcon-self-hosted-registry-assessment/README.md) for more info. |

## Developer Guide
If you are a developer, please read our [Developer's Guide](docs/developer_guide.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 4 additions & 4 deletions helm-charts/falcon-self-hosted-registry-assessment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ Copy the SHRA's `falcon-jobcontroller` and `falcon-registryassessmentexecutor` i
1. Create new environment variables for your chosen versions of the two SHRA images.
Replace `1.0.0` with the image tag you want to fetch.
```sh
export $FALCON_SHRA_JC_VERSION="1.0.0"
export $FALCON_SHRA_EX_VERSION="1.0.0"
export FALCON_SHRA_JC_VERSION="1.0.0"
export FALCON_SHRA_EX_VERSION="1.0.0"
```

1. Set an environment variable with the URL for your private registry, where you'll store these images.
We recommend using `falcon-selfhostedregistryassessment` in your repository name.
Adjust this sample with your registry's URL and to match your repository naming scheme.
```sh
export $MY_SHRA_REPO=<your-registry-url>/falcon-selfhostedregistryassessment
export MY_SHRA_REPO=<your-registry-url>/falcon-selfhostedregistryassessment
```

1. Use `skopeo copy` to copy the job controller image from our registry to yours.
Expand Down Expand Up @@ -1331,7 +1331,7 @@ Before you install, follow the configuration steps above to prepare your account
helm upgrade --install -f </path/to/values_override.yaml> \
--create-namespace \
--namespace falcon-self-hosted-registry-assessment \
falcon-self-hosted-registry-assessment \
falcon-shra \
crowdstrike/falcon-self-hosted-registry-assessment
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Expand the name of the chart.
*/}}
{{- define "ra-self-hosted.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- default "shra" .Values.nameOverride | trunc 40 | trimSuffix "-" }}
{{- end }}

{{/*
Expand All @@ -12,27 +12,27 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "ra-self-hosted.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- .Values.fullnameOverride | trunc 40 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- $name := default "shra" .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- .Release.Name | trunc 40 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" .Release.Name $name | trunc 50 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{- define "ra-self-hosted-executor.fullname" -}}
{{- printf "%s-%s" (include "ra-self-hosted.fullname" .) "executor" | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" (include "ra-self-hosted.fullname" .) "executor" | trunc 52 | trimSuffix "-" }}
{{- end -}}

{{- define "ra-self-hosted-executor.pullsecret-name" -}}
{{- printf "%s-%s-pullsecret" (include "ra-self-hosted.fullname" .) "executor" | trunc 63 | trimSuffix "-" }}
{{- end -}}

{{- define "ra-self-hosted-job-controller.fullname" -}}
{{- printf "%s-%s" (include "ra-self-hosted.fullname" .) "job-controller" | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" (include "ra-self-hosted.fullname" .) "job-controller" | trunc 52 | trimSuffix "-" }}
{{- end -}}

{{- define "ra-self-hosted-job-controller.pullsecret-name" -}}
Expand Down Expand Up @@ -232,4 +232,4 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- else -}}
{{- .Values.tls.existingSecret -}}
{{- end -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
labels:
{{- include "ra-self-hosted.labels-executor" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/executor-comfigmap.yaml") . | sha256sum }}
checksum/config: {{ include (print $.Template.BasePath "/executor-configmap.yaml") . | sha256sum }}
{{ if .Values.executor.podAnnotations -}}
{{- .Values.executor.podAnnotations | indent 8 -}}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
labels:
{{- include "ra-self-hosted-job-controller.labels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/job-controller-comfigmap.yaml") . | sha256sum }}
checksum/config: {{ include (print $.Template.BasePath "/job-controller-configmap.yaml") . | sha256sum }}
spec:
securityContext:
fsGroup: 2001
Expand Down

0 comments on commit 4abe394

Please sign in to comment.