@@ -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 {
@@ -224,14 +224,10 @@ func (p Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput)
224224}
225225
226226// DestroyBootstrap destroys the temporary bootstrap resources.
227- func (p Provider ) DestroyBootstrap (dir string ) error {
227+ func (p Provider ) DestroyBootstrap (ctx context. Context , in clusterapi. BootstrapDestroyInput ) error {
228228 logrus .Warnf ("Destroying GCP Bootstrap Resources" )
229- metadata , err := metadata .Load (dir )
230- if err != nil {
231- return err
232- }
233- if err := gcp .DestroyStorage (context .Background (), metadata .ClusterID ); err != nil {
234- return fmt .Errorf ("failed to destroy storage" )
229+ if err := gcp .DestroyStorage (ctx , in .Metadata .InfraID ); err != nil {
230+ return fmt .Errorf ("failed to destroy storage: %w" , err )
235231 }
236232 return nil
237233}
0 commit comments