Skip to content

Commit

Permalink
Update descriptions for the applicationsetreport CRDs
Browse files Browse the repository at this point in the history
Signed-off-by: philipwu08 <phwu@redhat.com>
  • Loading branch information
philipwu08 authored and xiangjingli committed Jun 14, 2024
1 parent e5ba7b4 commit ae37dc5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
controller-gen.kubebuilder.io/version: v0.6.0
creationTimestamp: null
name: multiclusterapplicationsetreports.apps.open-cluster-management.io
spec:
Expand All @@ -21,8 +22,12 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MulticlusterApplicationSetReport is the Schema for the MulticlusterApplicationSetReport
API.
description: MulticlusterApplicationSetReport provides a report of the status
of an application from all the managed clusters where the application is
deployed on. It provides a summary of the number of clusters in the various
states. If an error or warning occurred when installing the application
on a managed cluster, the conditions, including the waring and error message,
is captured in the report.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -38,36 +43,41 @@ spec:
type: object
statuses:
description: AppConditions defines all the error/warning conditions in
all clusters per application
all clusters where a particular application is deployed.
properties:
clusterConditions:
items:
description: ClusterCondition defines all the error/warning conditions
in one cluster per application
in one cluster for an application.
properties:
app:
type: string
cluster:
type: string
conditions:
items:
description: Condition defines a type of error/warning
properties:
message:
description: Message is the warning/error message associated
with this condition.
type: string
type:
description: Type identifies if the condition is a warning
or an error.
type: string
type: object
type: array
healthStatus:
type: string
syncStatus:
type: string
app:
type: string
type: object
type: array
resources:
items:
description: ResourceRef defines a kind of resource
description: ResourceRef identifies the resource that is deployed
by the application.
properties:
apiVersion:
type: string
Expand All @@ -80,27 +90,31 @@ spec:
type: object
type: array
summary:
description: Summary provides a summary of results
description: 'ReportSummary provides a summary by providing a count
of the total number of clusters where the application is deployed.
It also provides a count of how many clusters where an application
are in the following states: synced, notSynced, healthy, notHealthy,
and inProgress.'
properties:
clusters:
description: Clusters provides the count of all managed clusters
the application is deployed to
the application is deployed.
type: string
healthy:
description: Healthy provides the count of healthy applications
description: Healthy provides the count of healthy applications.
type: string
inProgress:
description: InProgress provides the count of applications that
are in the process of being deployed
are in the process of being deployed.
type: string
notHealthy:
description: NotHealthy provides the count of non-healthy applications
description: NotHealthy provides the count of non-healthy applications.
type: string
notSynced:
description: NotSynced provides the count of the out of sync applications
description: NotSynced provides the count of the out of sync applications.
type: string
synced:
description: Synced provides the count of synced applications
description: Synced provides the count of synced applications.
type: string
type: object
type: object
Expand All @@ -109,3 +123,9 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
36 changes: 21 additions & 15 deletions pkg/apis/appsetreport/v1alpha1/appsetreport_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// MulticlusterApplicationSetReport provides a report of the status of an application from all the managed clusters
// where the application is deployed on. It provides a summary of the number of clusters in the various states.
// If an error or warning occurred when installing the application on a managed cluster, the conditions, including
// the waring and error message, is captured in the report.
// +kubebuilder:object:root=true

// MulticlusterApplicationSetReport is the Schema for the MulticlusterApplicationSetReport API.
// +kubebuilder:resource:scope="Namespaced"
// +kubebuilder:resource:shortName=appsetreport;appsetreports
type MulticlusterApplicationSetReport struct {
Expand All @@ -30,16 +32,15 @@ type MulticlusterApplicationSetReport struct {
Statuses AppConditions `json:"statuses,omitempty"`
}

// MulticlusterApplicationSetReportList contains a list of MulticlusterApplicationSetReports.
// +kubebuilder:object:root=true

// MulticlusterApplicationSetReportList contains a list of MulticlusterApplicationSetReport.
type MulticlusterApplicationSetReportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MulticlusterApplicationSetReport `json:"items"`
}

// ResourceRef defines a kind of resource
// ResourceRef identifies the resource that is deployed by the application.
type ResourceRef struct {
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Expand All @@ -49,11 +50,14 @@ type ResourceRef struct {

// Condition defines a type of error/warning
type Condition struct {
Type string `json:"type,omitempty"`
// Type identifies if the condition is a warning or an error.
Type string `json:"type,omitempty"`

// Message is the warning/error message associated with this condition.
Message string `json:"message,omitempty"`
}

// ClusterCondition defines all the error/warning conditions in one cluster per application
// ClusterCondition defines all the error/warning conditions in one cluster for an application.
type ClusterCondition struct {
Cluster string `json:"cluster,omitempty"`
SyncStatus string `json:"syncStatus,omitempty"`
Expand All @@ -62,42 +66,44 @@ type ClusterCondition struct {
Conditions []Condition `json:"conditions,omitempty"`
}

// AppConditions defines all the error/warning conditions in all clusters per application
// AppConditions defines all the error/warning conditions in all clusters where a particular application is deployed.
type AppConditions struct {
// +optional
Resources []ResourceRef `json:"resources,omitempty"`

// +optional
ClusterConditions []ClusterCondition `json:"clusterConditions,omitempty"`

// Summary provides a summary of results
// +optional
Summary ReportSummary `json:"summary,omitempty"`
}

// ReportSummary provides a summary by providing a count of the total number of clusters where the application is
// deployed. It also provides a count of how many clusters where an application are in the following states:
// synced, notSynced, healthy, notHealthy, and inProgress.
type ReportSummary struct {

// Synced provides the count of synced applications
// Synced provides the count of synced applications.
// +optional
Synced string `json:"synced"`

// NotSynced provides the count of the out of sync applications
// NotSynced provides the count of the out of sync applications.
// +optional
NotSynced string `json:"notSynced"`

// Healthy provides the count of healthy applications
// Healthy provides the count of healthy applications.
// +optional
Healthy string `json:"healthy"`

// NotHealthy provides the count of non-healthy applications
// NotHealthy provides the count of non-healthy applications.
// +optional
NotHealthy string `json:"notHealthy"`

// InProgress provides the count of applications that are in the process of being deployed
// InProgress provides the count of applications that are in the process of being deployed.
// +optional
InProgress string `json:"inProgress"`

// Clusters provides the count of all managed clusters the application is deployed to
// Clusters provides the count of all managed clusters the application is deployed.
// +optional
Clusters string `json:"clusters"`
}
Expand Down

0 comments on commit ae37dc5

Please sign in to comment.