Skip to content

Commit 3de7dd0

Browse files
committed
fix pointer issue for GCE staging support
1 parent afe6c38 commit 3de7dd0

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

9797
func main() {
9898
flag.Parse()
9999
rand.Seed(time.Now().UnixNano())
100+
klog.Infof("Operating compute environment set to: %s and computeEndpoint is set to: %v", computeEnvironment, computeEndpoint)
100101
handle()
101102
os.Exit(0)
102103
}
@@ -225,13 +226,14 @@ func enumFlag(target *gce.Environment, name string, allowedComputeEnvironment []
225226

226227
}
227228

228-
func urlFlag(target *url.URL, name string, usage string) {
229+
func urlFlag(target **url.URL, name string, usage string) {
229230
flag.Func(name, usage, func(flagValue string) error {
230231
computeURL, err := url.ParseRequestURI(flagValue)
231232
if err == nil {
232-
target = computeURL
233+
*target = computeURL
233234
return nil
234235
}
236+
klog.Infof("Error parsing endpoint compute endpoint %v", err)
235237
return err
236238
})
237239
}

0 commit comments

Comments
 (0)