Skip to content

Commit

Permalink
Deprecate cluster lists in precaching/backup status (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
jc-rh committed Jan 30, 2023
1 parent 5b9e141 commit d72dbe6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 6 additions & 4 deletions api/v1alpha1/clustergroupupgrade_types.go
Expand Up @@ -214,16 +214,18 @@ type PrecachingSpec struct {

// PrecachingStatus defines the observed pre-caching status
type PrecachingStatus struct {
Spec *PrecachingSpec `json:"spec,omitempty"`
Status map[string]string `json:"status,omitempty"`
Clusters []string `json:"clusters,omitempty"`
Spec *PrecachingSpec `json:"spec,omitempty"`
Status map[string]string `json:"status,omitempty"`
//+kubebuilder:deprecatedversion:warning="PrecachingStatus.Clusters is deprecated"
Clusters []string `json:"clusters,omitempty"`
}

// BackupStatus defines the observed backup status
type BackupStatus struct {
StartedAt metav1.Time `json:"startedAt,omitempty"`
Status map[string]string `json:"status,omitempty"`
Clusters []string `json:"clusters,omitempty"`
//+kubebuilder:deprecatedversion:warning="BackupStatus.Clusters is deprecated"
Clusters []string `json:"clusters,omitempty"`
}

// ClusterGroupUpgradeStatus defines the observed state of ClusterGroupUpgrade
Expand Down
2 changes: 1 addition & 1 deletion controllers/precache.go
Expand Up @@ -211,7 +211,7 @@ func (r *ClusterGroupUpgradeReconciler) deployDependencies(
if err != nil {
return false, err
}
spec.ViewUpdateIntervalSec = utils.GetMCVUpdateInterval(len(clusterGroupUpgrade.Status.Precaching.Clusters))
spec.ViewUpdateIntervalSec = utils.GetMCVUpdateInterval(len(clusterGroupUpgrade.Status.Precaching.Status))
err = r.createResourcesFromTemplates(ctx, spec, precacheDependenciesViewTemplates)
if err != nil {
return false, err
Expand Down
4 changes: 1 addition & 3 deletions controllers/precacheFsm.go
Expand Up @@ -94,8 +94,6 @@ func (r *ClusterGroupUpgradeReconciler) precachingFsm(ctx context.Context,
clusterGroupUpgrade.Status.Precaching.Spec = &spec
}

clusterGroupUpgrade.Status.Precaching.Clusters = clusters

for _, cluster := range clusters {
var currentState string
var ok bool
Expand Down Expand Up @@ -225,7 +223,7 @@ func (r *ClusterGroupUpgradeReconciler) handleStarting(ctx context.Context,
case NoJobView:
data := templateData{
Cluster: cluster,
ViewUpdateIntervalSec: utils.GetMCVUpdateInterval(len(clusterGroupUpgrade.Status.Precaching.Clusters)),
ViewUpdateIntervalSec: utils.GetMCVUpdateInterval(len(clusterGroupUpgrade.Status.Precaching.Status)),
}
err = r.createResourcesFromTemplates(ctx, &data, precacheJobView)
if err != nil {
Expand Down

0 comments on commit d72dbe6

Please sign in to comment.