Skip to content

Commit

Permalink
feat: monitor deployed versions of our sandbox operators (#364)
Browse files Browse the repository at this point in the history
* add new `RevisionCheck` subcomponent for host operator and reg service

---------

Co-authored-by: Rajiv Senthilnathan <rajivnathan@gmail.com>
  • Loading branch information
mfrancisc and rajivnathan authored Jun 30, 2023
1 parent 7277430 commit c91909d
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 7 deletions.
35 changes: 30 additions & 5 deletions api/v1alpha1/toolchainstatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ const (
ToolchainStatusComponentsNotReadyReason = "ComponentsNotReady"

// deployment reasons
ToolchainStatusDeploymentReadyReason = "DeploymentReady"
ToolchainStatusDeploymentNotReadyReason = "DeploymentNotReady"
ToolchainStatusDeploymentNotFoundReason = "DeploymentNotFound"
ToolchainStatusDeploymentNotUpToDateReason = "DeploymentNotUpToDate"
ToolchainStatusDeploymentUpToDateReason = "DeploymentIsUpToDate"
ToolchainStatusDeploymentReadyReason = "DeploymentReady"
ToolchainStatusDeploymentNotReadyReason = "DeploymentNotReady"
ToolchainStatusDeploymentNotFoundReason = "DeploymentNotFound"
ToolchainStatusDeploymentNotUpToDateReason = "DeploymentNotUpToDate"
ToolchainStatusDeploymentUpToDateReason = "DeploymentIsUpToDate"
ToolchainStatusDeploymentRevisionCheckDisabledReason = "DeploymentRevisionCheckDisabled"
ToolchainStatusDeploymentRevisionCheckGitHubErrorReason = "DeploymentRevisionCheckGitHubError"
ToolchainStatusDeploymentRevisionCheckOperatorErrorReason = "DeploymentRevisionCheckOperatorError"

// host connection reasons
ToolchainStatusClusterConnectionReadyReason = "HostConnectionReady"
Expand Down Expand Up @@ -161,6 +164,10 @@ type HostOperatorStatus struct {
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

// The status of the revision check for host operator's deployment
// +optional
RevisionCheck RevisionCheck `json:"revisionCheck"`
}

// HostRegistrationServiceStatus defines the observed state of a toolchain's registration service
Expand All @@ -177,6 +184,10 @@ type HostRegistrationServiceStatus struct {

// Health provides health status of the registration service
Health RegistrationServiceHealth `json:"health"`

// The status of the revision check for registration service
// +optional
RevisionCheck RevisionCheck `json:"revisionCheck"`
}

// RegistrationServiceDeploymentStatus contains status of the registration service's deployment
Expand Down Expand Up @@ -245,6 +256,20 @@ type RegistrationServiceResourcesStatus struct {
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

// RevisionCheck contains status of revision check for the component,
// it highlights if the component is up-to-date and the deployed version matches the latest one in the GitHub repository.
// +k8s:openapi-gen=true
type RevisionCheck struct {
// Conditions is an array of status conditions for the health of the registration service
// Supported condition types: ConditionReady
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

Expand Down
24 changes: 24 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

58 changes: 56 additions & 2 deletions api/v1alpha1/zz_generated.openapi.go

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

0 comments on commit c91909d

Please sign in to comment.