Skip to content

Commit 94f547d

Browse files
committed
feat: add healthcheck for application
1 parent b291335 commit 94f547d

File tree

12 files changed

+12668
-9432
lines changed

12 files changed

+12668
-9432
lines changed

api/application/types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,22 @@ type AppStatus struct {
152152
// Dryrun result.
153153
// +optional
154154
Manifest string
155+
// The healthStatus for the application
156+
// +optional
157+
HealthStatus string
158+
// lastHealthCheckTime is the last health check time for the application
159+
// +optional
160+
LastHealthCheckTime metav1.Time
161+
// healthCheckDetails is the detail info of last health check result
162+
// +optional
163+
HealthCheckDetails []HealthCheckDetail
164+
}
165+
166+
type HealthCheckDetail struct {
167+
WorkloadType string
168+
WorkloadName string
169+
PodDesiredNum int32
170+
PodReadyNum int32
155171
}
156172

157173
// +genclient

api/application/v1/generated.pb.go

Lines changed: 563 additions & 160 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/application/v1/generated.proto

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/application/v1/types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,15 @@ type AppStatus struct {
152152
// Dryrun result.
153153
// +optional
154154
Manifest string `json:"manifest" protobuf:"bytes,10,opt,name=manifest"`
155+
// The healthStatus for the application
156+
// +optional
157+
HealthStatus string `json:"healthStatus,omitempty" protobuf:"bytes,11,opt,name=healthStatus"`
158+
// lastHealthCheckTime is the last health check time for the application
159+
// +optional
160+
LastHealthCheckTime metav1.Time `json:"lastHealthCheckTime,omitempty" protobuf:"bytes,12,opt,name=lastHealthCheckTime"`
161+
// healthCheckDetails is the detail info of last health check result
162+
// +optional
163+
HealthCheckDetails []HealthCheckDetail `json:"healthCheckDetails" protobuf:"bytes,13,opt,name=healthCheckDetails"`
155164
}
156165

157166
// +genclient
@@ -258,6 +267,13 @@ const (
258267
// AppPhase indicates the phase of app.
259268
type AppPhase string
260269

270+
type HealthCheckDetail struct {
271+
WorkloadType string `json:"workloadType,omitempty" protobuf:"bytes,1,opt,name=workloadType"`
272+
WorkloadName string `json:"workloadName,omitempty" protobuf:"bytes,2,opt,name=workloadName"`
273+
PodDesiredNum int32 `json:"podDesiredNum,omitempty" protobuf:"varint,3,opt,name=podDesiredNum"`
274+
PodReadyNum int32 `json:"podReadyNum,omitempty" protobuf:"varint,4,opt,name=podReadyNum"`
275+
}
276+
261277
const (
262278
// Installing means the installation for the App is running.
263279
AppPhaseInstalling AppPhase = "Installing"

api/application/v1/types_swagger_doc_generated.go

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/application/v1/zz_generated.conversion.go

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/application/v1/zz_generated.deepcopy.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/application/zz_generated.deepcopy.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)