Skip to content

Commit 5215779

Browse files
committed
fix pointer issue for GCE staging support
1 parent 1726be9 commit 5215779

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
@@ -87,14 +87,15 @@ func init() {
8787
// Use V(5) for GCE Cloud Provider Call informational logging
8888
// Use V(6) for extra repeated/polling information
8989
enumFlag(&computeEnvironment, "compute-environment", allowedComputeEnvironment, "Operating compute environment")
90-
urlFlag(computeEndpoint, "compute-endpoint", "Compute endpoint")
90+
urlFlag(&computeEndpoint, "compute-endpoint", "Compute endpoint")
9191
klog.InitFlags(flag.CommandLine)
9292
flag.Set("logtostderr", "true")
9393
}
9494

9595
func main() {
9696
flag.Parse()
9797
rand.Seed(time.Now().UnixNano())
98+
klog.Infof("Operating compute environment set to: %s and computeEndpoint is set to: %v", computeEnvironment, computeEndpoint)
9899
handle()
99100
os.Exit(0)
100101
}
@@ -207,13 +208,14 @@ func enumFlag(target *gce.Environment, name string, allowedComputeEnvironment []
207208

208209
}
209210

210-
func urlFlag(target *url.URL, name string, usage string) {
211+
func urlFlag(target **url.URL, name string, usage string) {
211212
flag.Func(name, usage, func(flagValue string) error {
212213
computeURL, err := url.ParseRequestURI(flagValue)
213214
if err == nil {
214-
target = computeURL
215+
*target = computeURL
215216
return nil
216217
}
218+
klog.Infof("Error parsing endpoint compute endpoint %v", err)
217219
return err
218220
})
219221
}

0 commit comments

Comments
 (0)