Skip to content

Commit 5cf9d52

Browse files
committed
chore(workflow-cli): pts:describe cmd add Startup field and healthchecks usage
1 parent a4a5a28 commit 5cf9d52

4 files changed

Lines changed: 20 additions & 10 deletions

File tree

cmd/pts.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ func printProcessTypeDetail(d *DryccCmd, ptypeStates api.PtypeStates, events api
169169
tpt.Append([]string{"", fmt.Sprintf("%s from %s", mount.MountPath, mount.Name)})
170170
}
171171
}
172+
sp := getHealthcheckString("", "", &containerState.StartupProbe)
173+
if sp != "" {
174+
tpt.Append([]string{"Startup:", strings.TrimSpace(sp)})
175+
}
172176
lp := getHealthcheckString("", "", &containerState.LivenessProbe)
173177
if lp != "" {
174178
tpt.Append([]string{"Liveness:", strings.TrimSpace(lp)})

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ require (
2121
github.com/pmezard/go-difflib v1.0.0 // indirect
2222
golang.org/x/sys v0.18.0 // indirect
2323
)
24+
25+
replace github.com/drycc/controller-sdk-go => github.com/jianxiaoguo/controller-sdk-go v0.0.0-20240711022759-a09abdeedfea

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
66
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
7-
github.com/drycc/controller-sdk-go v0.0.0-20240710072101-82db20de8e4a h1:ETfWMgVW7ZR5PqFwnaCYbZHsejFym/vPdsv5RLTjNkE=
8-
github.com/drycc/controller-sdk-go v0.0.0-20240710072101-82db20de8e4a/go.mod h1:n6eQe1irJqjwLo/7t9+Dhdv6faSESQN+ATnZRBP3/Uc=
97
github.com/drycc/pkg v0.0.0-20240225112316-78fc9239f51f h1:kgjvUQJeAszDoU1Vo4vTTE92KI8Av3JPb6Qn890niXg=
108
github.com/drycc/pkg v0.0.0-20240225112316-78fc9239f51f/go.mod h1:n+QxGif6ha9CEoxVnlipxb9IdmerybcUSzTEDFkvjiA=
119
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
1210
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
11+
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20240711022759-a09abdeedfea h1:okAAbWoGmFBtVwSl451+CHlhRl+sxXQ36wbnPLKMqN8=
12+
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20240711022759-a09abdeedfea/go.mod h1:n6eQe1irJqjwLo/7t9+Dhdv6faSESQN+ATnZRBP3/Uc=
1313
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
1414
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
1515
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=

parser/healthchecks.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ Sets healthchecks for an application.
8282
8383
By default, Workflow only checks that the application starts in their Container. A health
8484
check may be added by configuring a health check probe for the application. The health
85-
checks are implemented as Kubernetes Container Probes. A 'liveness' and a 'readiness'
86-
probe can be configured, and each probe can be of type 'httpGet', 'exec' or 'tcpSocket'
87-
depending on the type of probe the Container requires.
85+
checks are implemented as Kubernetes Container Probes. A 'startupProbe' 'livenessProbe'
86+
and a 'readinessProbe' can be configured, and each probe can be of type 'httpGet', 'exec'
87+
or 'tcpSocket' depending on the type of probe the Container requires.
8888
89-
A 'liveness' probe is useful for applications running for long periods of time, eventually
89+
A 'startupProbe' indicates whether the application within the container is started.
90+
All other probes are disabled if a startup probe is provided, until it succeeds.
91+
If the startup probe fails, the container is subjected to its restart policy.
92+
93+
A 'livenessProbe' is useful for applications running for long periods of time, eventually
9094
transitioning to broken states and cannot recover except by restarting them.
9195
92-
Other times, a 'readiness' probe is useful when the Container is only temporarily unable
93-
to serve, and will recover on its own. In this case, if a Container fails its 'readiness'
94-
probe, the Container will not be shut down, but rather the Container will stop receiving
96+
Other times, a 'readinessProbe' is useful when the Container is only temporarily unable
97+
to serve, and will recover on its own. In this case, if a Container fails its 'readinessProbe'
98+
, the Container will not be shut down, but rather the Container will stop receiving
9599
incoming requests.
96100
97101
'httpGet' probes are just as it sounds: it performs a HTTP GET operation on the Container.
@@ -110,7 +114,7 @@ Usage: drycc healthchecks:set <health-type> <probe-type> [options] [--] <args>..
110114
111115
Arguments:
112116
<health-type>
113-
the healthcheck type, such as 'livenessProbe' or 'readinessProbe'.
117+
the healthcheck type, such as 'startupProbe' 'livenessProbe' or 'readinessProbe'.
114118
<probe-type>
115119
the healthcheck probe type, such as 'httpGet', 'exec' or 'tcpSocket'.
116120
<args>

0 commit comments

Comments
 (0)