@@ -38,7 +38,6 @@ import (
3838 cloudprovidererrors "github.com/kubermatic/machine-controller/pkg/cloudprovider/errors"
3939 "github.com/kubermatic/machine-controller/pkg/cloudprovider/instance"
4040 awstypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/provider/aws/types"
41- "github.com/kubermatic/machine-controller/pkg/cloudprovider/rhsm"
4241 cloudprovidertypes "github.com/kubermatic/machine-controller/pkg/cloudprovider/types"
4342 "github.com/kubermatic/machine-controller/pkg/providerconfig"
4443 providerconfigtypes "github.com/kubermatic/machine-controller/pkg/providerconfig/types"
@@ -146,7 +145,6 @@ type Config struct {
146145 EBSVolumeEncrypted bool
147146 Tags map [string ]string
148147 AssignPublicIP * bool
149- manager rhsm.RedHatSubscriptionManager
150148}
151149
152150type amiFilter struct {
@@ -324,13 +322,7 @@ func (p *provider) getConfig(s v1alpha1.ProviderSpec) (*Config, *providerconfigt
324322 c .Tags = rawConfig .Tags
325323 c .IsSpotInstance = rawConfig .IsSpotInstance
326324 c .AssignPublicIP = rawConfig .AssignPublicIP
327- offlineToken , _ := p .configVarResolver .GetConfigVarStringValueOrEnv (rawConfig .RHSMOfflineToken , "REDHAT_SUBSCRIPTIONS_OFFLINE_TOKEN" )
328- if offlineToken != "" {
329- c .manager , err = rhsm .NewRedHatSubscriptionManager (offlineToken )
330- if err != nil {
331- return nil , nil , nil , fmt .Errorf ("failed to create redhat subscription manager: %v" , err )
332- }
333- }
325+
334326 return & c , & pconfig , & rawConfig , err
335327}
336328
@@ -590,7 +582,7 @@ func (p *provider) Cleanup(machine *v1alpha1.Machine, _ *cloudprovidertypes.Prov
590582 return false , err
591583 }
592584
593- config , pc , _ , err := p .getConfig (machine .Spec .ProviderSpec )
585+ config , _ , _ , err := p .getConfig (machine .Spec .ProviderSpec )
594586 if err != nil {
595587 return false , cloudprovidererrors.TerminalError {
596588 Reason : common .InvalidConfigurationMachineError ,
@@ -614,12 +606,6 @@ func (p *provider) Cleanup(machine *v1alpha1.Machine, _ *cloudprovidertypes.Prov
614606 klog .V (3 ).Infof ("successfully triggered termination of instance %s at aws" , instance .ID ())
615607 }
616608
617- if pc .OperatingSystem == providerconfigtypes .OperatingSystemRHEL && config .manager != nil {
618- if err := config .manager .UnregisterInstance (* instance .instance .PrivateDnsName ); err != nil {
619- return false , fmt .Errorf ("failed delete machine %s subscription: %v" , machine .Name , err )
620- }
621- }
622-
623609 return false , nil
624610}
625611
0 commit comments