Skip to content

Commit 31edb26

Browse files
make SERVICE_ENDPOINT variable optional (#839)
Signed-off-by: Prajyot-Parab <[email protected]> Signed-off-by: Prajyot-Parab <[email protected]> Co-authored-by: Prajyot-Parab <[email protected]>
1 parent 8c2810a commit 31edb26

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
- "--leader-elect"
3030
- "--metrics-bind-addr=127.0.0.1:8080"
3131
- "--powervs-provider-id-fmt=${POWERVS_PROVIDER_ID_FORMAT:=v1}"
32-
- "--service-endpoint=${SERVICE_ENDPOINT:=}"
32+
- "--service-endpoint=${SERVICE_ENDPOINT:=none}"
3333
- "--v=${LOGLEVEL:=0}"
3434
image: controller:latest
3535
name: manager

pkg/endpoints/endpoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var (
5757
// ParseServiceEndpointFlag parses the command line flag of service endpoint in the format ${ServiceRegion}:${ServiceID1}=${URL1},${ServiceID2}=${URL2...}
5858
// returning a list of ServiceEndpoint.
5959
func ParseServiceEndpointFlag(serviceEndpoints string) ([]ServiceEndpoint, error) {
60-
if serviceEndpoints == "" {
60+
if serviceEndpoints == "" || serviceEndpoints == "none" {
6161
return nil, nil
6262
}
6363

pkg/endpoints/endpoints_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ func TestParseFlags(t *testing.T) {
3535
expectedOutput: nil,
3636
expectedError: nil,
3737
},
38+
{
39+
name: "none configuration",
40+
flagToParse: "none",
41+
expectedOutput: nil,
42+
expectedError: nil,
43+
},
3844
{
3945
name: "single region, single vpc service",
4046
flagToParse: "eu-gb:vpc=https://vpchost:8080",

0 commit comments

Comments
 (0)