Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-burt committed Sep 5, 2024
1 parent 9079377 commit 3f7afb2
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 14 deletions.
4 changes: 4 additions & 0 deletions examples/helm3/components/apache/datasource.libsonnet
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
objects: import 'data://helm/apache?config-from=apache-config',
config: {
name: 'mock-release',
options: {
repo: 'https://charts.bitnami.com/bitnami',
version: '11.2.17',
namespace: 'foobar',
},
values: {
key: 'value',
},
},
}
213 changes: 199 additions & 14 deletions vm/internal/ds/helm3/testdata/apache.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,86 @@
[
{
"apiVersion": "networking.k8s.io/v1",
"kind": "NetworkPolicy",
"metadata": {
"labels": {
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
},
"name": "mock-release-apache",
"namespace": "foobar"
},
"spec": {
"egress": [
{}
],
"ingress": [
{
"ports": [
{
"port": 8080
},
{
"port": 8443
}
]
}
],
"podSelector": {
"matchLabels": {
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/name": "apache"
}
},
"policyTypes": [
"Ingress",
"Egress"
]
}
},
{
"apiVersion": "policy/v1",
"kind": "PodDisruptionBudget",
"metadata": {
"labels": {
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
},
"name": "mock-release-apache",
"namespace": "foobar"
},
"spec": {
"maxUnavailable": 1,
"selector": {
"matchLabels": {
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/name": "apache"
}
}
}
},
{
"apiVersion": "v1",
"automountServiceAccountToken": false,
"kind": "ServiceAccount",
"metadata": {
"labels": {
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
},
"name": "mock-release-apache",
"namespace": "foobar"
}
},
{
"apiVersion": "v1",
"kind": "Service",
Expand All @@ -7,7 +89,8 @@
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"helm.sh/chart": "apache-10.1.0"
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
},
"name": "mock-release-apache",
"namespace": "foobar"
Expand Down Expand Up @@ -43,7 +126,8 @@
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"helm.sh/chart": "apache-10.1.0"
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
},
"name": "mock-release-apache",
"namespace": "foobar"
Expand All @@ -66,7 +150,8 @@
"app.kubernetes.io/instance": "mock-release",
"app.kubernetes.io/managed-by": "Helm",
"app.kubernetes.io/name": "apache",
"helm.sh/chart": "apache-10.1.0"
"app.kubernetes.io/version": "2.4.62",
"helm.sh/chart": "apache-11.2.17"
}
},
"spec": {
Expand All @@ -90,6 +175,7 @@
]
}
},
"automountServiceAccountToken": false,
"containers": [
{
"env": [
Expand All @@ -107,17 +193,16 @@
}
],
"envFrom": null,
"image": "docker.io/bitnami/apache:2.4.57-debian-11-r134",
"image": "docker.io/bitnami/apache:2.4.62-debian-12-r8",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 6,
"httpGet": {
"path": "/",
"port": "http"
},
"initialDelaySeconds": 180,
"periodSeconds": 20,
"successThreshold": 1,
"tcpSocket": {
"port": "http"
},
"timeoutSeconds": 5
},
"name": "apache",
Expand All @@ -143,14 +228,56 @@
"timeoutSeconds": 5
},
"resources": {
"limits": {},
"requests": {}
"limits": {
"cpu": "150m",
"ephemeral-storage": "2Gi",
"memory": "192Mi"
},
"requests": {
"cpu": "100m",
"ephemeral-storage": "50Mi",
"memory": "128Mi"
}
},
"securityContext": {
"allowPrivilegeEscalation": false,
"capabilities": {
"drop": [
"ALL"
]
},
"privileged": false,
"readOnlyRootFilesystem": true,
"runAsGroup": 1001,
"runAsNonRoot": true,
"runAsUser": 1001
"runAsUser": 1001,
"seLinuxOptions": {},
"seccompProfile": {
"type": "RuntimeDefault"
}
},
"volumeMounts": null
"volumeMounts": [
{
"mountPath": "/opt/bitnami/apache/conf",
"name": "empty-dir",
"subPath": "app-conf-dir"
},
{
"mountPath": "/opt/bitnami/apache/logs",
"name": "empty-dir",
"subPath": "app-logs-dir"
},
{
"mountPath": "/tmp",
"name": "empty-dir",
"subPath": "tmp-dir"
},
{
"mountPath": "/opt/bitnami/apache/var/run",
"name": "empty-dir",
"subPath": "app-tmp-dir"
}
]
}
],
"hostAliases": [
Expand All @@ -161,11 +288,69 @@
"ip": "127.0.0.1"
}
],
"initContainers": [
{
"args": [
"-ec",
"#!/bin/bash\n\n. /opt/bitnami/scripts/libfs.sh\n# We copy the logs folder because it has symlinks to stdout and stderr\nif ! is_dir_empty /opt/bitnami/apache/logs; then\n cp -r /opt/bitnami/apache/logs /emptydir/app-logs-dir\nfi\n"
],
"command": [
"/bin/bash"
],
"image": "docker.io/bitnami/apache:2.4.62-debian-12-r8",
"imagePullPolicy": "IfNotPresent",
"name": "preserve-logs-symlinks",
"resources": {
"limits": {
"cpu": "150m",
"ephemeral-storage": "2Gi",
"memory": "192Mi"
},
"requests": {
"cpu": "100m",
"ephemeral-storage": "50Mi",
"memory": "128Mi"
}
},
"securityContext": {
"allowPrivilegeEscalation": false,
"capabilities": {
"drop": [
"ALL"
]
},
"privileged": false,
"readOnlyRootFilesystem": true,
"runAsGroup": 1001,
"runAsNonRoot": true,
"runAsUser": 1001,
"seLinuxOptions": {},
"seccompProfile": {
"type": "RuntimeDefault"
}
},
"volumeMounts": [
{
"mountPath": "/emptydir",
"name": "empty-dir"
}
]
}
],
"priorityClassName": "",
"securityContext": {
"fsGroup": 1001
"fsGroup": 1001,
"fsGroupChangePolicy": "Always",
"supplementalGroups": [],
"sysctls": []
},
"volumes": null
"serviceAccountName": "mock-release-apache",
"volumes": [
{
"emptyDir": {},
"name": "empty-dir"
}
]
}
}
}
Expand Down

0 comments on commit 3f7afb2

Please sign in to comment.