Skip to content

Commit

Permalink
set isInternal manually
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Nov 7, 2023
1 parent b936999 commit 3e3c82a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/dinosaur/pkg/gitops/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func validatePatch(path *field.Path, patch string) field.ErrorList {
// tryRenderDummyCentralWithPatch renders a dummy Central instance with the given patch.
// useful to test that a patch is valid.
func tryRenderDummyCentralWithPatch(patch string) error {
var dummyParams = getDummyCentralParams(false)
var dummyParams = getDummyCentralParams()
dummyConfig := Config{
Centrals: CentralsConfig{
Overrides: []CentralOverride{
Expand All @@ -89,7 +89,7 @@ func tryRenderDummyCentralWithPatch(patch string) error {
return nil
}

func getDummyCentralParams(isInternal bool) CentralParams {
func getDummyCentralParams() CentralParams {
return CentralParams{
ID: "id",
Name: "name",
Expand All @@ -106,7 +106,7 @@ func getDummyCentralParams(isInternal bool) CentralParams {
OrganizationID: "organizationId",
OrganizationName: "organizationName",
InstanceType: "instanceType",
IsInternal: isInternal,
IsInternal: false,
}
}

Expand Down
5 changes: 3 additions & 2 deletions internal/dinosaur/pkg/gitops/default_central_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func TestDefaultCentral(t *testing.T) {
p := getDummyCentralParams(false)
p := getDummyCentralParams()
central, err := renderDefaultCentral(p)
assert.NoError(t, err)

Expand Down Expand Up @@ -121,7 +121,8 @@ func TestDefaultCentral(t *testing.T) {
}

func TestInternalCentral(t *testing.T) {
p := getDummyCentralParams(true)
p := getDummyCentralParams()
p.IsInternal = true
central, err := renderDefaultCentral(p)
assert.NoError(t, err)

Expand Down

0 comments on commit 3e3c82a

Please sign in to comment.