|
46 | 46 | type: ClusterIP
|
47 | 47 | `
|
48 | 48 |
|
| 49 | +const expectedHelmExternalDns = ` |
| 50 | +apiVersion: apps/v1 |
| 51 | +kind: Deployment |
| 52 | +metadata: |
| 53 | + labels: |
| 54 | + app.kubernetes.io/instance: test |
| 55 | + app.kubernetes.io/managed-by: Helm |
| 56 | + app.kubernetes.io/name: external-dns |
| 57 | + helm.sh/chart: external-dns-6.19.2 |
| 58 | + name: test-external-dns |
| 59 | + namespace: default |
| 60 | +spec: |
| 61 | + replicas: 1 |
| 62 | + selector: |
| 63 | + matchLabels: |
| 64 | + app.kubernetes.io/instance: test |
| 65 | + app.kubernetes.io/name: external-dns |
| 66 | + template: |
| 67 | + metadata: |
| 68 | + annotations: null |
| 69 | + labels: |
| 70 | + app.kubernetes.io/instance: test |
| 71 | + app.kubernetes.io/managed-by: Helm |
| 72 | + app.kubernetes.io/name: external-dns |
| 73 | + helm.sh/chart: external-dns-6.19.2 |
| 74 | + spec: |
| 75 | + affinity: |
| 76 | + nodeAffinity: null |
| 77 | + podAffinity: null |
| 78 | + podAntiAffinity: |
| 79 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 80 | + - podAffinityTerm: |
| 81 | + labelSelector: |
| 82 | + matchLabels: |
| 83 | + app.kubernetes.io/instance: test |
| 84 | + app.kubernetes.io/name: external-dns |
| 85 | + topologyKey: kubernetes.io/hostname |
| 86 | + weight: 1 |
| 87 | + containers: |
| 88 | + - args: |
| 89 | + - --metrics-address=:7979 |
| 90 | + - --log-level=info |
| 91 | + - --log-format=text |
| 92 | + - --policy=upsert-only |
| 93 | + - --provider=aws |
| 94 | + - --registry=txt |
| 95 | + - --interval=1m |
| 96 | + - --source=service |
| 97 | + - --source=ingress |
| 98 | + - --aws-api-retries=3 |
| 99 | + - --aws-zone-type= |
| 100 | + - --aws-batch-change-size=1000 |
| 101 | + env: |
| 102 | + - name: AWS_DEFAULT_REGION |
| 103 | + value: us-east-1 |
| 104 | + envFrom: null |
| 105 | + image: docker.io/bitnami/external-dns:0.13.4-debian-11-r14 |
| 106 | + imagePullPolicy: IfNotPresent |
| 107 | + livenessProbe: |
| 108 | + failureThreshold: 2 |
| 109 | + httpGet: |
| 110 | + path: /healthz |
| 111 | + port: http |
| 112 | + initialDelaySeconds: 10 |
| 113 | + periodSeconds: 10 |
| 114 | + successThreshold: 1 |
| 115 | + timeoutSeconds: 5 |
| 116 | + name: external-dns |
| 117 | + ports: |
| 118 | + - containerPort: 7979 |
| 119 | + name: http |
| 120 | + readinessProbe: |
| 121 | + failureThreshold: 6 |
| 122 | + httpGet: |
| 123 | + path: /healthz |
| 124 | + port: http |
| 125 | + initialDelaySeconds: 5 |
| 126 | + periodSeconds: 10 |
| 127 | + successThreshold: 1 |
| 128 | + timeoutSeconds: 5 |
| 129 | + resources: |
| 130 | + limits: {} |
| 131 | + requests: {} |
| 132 | + volumeMounts: null |
| 133 | + securityContext: |
| 134 | + fsGroup: 1001 |
| 135 | + runAsUser: 1001 |
| 136 | + serviceAccountName: default |
| 137 | + volumes: null |
| 138 | +` |
| 139 | + |
49 | 140 | func TestHelmChartInflationGeneratorOld(t *testing.T) {
|
50 | 141 | th := kusttest_test.MakeEnhancedHarnessWithTmpRoot(t)
|
51 | 142 | defer th.Reset()
|
@@ -84,6 +175,35 @@ helmCharts:
|
84 | 175 | th.AssertActualEqualsExpected(m, expectedHelm)
|
85 | 176 | }
|
86 | 177 |
|
| 178 | +func TestHelmChartInflationGeneratorWithOciRepository(t *testing.T) { |
| 179 | + th := kusttest_test.MakeEnhancedHarnessWithTmpRoot(t) |
| 180 | + defer th.Reset() |
| 181 | + if err := th.ErrIfNoHelm(); err != nil { |
| 182 | + t.Skip("skipping: " + err.Error()) |
| 183 | + } |
| 184 | + |
| 185 | + th.WriteK(th.GetRoot(), ` |
| 186 | +helmCharts: |
| 187 | +- name: external-dns |
| 188 | + repo: oci://registry-1.docker.io/bitnamicharts/ |
| 189 | + version: 6.19.2 |
| 190 | + releaseName: test |
| 191 | + valuesInline: |
| 192 | + crd: |
| 193 | + create: false |
| 194 | + rbac: |
| 195 | + create: false |
| 196 | + serviceAccount: |
| 197 | + create: false |
| 198 | + service: |
| 199 | + enabled: false |
| 200 | +
|
| 201 | +`) |
| 202 | + |
| 203 | + m := th.Run(th.GetRoot(), th.MakeOptionsPluginsEnabled()) |
| 204 | + th.AssertActualEqualsExpected(m, expectedHelmExternalDns) |
| 205 | +} |
| 206 | + |
87 | 207 | // Last mile helm - show how kustomize puts helm charts into different
|
88 | 208 | // namespaces with different customizations.
|
89 | 209 | func TestHelmChartProdVsDev(t *testing.T) {
|
|
0 commit comments