Skip to content

Commit bc6c343

Browse files
committed
wip: testing, refactoring
1 parent 217f6eb commit bc6c343

File tree

6 files changed

+12
-79
lines changed

6 files changed

+12
-79
lines changed

api/v1beta2/awsmachine_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ type AWSMachineSpec struct {
228228
// +optional
229229
HostID *string `json:"hostID,omitempty"`
230230

231-
// Affinity specifies the dedicated host affinity setting for the instance.
232-
// When affinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
231+
// HostAffinity specifies the dedicated host affinity setting for the instance.
232+
// When hostAffinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
233233
// +optional
234234
// +kubebuilder:validation:Enum:=Default;Host
235235
HostAffinity *string `json:"hostAffinity,omitempty"`

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,8 @@ spec:
688688
type: object
689689
hostAffinity:
690690
description: |-
691-
Affinity specifies the dedicated host affinity setting for the instance.
692-
When affinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
691+
HostAffinity specifies the dedicated host affinity setting for the instance.
692+
When hostAffinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
693693
enum:
694694
- Default
695695
- Host

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ spec:
622622
type: object
623623
hostAffinity:
624624
description: |-
625-
Affinity specifies the dedicated host affinity setting for the instance.
626-
When affinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
625+
HostAffinity specifies the dedicated host affinity setting for the instance.
626+
When hostAffinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
627627
enum:
628628
- Default
629629
- Host

pkg/cloud/services/ec2/instances.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,10 @@ func (s *Service) runInstance(role string, i *infrav1.Instance) (*infrav1.Instan
686686
"hostId", i.HostID,
687687
"affinity", i.HostAffinity)
688688
if input.Placement != nil {
689-
placementStr := input.Placement.GoString()
690689
s.scope.Warn("Placement already set for instance, overwriting with dedicated host placement",
691690
"hostId", i.HostID,
692691
"affinity", i.HostAffinity,
693-
"placement", placementStr)
692+
"placement", input.Placement.GoString())
694693
}
695694

696695
input.Placement = &ec2.Placement{

test/e2e/suites/unmanaged/unmanaged_functional_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,7 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
986986

987987
ginkgo.By("Creating cluster")
988988
clusterName := fmt.Sprintf("%s-%s", specName, util.RandomString(6))
989-
vars := map[string]string{
990-
"HOST_ID": hostID,
991-
"HOST_AFFINITY": "Default",
992-
}
989+
993990
// Create a cluster with a dedicated host
994991
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
995992
ClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
@@ -1004,7 +1001,10 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
10041001
KubernetesVersion: e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion),
10051002
ControlPlaneMachineCount: ptr.To[int64](1),
10061003
WorkerMachineCount: ptr.To[int64](0),
1007-
ClusterctlVariables: vars,
1004+
ClusterctlVariables: map[string]string{
1005+
"HOST_ID": hostID,
1006+
"HOST_AFFINITY": "Default",
1007+
},
10081008
},
10091009
WaitForClusterIntervals: e2eCtx.E2EConfig.GetIntervals(specName, "wait-cluster"),
10101010
WaitForControlPlaneIntervals: e2eCtx.E2EConfig.GetIntervals(specName, "wait-control-plane"),

test/mocks/gomock_reflect_801984041/prog.go

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)