Skip to content

Commit 18fcbde

Browse files
committed
fixes
1 parent 9fcca3a commit 18fcbde

File tree

12 files changed

+39
-39
lines changed

12 files changed

+39
-39
lines changed

.circleci/tests/golden.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
var update = flag.Bool("update-golden", false, "update golden test output files")
1515

16-
type TemplateGoldenTest struct {
16+
type goldenHelmTest struct {
1717
ChartPath string
1818
Release string
1919
Namespace string
@@ -24,8 +24,8 @@ type TemplateGoldenTest struct {
2424
GoldenSubDirectory string
2525
}
2626

27-
// TestContainerGoldenTestDefaults Code is based on the article here: https://medium.com/@zelldon91/advanced-test-practices-for-helm-charts-587caeeb4cb
28-
func TestContainerGoldenTestDefaults(t *testing.T, testCase *TemplateGoldenTest) {
27+
// runGoldenHelmTest Code is based on the article here: https://medium.com/@zelldon91/advanced-test-practices-for-helm-charts-587caeeb4cb
28+
func runGoldenHelmTest(t *testing.T, testCase *goldenHelmTest) {
2929
r := require.New(t)
3030

3131
options := &helm.Options{

.circleci/tests/golden/custom/wiz-admission-controller.golden.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ metadata:
3535
app.kubernetes.io/version: "2.7"
3636
app.kubernetes.io/managed-by: Helm
3737
stringData:
38-
clientId: "<insert-client-id>"
39-
clientToken: "<insert-client-token>"
38+
clientId: "<required-client-id>"
39+
clientToken: "<required-client-token>"
4040
---
4141
# Source: wiz-admission-controller/templates/serviceaccount.yaml
4242
apiVersion: rbac.authorization.k8s.io/v1

.circleci/tests/golden/custom/wiz-sensor.golden.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ metadata:
2626
app.kubernetes.io/managed-by: Helm
2727
type: Opaque
2828
stringData:
29-
clientId: "<insert-clientId>"
30-
clientToken: "<insert-clientToken>"
29+
clientId: "<required-clientId>"
30+
clientToken: "<required-clientToken>"
3131
---
3232
# Source: wiz-sensor/templates/imagepullsecret.yaml
3333
apiVersion: v1

.circleci/tests/golden/default/wiz-admission-controller.golden.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ metadata:
3838
app.kubernetes.io/version: "2.7"
3939
app.kubernetes.io/managed-by: Helm
4040
stringData:
41-
clientId: "<insert-client-id>"
42-
clientToken: "<insert-client-token>"
41+
clientId: "<required-client-id>"
42+
clientToken: "<required-client-token>"
4343
---
4444
# Source: wiz-admission-controller/templates/serviceaccount.yaml
4545
apiVersion: rbac.authorization.k8s.io/v1
@@ -207,7 +207,7 @@ spec:
207207
metadata:
208208
annotations:
209209
rollme.proxyHash: 19514bab71d978154200cb24acbc4334cc95e5470ccab6e9216c99152171633a
210-
rollme.wizApiTokenHash: be7f348cb8721e285ea80fa05ef524362ac46a57b0539e78b390db2bb0acb1be
210+
rollme.wizApiTokenHash: cbb3aea2a985eff2a33543866bfc77f891c84358af93ca8653c159e043cf8ae4
211211
rollme.webhookCert: "REDACTED"
212212
labels:
213213

@@ -362,7 +362,7 @@ spec:
362362
metadata:
363363
annotations:
364364
rollme.proxyHash: 19514bab71d978154200cb24acbc4334cc95e5470ccab6e9216c99152171633a
365-
rollme.wizApiTokenHash: be7f348cb8721e285ea80fa05ef524362ac46a57b0539e78b390db2bb0acb1be
365+
rollme.wizApiTokenHash: cbb3aea2a985eff2a33543866bfc77f891c84358af93ca8653c159e043cf8ae4
366366
labels:
367367
helm.sh/chart: "REDACTED"
368368
app.kubernetes.io/chartName: wiz-admission-controller

.circleci/tests/golden/default/wiz-kubernetes-connector.golden.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ metadata:
193193
"helm.sh/hook": pre-install, pre-upgrade
194194
"helm.sh/hook-weight": "-1"
195195
stringData:
196-
clientId: "<insert-client-id>"
197-
clientToken: "<insert-client-token>"
196+
clientId: "<required-client-id>"
197+
clientToken: "<required-client-token>"
198198
---
199199
# Source: wiz-kubernetes-connector/templates/service-account-cluster-reader.yaml
200200
apiVersion: v1
@@ -283,7 +283,7 @@ metadata:
283283
annotations:
284284
"helm.sh/hook": pre-install,pre-upgrade
285285
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
286-
rollme.wizApiTokenHash: 465be91677156a402d5d5c6cb47fddad732ebdd57e3458a877eb2cc544b9f217
286+
rollme.wizApiTokenHash: bfe1394784ba2a07711575f7efaf1fbc40474018a130af5f96cf9ca9758395d9
287287
rollme.proxyHash: 9aa53d69075371b3fa23ebeea2fd2416ea81fb533499d071ca2d576f17c7c886
288288
rollme.brokerHash: 115ba85431eeaf8db3ff2173aee02d16e67df1555d5e1ef74cfa7ac0d812cab2
289289

.circleci/tests/golden/default/wiz-kubernetes-integration.golden.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ metadata:
1212
app.kubernetes.io/managed-by: Helm
1313
annotations:
1414
stringData:
15-
clientId: "<insert-client-id>"
16-
clientToken: "<insert-client-token>"
15+
clientId: "<required-client-id>"
16+
clientToken: "<required-client-token>"

.circleci/tests/golden/default/wiz-sensor.golden.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ metadata:
3030
app.kubernetes.io/managed-by: Helm
3131
type: Opaque
3232
stringData:
33-
clientId: "<insert-clientId>"
34-
clientToken: "<insert-clientToken>"
33+
clientId: "<required-clientId>"
34+
clientToken: "<required-clientToken>"
3535
---
3636
# Source: wiz-sensor/templates/imagepullsecret.yaml
3737
apiVersion: v1
@@ -49,7 +49,7 @@ metadata:
4949
app.kubernetes.io/managed-by: Helm
5050
namespace: release-helm-namespace
5151
data:
52-
.dockerconfigjson: eyJhdXRocyI6IHsid2l6aW8uYXp1cmVjci5pbyI6IHsiYXV0aCI6ICJQR2x1YzJWeWRDMTFjMlZ5Ym1GdFpUNDZQR2x1YzJWeWRDMXdZWE56ZDI5eVpEND0ifX19
52+
.dockerconfigjson: eyJhdXRocyI6IHsid2l6aW8uYXp1cmVjci5pbyI6IHsiYXV0aCI6ICJQSEpsY1hWcGNtVmtMWFZ6WlhKdVlXMWxQam84Y21WeGRXbHlaV1F0Y0dGemMzZHZjbVErIn19fQ==
5353
---
5454
# Source: wiz-sensor/templates/clusterrole.yaml
5555
apiVersion: rbac.authorization.k8s.io/v1

.circleci/tests/charts_test.go renamed to .circleci/tests/helm_repository_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ const (
1717
chartsRootDir = "../../."
1818
)
1919

20-
type ss struct {
20+
type helmRepoSuite struct {
2121
suite.Suite
2222
}
2323

2424
func TestSs(t *testing.T) {
25-
suite.Run(t, new(ss))
25+
suite.Run(t, new(helmRepoSuite))
2626
}
2727

28-
func (s *ss) TestChartTemplateWithDefaultValues() {
29-
charts := s.getCharts(chartsRootDir)
28+
func (s *helmRepoSuite) TestChartTemplateWithDefaultValues() {
29+
charts := s.getChartsInDirectory(chartsRootDir)
3030

3131
for _, chartName := range charts {
3232
s.Run(chartName, func() {
@@ -35,7 +35,7 @@ func (s *ss) TestChartTemplateWithDefaultValues() {
3535
s.NoError(err)
3636
defaultValuesFilePath := path.Join(chartDir, "values.yaml")
3737

38-
TestContainerGoldenTestDefaults(s.T(), &TemplateGoldenTest{
38+
runGoldenHelmTest(s.T(), &goldenHelmTest{
3939
ChartPath: chartDirFullPath,
4040
Release: "release-test",
4141
Namespace: "release-helm-namespace",
@@ -47,7 +47,7 @@ func (s *ss) TestChartTemplateWithDefaultValues() {
4747
}
4848
}
4949

50-
func (s *ss) TestChartTemplatesWithCustomValues() {
50+
func (s *helmRepoSuite) TestChartTemplatesWithCustomValues() {
5151
testFiles, err := os.ReadDir("testfiles")
5252
s.NoError(err)
5353

@@ -60,7 +60,7 @@ func (s *ss) TestChartTemplatesWithCustomValues() {
6060
s.NoError(err)
6161

6262
valuesFilePath := path.Join("testfiles", testFile.Name())
63-
TestContainerGoldenTestDefaults(s.T(), &TemplateGoldenTest{
63+
runGoldenHelmTest(s.T(), &goldenHelmTest{
6464
ChartPath: chartDirFullPath,
6565
Release: "release-test",
6666
Namespace: "release-helm-namespace",
@@ -72,7 +72,7 @@ func (s *ss) TestChartTemplatesWithCustomValues() {
7272
}
7373
}
7474

75-
func (s *ss) getChartDirectory(chartName string) string {
75+
func (s *helmRepoSuite) getChartDirectory(chartName string) string {
7676
chartDir := path.Join(chartsRootDir, chartName)
7777
if _, err := os.Stat(path.Join(chartDir, "Chart.yaml")); os.IsNotExist(err) {
7878
// fail the test
@@ -86,8 +86,8 @@ func (s *ss) getChartDirectory(chartName string) string {
8686
return chartDir
8787
}
8888

89-
func (s *ss) getCharts(dir string) []string {
90-
// These charts are the "must" that we will fail the test if they do not exist
89+
func (s *helmRepoSuite) getChartsInDirectory(dir string) []string {
90+
// There's no need to add directories to this list, but this is for extra care, to ensure we don't miss these charts
9191
charts := map[string]struct{}{
9292
"wiz-broker": {},
9393
"wiz-sensor": {},

wiz-admission-controller/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ commonLabels: { } # Labels applied on all the resources (not used for selection)
88

99
# Wiz Service Account used to authenticate to Wiz.
1010
wizApiToken:
11-
clientId: "<insert-client-id>" # Client ID of the Wiz Service Account.
12-
clientToken: "<insert-client-token>" # Client secret of the Wiz Service Account.
11+
clientId: "<required-client-id>" # Client ID of the Wiz Service Account.
12+
clientToken: "<required-client-token>" # Client secret of the Wiz Service Account.
1313
clientEndpoint: "" # Defaults to commercial.
1414
# If `global.isFedRamp` is `true`, this field gets automatically set to `fedramp`.
1515

wiz-kubernetes-connector/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ autoCreateConnector:
7474
proxySidecarPort: 15000
7575

7676
wizApiToken:
77-
clientId: "<insert-client-id>" # Client ID of the Wiz Service Account.
78-
clientToken: "<insert-client-token>" # Client secret of the Wiz Service Account.
77+
clientId: "<required-client-id>" # Client ID of the Wiz Service Account.
78+
clientToken: "<required-client-token>" # Client secret of the Wiz Service Account.
7979
clientEndpoint: "" # Defaults to commercial.
8080
# If `global.isFedRamp` is `true`, this field gets automatically set to `fedramp`.
8181

0 commit comments

Comments
 (0)