Skip to content

Commit

Permalink
make SERVICE_ENDPOINT variable optional (#839)
Browse files Browse the repository at this point in the history
Signed-off-by: Prajyot-Parab <[email protected]>

Signed-off-by: Prajyot-Parab <[email protected]>
Co-authored-by: Prajyot-Parab <[email protected]>
  • Loading branch information
1 parent 8c2810a commit 31edb26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- "--leader-elect"
- "--metrics-bind-addr=127.0.0.1:8080"
- "--powervs-provider-id-fmt=${POWERVS_PROVIDER_ID_FORMAT:=v1}"
- "--service-endpoint=${SERVICE_ENDPOINT:=}"
- "--service-endpoint=${SERVICE_ENDPOINT:=none}"
- "--v=${LOGLEVEL:=0}"
image: controller:latest
name: manager
Expand Down
2 changes: 1 addition & 1 deletion pkg/endpoints/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var (
// ParseServiceEndpointFlag parses the command line flag of service endpoint in the format ${ServiceRegion}:${ServiceID1}=${URL1},${ServiceID2}=${URL2...}
// returning a list of ServiceEndpoint.
func ParseServiceEndpointFlag(serviceEndpoints string) ([]ServiceEndpoint, error) {
if serviceEndpoints == "" {
if serviceEndpoints == "" || serviceEndpoints == "none" {
return nil, nil
}

Expand Down
6 changes: 6 additions & 0 deletions pkg/endpoints/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ func TestParseFlags(t *testing.T) {
expectedOutput: nil,
expectedError: nil,
},
{
name: "none configuration",
flagToParse: "none",
expectedOutput: nil,
expectedError: nil,
},
{
name: "single region, single vpc service",
flagToParse: "eu-gb:vpc=https://vpchost:8080",
Expand Down

0 comments on commit 31edb26

Please sign in to comment.