Skip to content

Commit

Permalink
Merge pull request #107 from gianlucam76/notification-summary-per-clu…
Browse files Browse the repository at this point in the history
…ster

Make NotificationSummaries per cluster
  • Loading branch information
gianlucam76 authored Feb 15, 2023
2 parents 036ed5b + 0e289df commit f3b22a1
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 63 deletions.
12 changes: 6 additions & 6 deletions api/v1alpha1/clusterhealthcheck_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ type ClusterCondition struct {
// Cluster conditions.
// +optional
Conditions []Condition `json:"conditions,omitempty"`

// NotificationSummaries contains status information on notifications
// +optional
NotificationSummaries []NotificationSummary `json:"notificationSummaries,omitempty"`
}

// Event specifies different type of liveness checks
Expand Down Expand Up @@ -184,14 +188,10 @@ type ClusterHealthCheckStatus struct {
// ClusterHealthCheck ClusterSelector
MatchingClusterRefs []corev1.ObjectReference `json:"matchingClusters,omitempty"`

// ClusterConditions contains conditions for all clusters matching
// ClusterHealthCheck instance
// ClusterConditions contains conditions and notification status for all clusters
// matching ClusterHealthCheck instance
// +optional
ClusterConditions []ClusterCondition `json:"clusterCondition,omitempty"`

// NotificationSummaries contains status information on notifications
// +optional
NotificationSummaries []NotificationSummary `json:"notificationSummaries,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
14 changes: 7 additions & 7 deletions api/v1alpha1/zz_generated.deepcopy.go

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

51 changes: 26 additions & 25 deletions config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ spec:
status:
properties:
clusterCondition:
description: ClusterConditions contains conditions for all clusters
matching ClusterHealthCheck instance
description: ClusterConditions contains conditions and notification
status for all clusters matching ClusterHealthCheck instance
items:
properties:
clusterInfo:
Expand Down Expand Up @@ -270,6 +270,30 @@ spec:
- type
type: object
type: array
notificationSummaries:
description: NotificationSummaries contains status information
on notifications
items:
properties:
failureMessage:
description: FailureMessage is a human consumable message
explaining the misconfiguration
type: string
name:
description: Name of the notification check.
type: string
status:
description: NotificationStatus specifies the notification
status
enum:
- Delivered
- FailedToDeliver
type: string
required:
- name
- status
type: object
type: array
required:
- clusterInfo
type: object
Expand Down Expand Up @@ -338,29 +362,6 @@ spec:
type: string
type: object
type: array
notificationSummaries:
description: NotificationSummaries contains status information on
notifications
items:
properties:
failureMessage:
description: FailureMessage is a human consumable message explaining
the misconfiguration
type: string
name:
description: Name of the notification check.
type: string
status:
description: NotificationStatus specifies the notification status
enum:
- Delivered
- FailedToDeliver
type: string
required:
- name
- status
type: object
type: array
type: object
type: object
served: true
Expand Down
51 changes: 26 additions & 25 deletions lib/crd/clusterhealthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ spec:
status:
properties:
clusterCondition:
description: ClusterConditions contains conditions for all clusters
matching ClusterHealthCheck instance
description: ClusterConditions contains conditions and notification
status for all clusters matching ClusterHealthCheck instance
items:
properties:
clusterInfo:
Expand Down Expand Up @@ -289,6 +289,30 @@ spec:
- type
type: object
type: array
notificationSummaries:
description: NotificationSummaries contains status information
on notifications
items:
properties:
failureMessage:
description: FailureMessage is a human consumable message
explaining the misconfiguration
type: string
name:
description: Name of the notification check.
type: string
status:
description: NotificationStatus specifies the notification
status
enum:
- Delivered
- FailedToDeliver
type: string
required:
- name
- status
type: object
type: array
required:
- clusterInfo
type: object
Expand Down Expand Up @@ -357,29 +381,6 @@ spec:
type: string
type: object
type: array
notificationSummaries:
description: NotificationSummaries contains status information on
notifications
items:
properties:
failureMessage:
description: FailureMessage is a human consumable message explaining
the misconfiguration
type: string
name:
description: Name of the notification check.
type: string
status:
description: NotificationStatus specifies the notification status
enum:
- Delivered
- FailedToDeliver
type: string
required:
- name
- status
type: object
type: array
type: object
type: object
served: true
Expand Down

0 comments on commit f3b22a1

Please sign in to comment.