Skip to content

Commit

Permalink
add one more test case
Browse files Browse the repository at this point in the history
Signed-off-by: Marius Kimmina <marius@adjoe.io>
  • Loading branch information
mariuskimmina committed Oct 21, 2024
1 parent 422151e commit 688404d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/v1/nodeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type NodeClaimSpec struct {
// +kubebuilder:validation:Schemaless
// +optional
ExpireAfter NillableDuration `json:"expireAfter,omitempty"`
// unreachableTimeout is the duration the controller will wait
// UnreachableTimeout is the duration the controller will wait
// before terminating a node, measured from when the node is tainted unreachable
// +kubebuilder:default:="Never"
// +kubebuilder:validation:Pattern=`^(([0-9]+(s|m|h))+)|(Never)$`
Expand Down
6 changes: 6 additions & 0 deletions pkg/controllers/nodeclaim/notready/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@ var _ = Describe("NotReady", func() {
ExpectObjectReconciled(ctx, env.Client, notReadyController, nodeClaim)
nodeClaim = ExpectExists(ctx, env.Client, nodeClaim)
})
It("should not remove the NodeClaim when UnreachableTimeout is disabled", func() {
nodeClaim.Spec.ExpireAfter = v1.MustParseNillableDuration("Never")
ExpectApplied(ctx, env.Client, nodeClaim)
ExpectObjectReconciled(ctx, env.Client, notReadyController, nodeClaim)
nodeClaim = ExpectExists(ctx, env.Client, nodeClaim)
})
})

0 comments on commit 688404d

Please sign in to comment.