Skip to content

Commit

Permalink
Support for checking sync status for RootSyncSet (#3625)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortent authored Oct 21, 2022
1 parent d4ae450 commit 2781133
Show file tree
Hide file tree
Showing 7 changed files with 620 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ spec:
type: string
namespace:
type: string
required:
- namespace
type: object
type: array
template:
Expand Down Expand Up @@ -108,6 +106,21 @@ spec:
status:
description: RootSyncSetStatus defines the observed state of RootSyncSet
properties:
clusterRefStatuses:
items:
properties:
apiVersion:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
syncStatus:
type: string
type: object
type: array
conditions:
description: Conditions describes the reconciliation state of the
object.
Expand Down
2 changes: 1 addition & 1 deletion porch/controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
var (
reconcilers = map[string]newReconciler{
"rootsyncsets": func() Reconciler {
return &rootsyncset.RootSyncSetReconciler{}
return rootsyncset.NewRootSyncSetReconciler()
},
"remoterootsyncsets": func() Reconciler {
return &remoterootsyncset.RemoteRootSyncSetReconciler{}
Expand Down
12 changes: 11 additions & 1 deletion porch/controllers/rootsyncsets/api/v1alpha1/rootsyncset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type ClusterRef struct {
ApiVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,'omitempty'"`
Namespace string `json:"namespace,omitempty"`
}

type RootSyncInfo struct {
Expand Down Expand Up @@ -65,6 +65,16 @@ type SecretReference struct {
type RootSyncSetStatus struct {
// Conditions describes the reconciliation state of the object.
Conditions []metav1.Condition `json:"conditions,omitempty"`

ClusterRefStatuses []ClusterRefStatus `json:"clusterRefStatuses,omitempty"`
}

type ClusterRefStatus struct {
ApiVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
SyncStatus string `json:"syncStatus,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down

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

Loading

0 comments on commit 2781133

Please sign in to comment.