@@ -12,7 +12,6 @@ import (
1212 capg "sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1"
1313 "sigs.k8s.io/controller-runtime/pkg/client"
1414
15- "github.com/openshift/installer/pkg/asset/cluster/metadata"
1615 "github.com/openshift/installer/pkg/asset/cluster/tfvars"
1716 "github.com/openshift/installer/pkg/asset/ignition/bootstrap/gcp"
1817 icgcp "github.com/openshift/installer/pkg/asset/installconfig/gcp"
@@ -31,6 +30,7 @@ var _ clusterapi.PreProvider = (*Provider)(nil)
3130var _ clusterapi.IgnitionProvider = (* Provider )(nil )
3231var _ clusterapi.InfraReadyProvider = (* Provider )(nil )
3332var _ clusterapi.PostProvider = (* Provider )(nil )
33+ var _ clusterapi.BootstrapDestroyer = (* Provider )(nil )
3434
3535// Name returns the name for the platform.
3636func (p Provider ) Name () string {
@@ -220,14 +220,10 @@ func (p Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput)
220220}
221221
222222// DestroyBootstrap destroys the temporary bootstrap resources.
223- func (p Provider ) DestroyBootstrap (dir string ) error {
223+ func (p Provider ) DestroyBootstrap (ctx context. Context , in clusterapi. BootstrapDestroyInput ) error {
224224 logrus .Warnf ("Destroying GCP Bootstrap Resources" )
225- metadata , err := metadata .Load (dir )
226- if err != nil {
227- return err
228- }
229- if err := gcp .DestroyStorage (context .Background (), metadata .ClusterID ); err != nil {
230- return fmt .Errorf ("failed to destroy storage" )
225+ if err := gcp .DestroyStorage (ctx , in .Metadata .InfraID ); err != nil {
226+ return fmt .Errorf ("failed to destroy storage: %w" , err )
231227 }
232228 return nil
233229}
0 commit comments