Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/metal3-io/cluster-api-provider-metal3/api v1.8.6
github.com/onsi/ginkgo/v2 v2.22.2
github.com/onsi/gomega v1.36.2
github.com/openshift/api v0.0.0-20250320170726-75d64d71980b
github.com/openshift/api v0.0.0-20250619092108-ef565c20f0d5
github.com/openshift/client-go v0.0.0-20250131180035-f7ec47e2d87a
github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20250522061819-de750d3ea50f
github.com/openshift/library-go v0.0.0-20250527100820-96e64a9a7065
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
github.com/openshift/api v0.0.0-20250320170726-75d64d71980b h1:GGuFSHESP0BSOu70AqV4u9IVrjYdaeu4Id+HXRIOvkw=
github.com/openshift/api v0.0.0-20250320170726-75d64d71980b/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/openshift/api v0.0.0-20250619092108-ef565c20f0d5 h1:vVxtTVqxh+Q1C5Iy4ZNoZ1OxZMuuEP387Fb4u6Ma95w=
github.com/openshift/api v0.0.0-20250619092108-ef565c20f0d5/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/openshift/client-go v0.0.0-20250131180035-f7ec47e2d87a h1:duO3JMrUOqVx50QhzxvDeOYIwTNOB8/EEuRLPyvAMBg=
github.com/openshift/client-go v0.0.0-20250131180035-f7ec47e2d87a/go.mod h1:Qw3ThpzVZ0bfTILpBNYg4LGyjtNxfyCiGh/uDLOOTP8=
github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20250522061819-de750d3ea50f h1:z2G4NSlX4+5yYfjL3h6PtoLfGiCwxJBU/jShSzdxd0E=
Expand Down
7 changes: 3 additions & 4 deletions pkg/conversion/capi2mapi/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,9 @@ func convertAWSVolumesToMAPI(rootVolume *awsv1.Volume, nonRootVolumes []awsv1.Vo
func convertAWSVolumeToMAPI(volume awsv1.Volume) mapiv1.BlockDeviceMappingSpec {
bdm := mapiv1.BlockDeviceMappingSpec{
EBS: &mapiv1.EBSBlockDeviceSpec{
DeleteOnTermination: ptr.To(true), // This is forced to true for now as CAPI doesn't support changing it.
VolumeSize: ptr.To(volume.Size),
Encrypted: volume.Encrypted,
KMSKey: convertAWSKMSKeyToMAPI(volume.EncryptionKey),
VolumeSize: ptr.To(volume.Size),
Encrypted: volume.Encrypted,
KMSKey: convertAWSKMSKeyToMAPI(volume.EncryptionKey),
},
}

Expand Down
13 changes: 3 additions & 10 deletions pkg/conversion/mapi2capi/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ func convertAWSBlockDeviceMappingSpecToCAPI(fldPath *field.Path, mapiBlockDevice
}

if mapping.DeviceName == nil {
volume, warn, err := blockDeviceMappingSpecToVolume(fldPath.Index(i), mapping, true)
volume, warn, err := blockDeviceMappingSpecToVolume(fldPath.Index(i), mapping)
errs = append(errs, err...)
warnings = append(warnings, warn...)

Expand All @@ -520,7 +520,7 @@ func convertAWSBlockDeviceMappingSpecToCAPI(fldPath *field.Path, mapiBlockDevice
continue
}

volume, warn, err := blockDeviceMappingSpecToVolume(fldPath.Index(i), mapping, false)
volume, warn, err := blockDeviceMappingSpecToVolume(fldPath.Index(i), mapping)
errs = append(errs, err...)
warnings = append(warnings, warn...)

Expand All @@ -530,7 +530,7 @@ func convertAWSBlockDeviceMappingSpecToCAPI(fldPath *field.Path, mapiBlockDevice
return rootVolume, nonRootVolumes, warnings, errs
}

func blockDeviceMappingSpecToVolume(fldPath *field.Path, bdm mapiv1.BlockDeviceMappingSpec, rootVolume bool) (awsv1.Volume, []string, field.ErrorList) {
func blockDeviceMappingSpecToVolume(fldPath *field.Path, bdm mapiv1.BlockDeviceMappingSpec) (awsv1.Volume, []string, field.ErrorList) {
errs := field.ErrorList{}
warnings := []string{}

Expand All @@ -540,13 +540,6 @@ func blockDeviceMappingSpecToVolume(fldPath *field.Path, bdm mapiv1.BlockDeviceM

capiKMSKey := convertKMSKeyToCAPI(bdm.EBS.KMSKey)

if rootVolume && !ptr.Deref(bdm.EBS.DeleteOnTermination, true) {
warnings = append(warnings, field.Invalid(fldPath.Child("ebs", "deleteOnTermination"), bdm.EBS.DeleteOnTermination, "root volume must be deleted on termination, ignoring invalid value false").Error())
} else if !rootVolume && !ptr.Deref(bdm.EBS.DeleteOnTermination, true) {
// TODO(OCPCLOUD-2717): We should support a non-true value for non-root volumes for feature parity.
errs = append(errs, field.Invalid(fldPath.Child("ebs", "deleteOnTermination"), bdm.EBS.DeleteOnTermination, "non-root volumes must be deleted on termination, unsupported value false"))
}

if len(errs) > 0 {
return awsv1.Volume{}, warnings, errs
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/conversion/mapi2capi/aws_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ func awsProviderSpecFuzzerFuncs(codecs runtimeserializer.CodecFactory) []interfa
ebs.VolumeSize = ptr.To(c.Int63())
}

// Force DeleteOnTermination to be true.
ebs.DeleteOnTermination = ptr.To(true)

// Clear pointers to empty fields.
if ebs.VolumeType != nil && *ebs.VolumeType == "" {
ebs.VolumeType = nil
Expand Down
40 changes: 0 additions & 40 deletions pkg/conversion/mapi2capi/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,6 @@ var _ = Describe("mapi2capi AWS conversion", func() {
expectedErrors: []string{}, // No error is expected anymore, because volumeSize is now set to a default amount if nil.
expectedWarnings: []string{},
}),
Entry("With non-root Volume not deleted on termination", awsMAPI2CAPIConversionInput{
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
awsBaseProviderSpec.WithBlockDevices([]mapiv1.BlockDeviceMappingSpec{{
DeviceName: ptr.To("/dev/sdb"),
EBS: &mapiv1.EBSBlockDeviceSpec{VolumeSize: ptr.To(int64(10)), DeleteOnTermination: ptr.To(false)},
}}),
),
infra: infra,
expectedErrors: []string{
"spec.providerSpec.value.blockDevices[0].ebs.deleteOnTermination: Invalid value: false: non-root volumes must be deleted on termination, unsupported value false",
},
expectedWarnings: []string{},
}),
Entry("With NoDevice specified", awsMAPI2CAPIConversionInput{
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
awsBaseProviderSpec.WithBlockDevices([]mapiv1.BlockDeviceMappingSpec{{
Expand Down Expand Up @@ -276,21 +263,6 @@ var _ = Describe("mapi2capi AWS conversion", func() {
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: \"null\": missing ebs configuration for block device",
},
}),
Entry("With VirtualName specified and root Volume not deleted on termination", awsMAPI2CAPIConversionInput{
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
awsBaseProviderSpec.WithBlockDevices([]mapiv1.BlockDeviceMappingSpec{{
VirtualName: testValue,
EBS: &mapiv1.EBSBlockDeviceSpec{VolumeSize: ptr.To(int64(10)), DeleteOnTermination: ptr.To(false)},
}}),
),
infra: infra,
expectedErrors: []string{
"spec.providerSpec.value.blockDevices[0].virtualName: Invalid value: \"test\": virtualName is not supported",
},
expectedWarnings: []string{
"spec.providerSpec.value.blockDevices[0].ebs.deleteOnTermination: Invalid value: false: root volume must be deleted on termination, ignoring invalid value false",
},
}),
// Double Errors.
Entry("With NoDevice and VirtualName specified", awsMAPI2CAPIConversionInput{
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
Expand Down Expand Up @@ -319,18 +291,6 @@ var _ = Describe("mapi2capi AWS conversion", func() {
"spec.providerSpec.value.blockDevices[0].ebs: Invalid value: \"null\": missing ebs configuration for block device",
},
}),
Entry("With root Volume not deleted on termination", awsMAPI2CAPIConversionInput{
machineBuilder: awsMAPIMachineBase.WithProviderSpecBuilder(
awsBaseProviderSpec.WithBlockDevices([]mapiv1.BlockDeviceMappingSpec{{
EBS: &mapiv1.EBSBlockDeviceSpec{VolumeSize: ptr.To(int64(10)), DeleteOnTermination: ptr.To(false)},
}}),
),
infra: infra,
expectedErrors: []string{},
expectedWarnings: []string{
"spec.providerSpec.value.blockDevices[0].ebs.deleteOnTermination: Invalid value: false: root volume must be deleted on termination, ignoring invalid value false",
},
}),
)

var _ = DescribeTable("mapi2capi AWS convert MAPI MachineSet",
Expand Down
7 changes: 4 additions & 3 deletions vendor/github.com/openshift/api/.golangci.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/openshift/api/Dockerfile.ocp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/openshift/api/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/openshift/api/config/install.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion vendor/github.com/openshift/api/config/v1/types_apiserver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading