Skip to content

Commit

Permalink
test refactor: backfill helm chart with dependencies test
Browse files Browse the repository at this point in the history
- also update the vendor assets under examples and fix the examples_test
  git diff assertions. (It was running under the wrong directory and was
  giving false positive test results)

Authored-by: Dennis Leon <[email protected]>
  • Loading branch information
DennisDenuto authored and Your Name committed Jun 28, 2022
1 parent af7557c commit d894760
Show file tree
Hide file tree
Showing 217 changed files with 30,881 additions and 8,310 deletions.
9 changes: 9 additions & 0 deletions examples/helm-chart-oci-dependencies/vendir.lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
- helmChart:
appVersion: 1.16.0
version: 0.1.0
path: custom-repo-custom-version
path: vendor
kind: LockConfig
13 changes: 13 additions & 0 deletions examples/helm-chart-oci-dependencies/vendir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#@ load("@ytt:data", "data")
---
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: vendor
contents:
- path: custom-repo-custom-version
helmChart:
name: chartwithdependencies
version: 0.1.0
repository:
url: #@ "oci://{}/helmcharts".format(data.values.registryURL)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: contour
repository: oci://localhost:51643/helmcharts
version: 7.10.1
digest: sha256:43e1d71483900f8d28a4d221bf3649df3acba552537717c8016b329dceafb405
generated: "2022-06-27T14:31:16.011852-07:00"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
appVersion: 1.16.0
dependencies:
- name: contour
repository: oci://localhost:51709/helmcharts
version: 7.10.1
description: A Helm chart for Kubernetes
name: chartwithdependencies
type: application
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.14.1
digest: sha256:c69621f97b90b8c2e909293fbc475f0a3b0aaa4aa04de5df3e5d7a1974e5d735
generated: "2022-05-20T17:49:43.887206+02:00"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
annotations:
category: Infrastructure
apiVersion: v2
appVersion: 1.20.1
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 1.x.x
description: Contour is an open source Kubernetes ingress controller that works by
deploying the Envoy proxy as a reverse proxy and load balancer.
home: https://github.com/bitnami/charts/tree/master/bitnami/contour
icon: https://bitnami.com/assets/stacks/contour/img/contour-stack-220x234.png
keywords:
- ingress
- envoy
- contour
maintainers:
- name: cellebyte
url: https://github.com/Cellebyte
- name: Bitnami
url: https://github.com/bitnami/charts
name: contour
sources:
- https://github.com/projectcontour/contour
- https://github.com/envoyproxy/envoy
- https://github.com/bitnami/bitnami-docker-contour
- https://projectcontour.io
version: 7.10.1

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
annotations:
category: Infrastructure
apiVersion: v2
appVersion: 1.13.1
description: A Library Helm Chart for grouping common logic between bitnami charts.
This chart is not deployable by itself.
home: https://github.com/bitnami/charts/tree/master/bitnami/common
icon: https://bitnami.com/downloads/logos/bitnami-mark.png
keywords:
- common
- helper
- template
- function
- bitnami
maintainers:
- email: [email protected]
name: Bitnami
name: common
sources:
- https://github.com/bitnami/charts
- https://www.bitnami.com/
type: library
version: 1.14.1

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Return a soft nodeAffinity definition
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes.soft" -}}
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: {{ .key }}
operator: In
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
weight: 1
{{- end -}}

{{/*
Return a hard nodeAffinity definition
{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes.hard" -}}
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: {{ .key }}
operator: In
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
{{- end -}}

{{/*
Return a nodeAffinity definition
{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes" -}}
{{- if eq .type "soft" }}
{{- include "common.affinities.nodes.soft" . -}}
{{- else if eq .type "hard" }}
{{- include "common.affinities.nodes.hard" . -}}
{{- end -}}
{{- end -}}

{{/*
Return a soft podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods.soft" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
*/}}
{{- define "common.affinities.pods.soft" -}}
{{- $component := default "" .component -}}
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
{{- if not (empty $component) }}
{{ printf "app.kubernetes.io/component: %s" $component }}
{{- end }}
{{- range $key, $value := $extraMatchLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
namespaces:
- {{ .context.Release.Namespace | quote }}
topologyKey: kubernetes.io/hostname
weight: 1
{{- end -}}

{{/*
Return a hard podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods.hard" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}}
*/}}
{{- define "common.affinities.pods.hard" -}}
{{- $component := default "" .component -}}
{{- $extraMatchLabels := default (dict) .extraMatchLabels -}}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
{{- if not (empty $component) }}
{{ printf "app.kubernetes.io/component: %s" $component }}
{{- end }}
{{- range $key, $value := $extraMatchLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
namespaces:
- {{ .context.Release.Namespace | quote }}
topologyKey: kubernetes.io/hostname
{{- end -}}

{{/*
Return a podAffinity/podAntiAffinity definition
{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.pods" -}}
{{- if eq .type "soft" }}
{{- include "common.affinities.pods.soft" . -}}
{{- else if eq .type "hard" }}
{{- include "common.affinities.pods.hard" . -}}
{{- end -}}
{{- end -}}
Loading

0 comments on commit d894760

Please sign in to comment.