@@ -9,19 +9,13 @@ import (
99
1010 "github.com/pkg/errors"
1111 "github.com/sirupsen/logrus"
12- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13- clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
14- "sigs.k8s.io/controller-runtime/pkg/client"
1512
1613 configv1 "github.com/openshift/api/config/v1"
1714 "github.com/openshift/installer/pkg/asset/cluster/metadata"
1815 openstackasset "github.com/openshift/installer/pkg/asset/cluster/openstack"
19- "github.com/openshift/installer/pkg/asset/manifests/capiutils"
20- "github.com/openshift/installer/pkg/clusterapi"
2116 osp "github.com/openshift/installer/pkg/destroy/openstack"
2217 infra "github.com/openshift/installer/pkg/infrastructure/platform"
2318 ibmcloudtfvars "github.com/openshift/installer/pkg/tfvars/ibmcloud"
24- "github.com/openshift/installer/pkg/types"
2519 typesazure "github.com/openshift/installer/pkg/types/azure"
2620 "github.com/openshift/installer/pkg/types/featuregates"
2721 ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
@@ -35,10 +29,6 @@ func Destroy(ctx context.Context, dir string) (err error) {
3529 return err
3630 }
3731
38- if sys := clusterapi .System (); sys .State () == clusterapi .SystemStateRunning {
39- return destroyBoostrapMachine (ctx , sys .Client (), metadata )
40- }
41-
4232 platform := metadata .Platform ()
4333 if platform == "" {
4434 return errors .New ("no platform configured in metadata" )
@@ -92,15 +82,3 @@ func Destroy(ctx context.Context, dir string) (err error) {
9282
9383 return nil
9484}
95-
96- func destroyBoostrapMachine (ctx context.Context , c client.Client , metadata * types.ClusterMetadata ) error {
97- if err := c .Delete (ctx , & clusterv1.Machine {
98- ObjectMeta : metav1.ObjectMeta {
99- Name : capiutils .GenerateBoostrapMachineName (metadata .InfraID ),
100- Namespace : capiutils .Namespace ,
101- },
102- }); client .IgnoreNotFound (err ) != nil {
103- return fmt .Errorf ("failed to delete bootstrap machine: %w" , err )
104- }
105- return nil
106- }
0 commit comments