Skip to content

Commit

Permalink
revert cbwp export
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenma committed Jul 9, 2024
1 parent 4871d49 commit eb9f53d
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions pkg/controller/direct/cloudbuild/workerpool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,28 +302,7 @@ func (a *Adapter) Update(ctx context.Context, u *unstructured.Unstructured) erro
}

func (a *Adapter) Export(ctx context.Context) (*unstructured.Unstructured, error) {
u := &unstructured.Unstructured{}

apiVersion, kind := krm.GroupVersionKind.ToAPIVersionAndKind()
u.SetAPIVersion(apiVersion)
u.SetKind(kind)

wp := &krm.CloudBuildWorkerPool{}
wp.Spec.DisplayName = a.actual.DisplayName
wp.Spec.ResourceID = &a.actual.Name

mapCtx := &MapContext{}
wp.Spec.PrivatePoolConfig = PrivatePoolV1Config_FromProto(mapCtx, a.actual.GetPrivatePoolV1Config())
if mapCtx.Err() != nil {
return nil, mapCtx.Err()
}

obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(wp)
if err != nil {
return nil, err
}
u.Object = obj
return u, nil
return nil, nil
}

// Delete implements the Adapter interface.
Expand Down

0 comments on commit eb9f53d

Please sign in to comment.