Skip to content

Commit ed8f88e

Browse files
authored
fix: clarify state node logging (#1766)
1 parent 402e477 commit ed8f88e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controllers/disruption/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ var _ = Describe("Candidate Filtering", func() {
15271527
Expect(cluster.Nodes()).To(HaveLen(1))
15281528
_, err := disruption.NewCandidate(ctx, env.Client, recorder, fakeClock, cluster.Nodes()[0], pdbLimits, nodePoolMap, nodePoolInstanceTypeMap, queue, disruption.GracefulDisruptionClass)
15291529
Expect(err).To(HaveOccurred())
1530-
Expect(err.Error()).To(Equal("state node does not have a nodeclaim representation"))
1530+
Expect(err.Error()).To(Equal("node is not managed by karpenter"))
15311531
})
15321532
It("should not consider candidate that has just a NodeClaim representation", func() {
15331533
nodeClaim, _ := test.NodeClaimAndNode(v1.NodeClaim{
@@ -1546,7 +1546,7 @@ var _ = Describe("Candidate Filtering", func() {
15461546
Expect(cluster.Nodes()).To(HaveLen(1))
15471547
_, err := disruption.NewCandidate(ctx, env.Client, recorder, fakeClock, cluster.Nodes()[0], pdbLimits, nodePoolMap, nodePoolInstanceTypeMap, queue, disruption.GracefulDisruptionClass)
15481548
Expect(err).To(HaveOccurred())
1549-
Expect(err.Error()).To(Equal("state node does not have a node representation"))
1549+
Expect(err.Error()).To(Equal("nodeclaim does not have an associated node"))
15501550
})
15511551
It("should not consider candidates that are nominated", func() {
15521552
nodeClaim, node := test.NodeClaimAndNode(v1.NodeClaim{

pkg/controllers/state/statenode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ func (in *StateNode) Pods(ctx context.Context, kubeClient client.Client) ([]*cor
175175
//nolint:gocyclo
176176
func (in *StateNode) ValidateNodeDisruptable(ctx context.Context, kubeClient client.Client) error {
177177
if in.NodeClaim == nil {
178-
return fmt.Errorf("state node does not have a nodeclaim representation")
178+
return fmt.Errorf("node is not managed by karpenter")
179179
}
180180
if in.Node == nil {
181-
return fmt.Errorf("state node does not have a node representation")
181+
return fmt.Errorf("nodeclaim does not have an associated node")
182182
}
183183
if !in.Initialized() {
184184
return fmt.Errorf("state node isn't initialized")

0 commit comments

Comments
 (0)