Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/v1alpha1/managedmetric_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type ManagedMetricSpec struct {
// +kubebuilder:default:="10m"
Interval metav1.Duration `json:"interval,omitempty"`

RemoteClusterAccessRef `json:"remoteClusterAccessRef,omitempty"`
// +optional
*RemoteClusterAccessRef `json:"remoteClusterAccessRef,omitempty"`
}

// ManagedObservation represents the latest available observation of an object's state
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/metric_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ type MetricSpec struct {
// +kubebuilder:default:="10m"
Interval metav1.Duration `json:"interval,omitempty"`

RemoteClusterAccessRef `json:"remoteClusterAccessRef,omitempty"`
// +optional
*RemoteClusterAccessRef `json:"remoteClusterAccessRef,omitempty"`

Projections []Projection `json:"projections,omitempty"`
}
Expand Down
14 changes: 11 additions & 3 deletions api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion internal/controller/managedmetric_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (r *ManagedMetricReconciler) Reconcile(ctx context.Context, req ctrl.Reques
/*
1.2 Create QueryConfig to query the resources in the K8S cluster or external cluster based on the kubeconfig secret reference
*/
queryConfig, err := createQueryConfig(ctx, &metric.Spec.RemoteClusterAccessRef, r)
queryConfig, err := createQueryConfig(ctx, metric.Spec.RemoteClusterAccessRef, r)
if err != nil {
return ctrl.Result{RequeueAfter: RequeueAfterError}, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/metric_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (r *MetricReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
/*
1.2 Create QueryConfig to query the resources in the K8S cluster or external cluster based on the kubeconfig secret reference
*/
queryConfig, err := createQC(ctx, &metric.Spec.RemoteClusterAccessRef, r)
queryConfig, err := createQC(ctx, metric.Spec.RemoteClusterAccessRef, r)
if err != nil {
return ctrl.Result{RequeueAfter: RequeueAfterError}, err
}
Expand Down
Loading