Skip to content

Commit e3bb5ca

Browse files
committed
debug
1 parent 7af9cc3 commit e3bb5ca

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

src/services/gcp/pkg/stub/handler.go

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -158,29 +158,21 @@ func createCluster(cr *v1alpha1.GKECluster, log *logrus.Entry) (*v1alpha1.GKEClu
158158
args = append(args, cr.Spec.MachineType)
159159
}
160160

161-
// if cr.Spec.EnableNetworkPolicy {
162-
// args = append(args, "--enable-network-policy")
163-
// }
164-
165-
args = append(args, "--network=gke-dualstack-network")
166-
args = append(args, "--subnetwork=gke-dualstack-subnet")
167-
args = append(args, "--stack-type=ipv4-ipv6")
168-
args = append(args, "--enable-dataplane-v2")
169-
170-
// if cr.Spec.StackType == "ipv4-ipv6" {
171-
// args = append(args, "--network=gke-dualstack-network")
172-
// args = append(args, "--subnetwork=gke-dualstack-subnet")
173-
// args = append(args, "--stack-type=ipv4-ipv6")
174-
// args = append(args, "--enable-dataplane-v2")
175-
// if cr.Spec.EnableNetworkPolicy {
176-
// for i, v := range args {
177-
// if v == "--enable-network-policy" {
178-
// args = append(args[:i], args[i+1:]...)
179-
// break
180-
// }
181-
// }
182-
// }
183-
// }
161+
if cr.Spec.StackType != "" {
162+
log.Infof("use stack type: %s", cr.Spec.StackType)
163+
if cr.Spec.StackType == "ipv4-ipv6" {
164+
args = append(args, "--network=gke-dualstack-network")
165+
args = append(args, "--subnetwork=gke-dualstack-subnet")
166+
args = append(args, "--stack-type=ipv4-ipv6")
167+
args = append(args, "--enable-dataplane-v2")
168+
log.Infof("enable dualstack network")
169+
}
170+
} else {
171+
if cr.Spec.EnableNetworkPolicy {
172+
args = append(args, "--enable-network-policy")
173+
}
174+
args = append(args, "--create-subnetwork", "")
175+
}
184176

185177
if !cr.Spec.DisableLegacyAuthorization {
186178
args = append(args, "--enable-legacy-authorization")
@@ -228,7 +220,6 @@ func createCluster(cr *v1alpha1.GKECluster, log *logrus.Entry) (*v1alpha1.GKEClu
228220
}
229221

230222
args = append(args, "--enable-ip-alias")
231-
// args = append(args, "--create-subnetwork", "")
232223

233224
if cr.Spec.ClusterCidr == "" {
234225
cr.Spec.ClusterCidr = "/18"

0 commit comments

Comments
 (0)