Skip to content

Commit 2781133

Browse files
authored
Support for checking sync status for RootSyncSet (#3625)
1 parent d4ae450 commit 2781133

File tree

7 files changed

+620
-50
lines changed

7 files changed

+620
-50
lines changed

porch/controllers/config/crd/bases/config.porch.kpt.dev_rootsyncsets.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ spec:
6060
type: string
6161
namespace:
6262
type: string
63-
required:
64-
- namespace
6563
type: object
6664
type: array
6765
template:
@@ -108,6 +106,21 @@ spec:
108106
status:
109107
description: RootSyncSetStatus defines the observed state of RootSyncSet
110108
properties:
109+
clusterRefStatuses:
110+
items:
111+
properties:
112+
apiVersion:
113+
type: string
114+
kind:
115+
type: string
116+
name:
117+
type: string
118+
namespace:
119+
type: string
120+
syncStatus:
121+
type: string
122+
type: object
123+
type: array
111124
conditions:
112125
description: Conditions describes the reconciliation state of the
113126
object.

porch/controllers/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949
var (
5050
reconcilers = map[string]newReconciler{
5151
"rootsyncsets": func() Reconciler {
52-
return &rootsyncset.RootSyncSetReconciler{}
52+
return rootsyncset.NewRootSyncSetReconciler()
5353
},
5454
"remoterootsyncsets": func() Reconciler {
5555
return &remoterootsyncset.RemoteRootSyncSetReconciler{}

porch/controllers/rootsyncsets/api/v1alpha1/rootsyncset_types.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type ClusterRef struct {
2828
ApiVersion string `json:"apiVersion,omitempty"`
2929
Kind string `json:"kind,omitempty"`
3030
Name string `json:"name,omitempty"`
31-
Namespace string `json:"namespace,'omitempty'"`
31+
Namespace string `json:"namespace,omitempty"`
3232
}
3333

3434
type RootSyncInfo struct {
@@ -65,6 +65,16 @@ type SecretReference struct {
6565
type RootSyncSetStatus struct {
6666
// Conditions describes the reconciliation state of the object.
6767
Conditions []metav1.Condition `json:"conditions,omitempty"`
68+
69+
ClusterRefStatuses []ClusterRefStatus `json:"clusterRefStatuses,omitempty"`
70+
}
71+
72+
type ClusterRefStatus struct {
73+
ApiVersion string `json:"apiVersion,omitempty"`
74+
Kind string `json:"kind,omitempty"`
75+
Name string `json:"name,omitempty"`
76+
Namespace string `json:"namespace,omitempty"`
77+
SyncStatus string `json:"syncStatus,omitempty"`
6878
}
6979

7080
//+kubebuilder:object:root=true

porch/controllers/rootsyncsets/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)