Skip to content

Commit 55091b9

Browse files
authored
Merge pull request #1609 from Sneha-at/add_staging_support
fix pointer issue for GCE staging support
2 parents 36edaac + 3de7dd0 commit 55091b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/gce-pd-csi-driver/main.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ func init() {
9393
// Use V(5) for GCE Cloud Provider Call informational logging
9494
// Use V(6) for extra repeated/polling information
9595
enumFlag(&computeEnvironment, "compute-environment", allowedComputeEnvironment, "Operating compute environment")
96-
urlFlag(computeEndpoint, "compute-endpoint", "Compute endpoint")
96+
urlFlag(&computeEndpoint, "compute-endpoint", "Compute endpoint")
9797
klog.InitFlags(flag.CommandLine)
9898
flag.Set("logtostderr", "true")
9999
}
100100

101101
func main() {
102102
flag.Parse()
103103
rand.Seed(time.Now().UnixNano())
104+
klog.Infof("Operating compute environment set to: %s and computeEndpoint is set to: %v", computeEnvironment, computeEndpoint)
104105
handle()
105106
os.Exit(0)
106107
}
@@ -236,13 +237,14 @@ func enumFlag(target *gce.Environment, name string, allowedComputeEnvironment []
236237

237238
}
238239

239-
func urlFlag(target *url.URL, name string, usage string) {
240+
func urlFlag(target **url.URL, name string, usage string) {
240241
flag.Func(name, usage, func(flagValue string) error {
241242
computeURL, err := url.ParseRequestURI(flagValue)
242243
if err == nil {
243-
target = computeURL
244+
*target = computeURL
244245
return nil
245246
}
247+
klog.Infof("Error parsing endpoint compute endpoint %v", err)
246248
return err
247249
})
248250
}

0 commit comments

Comments
 (0)