@@ -243,7 +243,7 @@ func ReconcileDependencies(ctx context.Context, c client.Client, dependenciesCon
243
243
},
244
244
}
245
245
246
- _ = wait .PollUntilContextTimeout (ctx , 250 * time .Millisecond , 5 * time .Second , true , func (ctx context.Context ) (bool , error ) {
246
+ _ = wait .PollUntilContextTimeout (ctx , 1 * time .Second , 20 * time .Second , true , func (ctx context.Context ) (bool , error ) {
247
247
retryError = nil
248
248
if err := c .Get (ctx , client .ObjectKeyFromObject (availabilityZone ), availabilityZone ); err != nil {
249
249
if ! apierrors .IsNotFound (err ) {
@@ -256,23 +256,24 @@ func ReconcileDependencies(ctx context.Context, c client.Client, dependenciesCon
256
256
}
257
257
log .Info ("Created vm-operator AvailabilityZone" , "AvailabilityZone" , klog .KObj (availabilityZone ))
258
258
}
259
+
260
+ if _ , ok := availabilityZone .Spec .Namespaces [config .Namespace ]; ! ok {
261
+ availabilityZone .Spec .Namespaces [config .Namespace ] = topologyv1.NamespaceInfo {
262
+ PoolMoId : resourcePool .Reference ().Value ,
263
+ FolderMoId : folder .Reference ().Value ,
264
+ }
265
+ if err := c .Update (ctx , availabilityZone ); err != nil {
266
+ retryError = errors .Wrapf (err , "failed to update AvailabilityZone %s" , availabilityZone .Name )
267
+ return false , nil
268
+ }
269
+ log .Info ("Update vm-operator AvailabilityZone" , "AvailabilityZone" , klog .KObj (availabilityZone ))
270
+ }
259
271
return true , nil
260
272
})
261
273
if retryError != nil {
262
274
return retryError
263
275
}
264
276
265
- if _ , ok := availabilityZone .Spec .Namespaces [config .Namespace ]; ! ok {
266
- availabilityZone .Spec .Namespaces [config .Namespace ] = topologyv1.NamespaceInfo {
267
- PoolMoId : resourcePool .Reference ().Value ,
268
- FolderMoId : folder .Reference ().Value ,
269
- }
270
- if err := c .Update (ctx , availabilityZone ); err != nil {
271
- return errors .Wrapf (err , "failed to update AvailabilityZone %s" , availabilityZone .Name )
272
- }
273
- log .Info ("Update vm-operator AvailabilityZone" , "AvailabilityZone" , klog .KObj (availabilityZone ))
274
- }
275
-
276
277
// Create vm-operator Secret in K8s
277
278
// This secret contains credentials to access vCenter the vm-operator acts on.
278
279
secret := & corev1.Secret {
0 commit comments