Skip to content

Commit

Permalink
chore: remove v1alpha5 from disruption controller tests (kubernetes-s…
Browse files Browse the repository at this point in the history
  • Loading branch information
njtran authored Nov 1, 2023
1 parent c3941b2 commit c178881
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 6,184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (
. "github.com/aws/karpenter-core/pkg/test/expectations"
)

var _ = Describe("NodeClaim/Consolidation", func() {
var _ = Describe("Consolidation", func() {
var nodePool *v1beta1.NodePool
var nodeClaim *v1beta1.NodeClaim
var node *v1.Node
Expand Down Expand Up @@ -652,7 +652,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], annotatedNode)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, annotatedNode}, []*v1beta1.NodeClaim{nodeClaim, annotatedNodeClaim})

fakeClock.Step(10 * time.Minute)
Expand All @@ -663,7 +663,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node and replace with a cheaper node
Expand Down Expand Up @@ -729,7 +729,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -740,7 +740,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node and replace with a cheaper node
Expand Down Expand Up @@ -806,7 +806,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -817,7 +817,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node and replace with a cheaper node
Expand Down Expand Up @@ -1389,7 +1389,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -1399,7 +1399,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node
Expand Down Expand Up @@ -1440,7 +1440,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -1450,7 +1450,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node
Expand Down Expand Up @@ -1491,7 +1491,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -1542,7 +1542,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -1552,7 +1552,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim)

// we should delete the non-annotated node
Expand Down Expand Up @@ -1955,7 +1955,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[1], node)
ExpectManualBinding(ctx, env.Client, pods[2], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand All @@ -1965,7 +1965,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectReconcileSucceeded(ctx, disruptionController, client.ObjectKey{})
wg.Wait()

// Cascade any deletion of the machine to the node
// Cascade any deletion of the nodeClaim to the node
ExpectNodeClaimsCascadeDeletion(ctx, env.Client, nodeClaim2)

// we don't need a new node, but we should evict everything off one of node2 which only has a single pod
Expand Down Expand Up @@ -2275,7 +2275,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
// bind pods to node
ExpectManualBinding(ctx, env.Client, pod, node)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node}, []*v1beta1.NodeClaim{nodeClaim})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -2323,7 +2323,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
// bind pods to node
ExpectManualBinding(ctx, env.Client, pod, node)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node}, []*v1beta1.NodeClaim{nodeClaim})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -2371,7 +2371,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
// bind pods to node
ExpectManualBinding(ctx, env.Client, pod, node)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node}, []*v1beta1.NodeClaim{nodeClaim})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -2425,7 +2425,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[0], node)
ExpectManualBinding(ctx, env.Client, pods[1], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -2476,7 +2476,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[0], node)
ExpectManualBinding(ctx, env.Client, pods[1], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand Down Expand Up @@ -2527,7 +2527,7 @@ var _ = Describe("NodeClaim/Consolidation", func() {
ExpectManualBinding(ctx, env.Client, pods[0], node)
ExpectManualBinding(ctx, env.Client, pods[1], node2)

// inform cluster state about nodes and machines
// inform cluster state about nodes and nodeClaims
ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx, env.Client, nodeStateController, nodeClaimStateController, []*v1.Node{node, node2}, []*v1beta1.NodeClaim{nodeClaim, nodeClaim2})

fakeClock.Step(10 * time.Minute)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
. "github.com/aws/karpenter-core/pkg/test/expectations"
)

var _ = Describe("NodeClaim/Drift", func() {
var _ = Describe("Drift", func() {
var nodePool *v1beta1.NodePool
var nodeClaim *v1beta1.NodeClaim
var node *v1.Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
. "github.com/aws/karpenter-core/pkg/test/expectations"
)

var _ = Describe("NodeClaim/Emptiness", func() {
var _ = Describe("Emptiness", func() {
var nodePool *v1beta1.NodePool
var nodeClaim *v1beta1.NodeClaim
var node *v1.Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
. "github.com/aws/karpenter-core/pkg/test/expectations"
)

var _ = Describe("NodeClaim/Expiration", func() {
var _ = Describe("Expiration", func() {
var nodePool *v1beta1.NodePool
var nodeClaim *v1beta1.NodeClaim
var node *v1.Node
Expand Down
Loading

0 comments on commit c178881

Please sign in to comment.