Skip to content

Commit

Permalink
tests passing
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Sep 18, 2024
1 parent 301780c commit 80dded7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
6 changes: 5 additions & 1 deletion src/internal/bigbang/bigbang.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ func createBBManifests(ctx context.Context, airgap bool, manifestDir string, val
}

if spec, ok := helmReleaseObj["spec"].(map[string]interface{}); ok {
spec["valuesFrom"] = hrValues
if len(hrValues) > 0 {
spec["valuesFrom"] = hrValues
} else {
delete(spec, "valuesFrom")
}
} else {
return v1alpha1.ZarfManifest{}, errors.New("unable to find spec in helmrelease.yaml")
}
Expand Down
20 changes: 10 additions & 10 deletions src/internal/bigbang/bigbang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,28 @@ func TestAddBigBangManifests(t *testing.T) {
expectedFiles []string
}{
{
name: "Airgap true",
airgap: true,
name: "Airgap false",
airgap: false,
valuesFiles: []string{},
version: "2.35.0",
repo: "https://repo1.dso.mil/big-bang/bigbang",
expectedFiles: []string{
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-gitrepository.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-zarf-credentials.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-helmrelease.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-false", "bb-gitrepository.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-false", "bb-helmrelease.yaml"),
},
},
{
name: "Airgap false with values files and v2beta1 version",
airgap: false,
name: "Airgap true with values files and v2beta1 version",
airgap: true,
valuesFiles: []string{
filepath.Join("testdata", "addBBManifests", "airgap-false", "neuvector.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "neuvector.yaml"),
},
version: "2.0.0",
repo: "https://repo1.dso.mil/big-bang/bigbang",
expectedFiles: []string{
filepath.Join("testdata", "addBBManifests", "airgap-false", "bb-gitrepository.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-false", "bb-helmrelease.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-gitrepository.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-helmrelease.yaml"),
filepath.Join("testdata", "addBBManifests", "airgap-true", "bb-zarf-credentials.yaml"),
},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: bigbang
Expand All @@ -11,4 +11,4 @@ spec:
interval: 10m
url: https://repo1.dso.mil/big-bang/bigbang.git
ref:
tag: 2.0.0
tag: 2.35.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: bigbang
Expand All @@ -25,6 +25,3 @@ spec:
remediation:
remediateLastFailure: true
retries: 5
valuesFrom:
- kind: Secret
name: bb-secret
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: bigbang
Expand All @@ -11,4 +11,4 @@ spec:
interval: 10m
url: https://repo1.dso.mil/big-bang/bigbang.git
ref:
tag: 2.35.0
tag: 2.0.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: bigbang
Expand Down Expand Up @@ -28,3 +28,5 @@ spec:
valuesFrom:
- kind: Secret
name: zarf-credentials
- kind: Secret
name: bb-secret

0 comments on commit 80dded7

Please sign in to comment.