Skip to content

Commit ad7fbda

Browse files
Yauheni Kaliutazdtsw
authored andcommitted
Rename GetPlatform functions to not reflect implementation (#1232)
* upgrade: rename GetReleaseFromCR to GetDeployedRelease GetReleaseFromCR name is more about implementation than the task it performs. The function fetches release from DSC/DSCI mean the latest release the data science cluster was deployed by. Consider it as "deployed release". Signed-off-by: Yauheni Kaliuta <[email protected]> * cluster: rename GetReleaseFromCSV back to GetRelease GetReleaseFromCSV name is more about implementation than the task it performs. The function fetches actual running operator release and CSV is only one possibility for that. Signed-off-by: Yauheni Kaliuta <[email protected]> --------- Signed-off-by: Yauheni Kaliuta <[email protected]> (cherry picked from commit b4c880a)
1 parent 92ac207 commit ad7fbda

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

controllers/datasciencecluster/datasciencecluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (r *DataScienceClusterReconciler) Reconcile(ctx context.Context, req ctrl.R
8585
r.Log.Info("Reconciling DataScienceCluster resources", "Request.Name", req.Name)
8686

8787
// Get information on version
88-
currentOperatorReleaseVersion, err := cluster.GetReleaseFromCSV(ctx, r.Client)
88+
currentOperatorReleaseVersion, err := cluster.GetRelease(ctx, r.Client)
8989
if err != nil {
9090
r.Log.Error(err, "failed to get operator release version")
9191
return ctrl.Result{}, err

controllers/dscinitialization/dscinitialization_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type DSCInitializationReconciler struct {
7878
func (r *DSCInitializationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { //nolint:funlen,gocyclo,maintidx
7979
r.Log.Info("Reconciling DSCInitialization.", "DSCInitialization Request.Name", req.Name)
8080

81-
currentOperatorReleaseVersion, err := cluster.GetReleaseFromCSV(ctx, r.Client)
81+
currentOperatorReleaseVersion, err := cluster.GetRelease(ctx, r.Client)
8282
if err != nil {
8383
r.Log.Error(err, "failed to get operator release version")
8484
return ctrl.Result{}, err

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func main() {
224224
os.Exit(1)
225225
}
226226
// get old release version before we create default DSCI CR
227-
oldReleaseVersion, _ := upgrade.GetReleaseFromCR(ctx, setupClient)
227+
oldReleaseVersion, _ := upgrade.GetDeployedRelease(ctx, setupClient)
228228

229229
// Check if user opted for disabling DSC configuration
230230
disableDSCConfig, existDSCConfig := os.LookupEnv("DISABLE_DSC_CONFIG")

pkg/cluster/cluster_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ type Release struct {
133133
Version version.OperatorVersion `json:"version,omitempty"`
134134
}
135135

136-
func GetReleaseFromCSV(ctx context.Context, cli client.Client) (Release, error) {
136+
func GetRelease(ctx context.Context, cli client.Client) (Release, error) {
137137
initRelease := Release{
138138
// dummy version set to name "", version 0.0.0
139139
Version: version.OperatorVersion{

pkg/upgrade/upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ func deleteDeprecatedNamespace(ctx context.Context, cli client.Client, namespace
513513
return nil
514514
}
515515

516-
func GetReleaseFromCR(ctx context.Context, cli client.Client) (cluster.Release, error) {
516+
func GetDeployedRelease(ctx context.Context, cli client.Client) (cluster.Release, error) {
517517
dsciInstance := &dsciv1.DSCInitializationList{}
518518
if err := cli.List(ctx, dsciInstance); err != nil {
519519
return cluster.Release{}, err

0 commit comments

Comments
 (0)