Skip to content

Commit

Permalink
feat: support Suspended state for MonoVertexRollout
Browse files Browse the repository at this point in the history
Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
  • Loading branch information
dpadhiar committed Oct 29, 2024
1 parent 73fbcc9 commit 86dd27b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local hs = {}
local healthyCondition = {}
local monoVertexPaused = {}

-- check for certain cases of "Progressing"

Expand Down Expand Up @@ -35,6 +36,9 @@ if obj.status.conditions ~= nil then
if condition.type == "ChildResourcesHealthy" then
healthyCondition = condition
end
if condition.type == "MonoVertexPausingOrPaused" then
monoVertexPaused = condition
end
end
end

Expand All @@ -51,6 +55,10 @@ elseif healthyCondition ~= {} and healthyCondition.status == "False" and healthy
hs.status = "Progressing"
hs.message = healthyCondition.message
return hs
elseif (monoVertexPaused ~= {} and monoVertexPaused.status == "True") then
hs.status = "Suspended"
hs.message = monoVertexPaused.message
return hs
elseif healthyCondition ~= {} and healthyCondition.status == "True" and obj.status.phase == "Deployed" then
hs.status = "Healthy"
hs.message = healthyCondition.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ tests:
status: Healthy
message: "Successful"
inputPath: testdata/MonoVertexRollout/healthy.yaml
- healthStatus:
status: Suspended
message: "MonoVertex paused"
inputPath: testdata/MonoVertexRollout/paused.yaml
- healthStatus:
status: Degraded
message: "MonoVertex Failed"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: numaplane.numaproj.io/v1alpha1
kind: MonoVertexRollout
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"lifecycle":{"desiredPhase":"Paused"},"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-java/simple-sink:stable"}}},"source":{"transformer":{"container":{"image":"quay.io/numaio/numaflow-rs/source-transformer-now:stable"}},"udsource":{"container":{"image":"quay.io/numaio/numaflow-java/source-simple-source:stable"}}}}}}}
creationTimestamp: "2024-10-29T20:44:33Z"
finalizers:
- numaplane.numaproj.io/numaplane-controller
generation: 3
name: my-monovertex
namespace: example-namespace
resourceVersion: "295152"
uid: b1bc7ad6-4ffe-44e5-ad1f-57455f96921d
spec:
monoVertex:
metadata: {}
spec:
lifecycle:
desiredPhase: Paused
sink:
udsink:
container:
image: quay.io/numaio/numaflow-java/simple-sink:stable
source:
transformer:
container:
image: quay.io/numaio/numaflow-rs/source-transformer-now:stable
udsource:
container:
image: quay.io/numaio/numaflow-java/source-simple-source:stable
status:
conditions:
- lastTransitionTime: "2024-10-29T20:44:33Z"
message: Successful
observedGeneration: 3
reason: Successful
status: "True"
type: ChildResourceDeployed
- lastTransitionTime: "2024-10-29T20:44:59Z"
message: MonoVertex Pausing - health unknown
observedGeneration: 3
reason: MonoVertexUnknown
status: Unknown
type: ChildResourcesHealthy
- lastTransitionTime: "2024-10-29T20:44:58Z"
message: MonoVertex paused
observedGeneration: 3
reason: MonoVertexPaused
status: "True"
type: MonoVertexPausingOrPaused
message: Deployed
nameCount: 1
observedGeneration: 3
phase: Deployed

0 comments on commit 86dd27b

Please sign in to comment.