Skip to content

Commit

Permalink
API description update for gitOpsCluster CRD
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangjing Li <[email protected]>
  • Loading branch information
xiangjingli committed Jun 13, 2024
1 parent f622512 commit 50ec3d5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
26 changes: 17 additions & 9 deletions deploy/crds/apps.open-cluster-management.io_gitopsclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
name: gitopsclusters.apps.open-cluster-management.io
spec:
group: apps.open-cluster-management.io
Expand All @@ -15,7 +17,8 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: GitOpsCluster is the Schema for the gitopsclusters API.
description: The GitOpsCluster uses placement to import selected managed clusters
into the Argo CD.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -33,19 +36,25 @@ spec:
description: GitOpsClusterSpec defines the desired state of GitOpsCluster.
properties:
argoServer:
description: ArgoServerSpec defines a argo server installed in a managed
cluster.
description: ArgoServerSpec specifies the location of the Argo CD
server.
properties:
argoNamespace:
description: ArgoNamespace is the namespace in which the Argo
CD server is installed.
type: string
cluster:
description: Not used and reserved for defining a managed cluster
name.
type: string
required:
- argoNamespace
type: object
createBlankClusterSecrets:
description: Internally used.
type: boolean
createPolicyTemplate:
description: Create default policy template if it is true.
type: boolean
managedServiceAccountRef:
description: ManagedServiceAccountRef defines managed service account
Expand Down Expand Up @@ -111,6 +120,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
required:
- argoServer
- placementRef
Expand All @@ -122,8 +132,12 @@ spec:
format: date-time
type: string
message:
description: Message provides the detailed message of the GitOpsCluster
status.
type: string
phase:
description: Phase provides the overall phase of the GitOpsCluster
status. Valid values include failed or successful.
type: string
type: object
required:
Expand All @@ -134,9 +148,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
33 changes: 23 additions & 10 deletions pkg/apis/apps/v1beta1/gitopscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope="Namespaced"

// GitOpsCluster is the Schema for the gitopsclusters API.
// The GitOpsCluster uses placement to import selected managed clusters into the Argo CD.
type GitOpsCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Expand All @@ -46,17 +46,26 @@ type GitOpsCluster struct {

// GitOpsClusterSpec defines the desired state of GitOpsCluster.
type GitOpsClusterSpec struct {
ArgoServer ArgoServerSpec `json:"argoServer"`
ArgoServer ArgoServerSpec `json:"argoServer"`

PlacementRef *corev1.ObjectReference `json:"placementRef"`

// ManagedServiceAccountRef defines managed service account in the managed cluster namespace used to create the ArgoCD cluster secret.
ManagedServiceAccountRef string `json:"managedServiceAccountRef,omitempty"`
CreateBlankClusterSecrets *bool `json:"createBlankClusterSecrets,omitempty"`
CreatePolicyTemplate *bool `json:"createPolicyTemplate,omitempty"`
ManagedServiceAccountRef string `json:"managedServiceAccountRef,omitempty"`

// Internally used.
CreateBlankClusterSecrets *bool `json:"createBlankClusterSecrets,omitempty"`

// Create default policy template if it is true.
CreatePolicyTemplate *bool `json:"createPolicyTemplate,omitempty"`
}

// ArgoServerSpec defines a argo server installed in a managed cluster.
// ArgoServerSpec specifies the location of the Argo CD server.
type ArgoServerSpec struct {
Cluster string `json:"cluster,omitempty"`
// Not used and reserved for defining a managed cluster name.
Cluster string `json:"cluster,omitempty"`

// ArgoNamespace is the namespace in which the Argo CD server is installed.
ArgoNamespace string `json:"argoNamespace"`
}

Expand All @@ -65,13 +74,17 @@ type ArgoServerSpec struct {
// GitOpsClusterStatus defines the observed state of GitOpsCluster.
type GitOpsClusterStatus struct {
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
Message string `json:"message,omitempty"`
Phase string `json:"phase,omitempty"`

// Message provides the detailed message of the GitOpsCluster status.
Message string `json:"message,omitempty"`

// Phase provides the overall phase of the GitOpsCluster status. Valid values include failed or successful.
Phase string `json:"phase,omitempty"`
}

// +kubebuilder:object:root=true

// GitOpsClusterList contains a list of GitOpsCluster.
// GitOpsClusterList providess a list of GitOpsClusters.
type GitOpsClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down

0 comments on commit 50ec3d5

Please sign in to comment.