@@ -30,7 +30,6 @@ import (
30
30
"strings"
31
31
32
32
"github.com/blang/semver/v4"
33
- ignTypes "github.com/coreos/ignition/config/v2_3/types"
34
33
ignV3Types "github.com/coreos/ignition/v2/config/v3_4/types"
35
34
"github.com/go-logr/logr"
36
35
@@ -63,6 +62,7 @@ import (
63
62
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/resourcecontroller"
64
63
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/vpc"
65
64
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/endpoints"
65
+ ignV2Types "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/ignition"
66
66
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/options"
67
67
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/record"
68
68
genUtil "sigs.k8s.io/cluster-api-provider-ibmcloud/util"
@@ -445,13 +445,17 @@ func (m *PowerVSMachineScope) ignitionUserData(userData []byte) ([]byte, error)
445
445
446
446
switch semver .Major {
447
447
case 2 :
448
- ignData := & ignTypes .Config {
449
- Ignition : ignTypes .Ignition {
448
+ ignData := & ignV2Types .Config {
449
+ Ignition : ignV2Types .Ignition {
450
450
Version : semver .String (),
451
- Config : ignTypes.IgnitionConfig {
452
- Append : []ignTypes.ConfigReference {
453
- {
454
- Source : objectURL ,
451
+ Config : ignV2Types.IgnitionConfig {
452
+ Replace : & ignV2Types.ConfigReference {
453
+ Source : objectURL ,
454
+ HTTPHeaders : ignV2Types.HTTPHeaders {
455
+ {
456
+ Name : "Authorization" ,
457
+ Value : token ,
458
+ },
455
459
},
456
460
},
457
461
},
@@ -584,7 +588,7 @@ func (m *PowerVSMachineScope) createCOSClient() (*cos.Service, error) {
584
588
585
589
// GetRawBootstrapDataWithFormat returns the bootstrap data if present.
586
590
func (m * PowerVSMachineScope ) GetRawBootstrapDataWithFormat () ([]byte , string , error ) {
587
- if m .Machine .Spec .Bootstrap .DataSecretName == nil {
591
+ if m .Machine == nil || m . Machine .Spec .Bootstrap .DataSecretName == nil {
588
592
return nil , "" , errors .New ("error retrieving bootstrap data: linked Machine's bootstrap.dataSecretName is nil" )
589
593
}
590
594
@@ -717,7 +721,7 @@ func (m *PowerVSMachineScope) SetHealth(health *models.PVMInstanceHealth) {
717
721
}
718
722
719
723
// SetAddresses will set the addresses for the machine.
720
- func (m * PowerVSMachineScope ) SetAddresses (instance * models.PVMInstance ) {
724
+ func (m * PowerVSMachineScope ) SetAddresses (instance * models.PVMInstance ) { //nolint:gocyclo
721
725
var addresses []corev1.NodeAddress
722
726
// Setting the name of the vm to the InternalDNS and Hostname as the vm uses that as hostname.
723
727
addresses = append (addresses , corev1.NodeAddress {
@@ -910,7 +914,7 @@ func (m *PowerVSMachineScope) GetMachineInternalIP() string {
910
914
}
911
915
912
916
// CreateVPCLoadBalancerPoolMember creates a member in load balaner pool.
913
- func (m * PowerVSMachineScope ) CreateVPCLoadBalancerPoolMember () (* vpcv1.LoadBalancerPoolMember , error ) {
917
+ func (m * PowerVSMachineScope ) CreateVPCLoadBalancerPoolMember () (* vpcv1.LoadBalancerPoolMember , error ) { //nolint:gocyclo
914
918
loadBalancers := make ([]infrav1beta2.VPCLoadBalancerSpec , 0 )
915
919
if len (m .IBMPowerVSCluster .Spec .LoadBalancers ) == 0 {
916
920
loadBalancer := infrav1beta2.VPCLoadBalancerSpec {
0 commit comments