Skip to content

Commit

Permalink
Remove duplicated import
Browse files Browse the repository at this point in the history
  • Loading branch information
hebelsan committed Oct 21, 2024
1 parent 1e18ab3 commit bcafa8c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions pkg/controller/bastion/vmdetails_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package bastion_test
import (
"slices"

"github.com/gardener/gardener/pkg/apis/core/v1beta1"
core "github.com/gardener/gardener/pkg/apis/core/v1beta1"
. "github.com/gardener/gardener/pkg/utils/test/matchers"
. "github.com/onsi/ginkgo/v2"
Expand All @@ -26,24 +25,24 @@ var _ = Describe("Bastion VM Details", func() {
ImageVersion: "1.2.3",
}
spec = core.CloudProfileSpec{
Bastion: &v1beta1.Bastion{
MachineImage: &v1beta1.BastionMachineImage{
Bastion: &core.Bastion{
MachineImage: &core.BastionMachineImage{
Name: desired.ImageBaseName,
},
MachineType: &v1beta1.BastionMachineType{
MachineType: &core.BastionMachineType{
Name: desired.MachineName,
},
},
MachineTypes: []v1beta1.MachineType{{
MachineTypes: []core.MachineType{{
CPU: resource.MustParse("4"),
Name: desired.MachineName,
Architecture: ptr.To(desired.Architecture),
}},
MachineImages: []v1beta1.MachineImage{{
MachineImages: []core.MachineImage{{
Name: desired.ImageBaseName,
Versions: []v1beta1.MachineImageVersion{
Versions: []core.MachineImageVersion{
{
ExpirableVersion: v1beta1.ExpirableVersion{
ExpirableVersion: core.ExpirableVersion{
Version: desired.ImageVersion,
Classification: ptr.To(core.ClassificationSupported),
},
Expand All @@ -58,8 +57,8 @@ var _ = Describe("Bastion VM Details", func() {
return image.Name == imageName
})

newVersion := v1beta1.MachineImageVersion{
ExpirableVersion: v1beta1.ExpirableVersion{
newVersion := core.MachineImageVersion{
ExpirableVersion: core.ExpirableVersion{
Version: version,
Classification: ptr.To(classification),
},
Expand All @@ -68,9 +67,9 @@ var _ = Describe("Bastion VM Details", func() {

// append new machine image
if machineIndex == -1 {
spec.MachineImages = append(spec.MachineImages, v1beta1.MachineImage{
spec.MachineImages = append(spec.MachineImages, core.MachineImage{
Name: imageName,
Versions: []v1beta1.MachineImageVersion{newVersion},
Versions: []core.MachineImageVersion{newVersion},
})
}

Expand All @@ -86,7 +85,7 @@ var _ = Describe("Bastion VM Details", func() {
})

It("should succeed with empty bastion section", func() {
spec.Bastion = &v1beta1.Bastion{}
spec.Bastion = &core.Bastion{}
details, err := bastion.DetermineVmDetails(spec)
Expect(err).NotTo(HaveOccurred())
Expect(details).To(DeepEqual(desired))
Expand Down Expand Up @@ -141,7 +140,7 @@ var _ = Describe("Bastion VM Details", func() {

It("should find smallest machine", func() {
spec.Bastion.MachineType = nil
spec.MachineTypes = append(spec.MachineTypes, v1beta1.MachineType{
spec.MachineTypes = append(spec.MachineTypes, core.MachineType{
CPU: resource.MustParse("1"),
GPU: resource.MustParse("1"),
Name: "smallerMachine",
Expand Down

0 comments on commit bcafa8c

Please sign in to comment.