-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
882 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @snyk/hybrid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Validate Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.10.0 | ||
|
||
- name: Run helm unittest | ||
run: | | ||
helm plugin install https://github.com/helm-unittest/helm-unittest | ||
helm dep up hybrid-platform/charts/hybrid-platform-egress | ||
helm unittest hybrid-platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.dccache | ||
|
||
# General files for the project | ||
pkg/* | ||
*.pyc | ||
bin/* | ||
.project | ||
/.bin | ||
/_test/secrets/*.json | ||
|
||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA | ||
.idea/ | ||
*.iml | ||
|
||
# Vscode files | ||
.vscode | ||
|
||
# Emacs save files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim-related files | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
|
||
.history | ||
|
||
temp | ||
|
||
accept.json | ||
acceptcode.json | ||
acceptcontainer.json | ||
bitbucket.crt | ||
.dccache | ||
|
||
# Packaged Helm Charts | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[extend] | ||
useDefault = true | ||
|
||
[allowList] | ||
paths = ['''hybrid-platform/tests'''] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repos: | ||
- repo: https://github.com/gitleaks/gitleaks | ||
rev: v8.17.0 | ||
hooks: | ||
- id: gitleaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
brew "make" | ||
brew "pre-commit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
setup: | ||
pre-commit install --install-hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: snyk-universal-broker-helmcharts | ||
spec: | ||
type: iac | ||
lifecycle: "-" | ||
owner: hybrid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: backstage.io/v1beta1 | ||
kind: Component | ||
metadata: | ||
name: snyk-universal-broker-helmcharts | ||
description: Universal Broker Helm Charts | ||
annotations: | ||
github.com/project-slug: snyk/snyk/snyk-universal-broker-helmcharts | ||
backstage.io/techdocs-ref: dir:. | ||
github.com/team-slug: snyk/hybrid | ||
spec: | ||
owner: hybrid | ||
lifecycle: '-' | ||
type: external-tooling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Hybrid Platform | ||
|
||
Documentation for the Snyk Hybrid Platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: snyk-universal-broker | ||
version: 0.0.1 | ||
description: A Helm chart for Kubernetes | ||
type: application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Thank you for installing the Snyk Broker | ||
|
||
Login to the Snyk UI to start onboarding projects: https://app.snyk.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "snyk-broker.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default ("common.names.fullname" ) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a secret name. | ||
Pass a dict of Context ($) and secretName: | ||
include "snyk-broker.genericSecretName" (dict "Context" $ "secretName" "secret-name") | ||
*/}} | ||
{{- define "snyk-broker.genericSecretName" -}} | ||
{{- if not .Context.Values.disableSuffixes -}} | ||
{{ printf "%s-%s" ( include "snyk-broker.fullname" .Context ) .secretName }} | ||
{{- else -}} | ||
{{- printf "snyk-broker-%s" .secretName }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "snyk-broker.tlsSecretName" -}} | ||
{{- include "snyk-broker.genericSecretName" (dict "Context" . "secretName" "tls-secret" ) -}} | ||
{{- end }} | ||
|
||
{{- define "snyk-broker.caCertSecretName" -}} | ||
{{- include "snyk-broker.genericSecretName" (dict "Context" . "secretName" "cacert-secret" ) -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{/* | ||
Kubernetes standard labels | ||
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) -}} | ||
*/}} | ||
{{- define "common.labels.standard" -}} | ||
{{- if and (hasKey . "customLabels") (hasKey . "context") -}} | ||
{{- $default := dict "app.kubernetes.io/name" (include "common.names.name" .context) "helm.sh/chart" (include "common.names.chart" .context) "app.kubernetes.io/instance" .context.Release.Name "app.kubernetes.io/managed-by" .context.Release.Service -}} | ||
{{- with .context.Chart.AppVersion -}} | ||
{{- $_ := set $default "app.kubernetes.io/version" . -}} | ||
{{- end -}} | ||
{{ template "common.tplvalues.merge" (dict "values" (list .customLabels $default) "context" .context) }} | ||
{{- else -}} | ||
app.kubernetes.io/name: {{ include "common.names.name" . }} | ||
helm.sh/chart: {{ include "common.names.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- with .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ . | quote }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Labels used on immutable fields such as deploy.spec.selector.matchLabels or svc.spec.selector | ||
*/}} | ||
{{- define "common.labels.matchLabels" -}} | ||
{{- if and (hasKey . "customLabels") (hasKey . "context") -}} | ||
{{ merge (pick (include "common.tplvalues.render" (dict "value" .customLabels "context" .context) | fromYaml) "app.kubernetes.io/name" "app.kubernetes.io/instance") (dict "app.kubernetes.io/name" (include "common.names.name" .context) "app.kubernetes.io/instance" .context.Release.Name ) | toYaml }} | ||
{{- else -}} | ||
app.kubernetes.io/name: {{ include "common.names.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- define "common.names.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "common.names.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
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 "common.names.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Renders a value that contains template perhaps with scope if the scope is present. | ||
Usage: | ||
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }} | ||
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }} | ||
*/}} | ||
{{- define "common.tplvalues.render" -}} | ||
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} | ||
{{- if contains "{{" (toJson .value) }} | ||
{{- if .scope }} | ||
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }} | ||
{{- else }} | ||
{{- tpl $value .context }} | ||
{{- end }} | ||
{{- else }} | ||
{{- $value }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Merge a list of values that contains template after rendering them. | ||
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge | ||
Usage: | ||
{{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }} | ||
*/}} | ||
{{- define "common.tplvalues.merge" -}} | ||
{{- $dst := dict -}} | ||
{{- range .values -}} | ||
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}} | ||
{{- end -}} | ||
{{ $dst | toYaml }} | ||
{{- end -}} |
Oops, something went wrong.