Skip to content

Commit

Permalink
feat: add healthcheck for application
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGuo2018 committed Jul 19, 2024
1 parent b291335 commit 94f547d
Show file tree
Hide file tree
Showing 12 changed files with 12,668 additions and 9,432 deletions.
16 changes: 16 additions & 0 deletions api/application/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,22 @@ type AppStatus struct {
// Dryrun result.
// +optional
Manifest string
// The healthStatus for the application
// +optional
HealthStatus string
// lastHealthCheckTime is the last health check time for the application
// +optional
LastHealthCheckTime metav1.Time
// healthCheckDetails is the detail info of last health check result
// +optional
HealthCheckDetails []HealthCheckDetail
}

type HealthCheckDetail struct {
WorkloadType string
WorkloadName string
PodDesiredNum int32
PodReadyNum int32
}

// +genclient
Expand Down
723 changes: 563 additions & 160 deletions api/application/v1/generated.pb.go

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions api/application/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions api/application/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ type AppStatus struct {
// Dryrun result.
// +optional
Manifest string `json:"manifest" protobuf:"bytes,10,opt,name=manifest"`
// The healthStatus for the application
// +optional
HealthStatus string `json:"healthStatus,omitempty" protobuf:"bytes,11,opt,name=healthStatus"`
// lastHealthCheckTime is the last health check time for the application
// +optional
LastHealthCheckTime metav1.Time `json:"lastHealthCheckTime,omitempty" protobuf:"bytes,12,opt,name=lastHealthCheckTime"`
// healthCheckDetails is the detail info of last health check result
// +optional
HealthCheckDetails []HealthCheckDetail `json:"healthCheckDetails" protobuf:"bytes,13,opt,name=healthCheckDetails"`
}

// +genclient
Expand Down Expand Up @@ -258,6 +267,13 @@ const (
// AppPhase indicates the phase of app.
type AppPhase string

type HealthCheckDetail struct {
WorkloadType string `json:"workloadType,omitempty" protobuf:"bytes,1,opt,name=workloadType"`
WorkloadName string `json:"workloadName,omitempty" protobuf:"bytes,2,opt,name=workloadName"`
PodDesiredNum int32 `json:"podDesiredNum,omitempty" protobuf:"varint,3,opt,name=podDesiredNum"`
PodReadyNum int32 `json:"podReadyNum,omitempty" protobuf:"varint,4,opt,name=podReadyNum"`
}

const (
// Installing means the installation for the App is running.
AppPhaseInstalling AppPhase = "Installing"
Expand Down
25 changes: 14 additions & 11 deletions api/application/v1/types_swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions api/application/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions api/application/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions api/application/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 94f547d

Please sign in to comment.