Skip to content

Commit 04bee7b

Browse files
committed
This reverts commit 6600709.
1 parent 6600709 commit 04bee7b

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

controllers/status/status.go

+14-23
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package status
2020

2121
import (
2222
"path/filepath"
23-
"strings"
2423

2524
"github.com/blang/semver/v4"
2625
conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
@@ -307,37 +306,29 @@ func GetReleaseVersion(defaultManifestPath string, componentName string) Compone
307306
var componentVersion semver.Version
308307
var repositoryURL string
309308
var displayName string
310-
var componentStatusMeta ComponentReleaseStatus
311-
var componentsReleaseStatus []ComponentReleaseStatus
312309

313310
env, err := common.ParseParams(filepath.Join(defaultManifestPath, componentName, ".env"))
314311

315312
if err != nil {
316313
return ComponentStatus{}
317314
}
318-
for key, value := range env {
319-
switch {
320-
case strings.Contains(key, "release-version"):
321-
componentVersion, err = semver.Parse(value)
322-
323-
if err != nil {
324-
return ComponentStatus{}
325-
}
326-
case strings.Contains(key, "repository-url"):
327-
repositoryURL = value
328-
case strings.Contains(key, "display-name"):
329-
displayName = value
330-
}
331-
componentStatusMeta = ComponentReleaseStatus{
315+
316+
componentVersion, err = semver.Parse(env["RHOAI_RELEASE_VERSION"])
317+
318+
if err != nil {
319+
return ComponentStatus{}
320+
}
321+
repositoryURL = env["REPOSITORY_URL"]
322+
323+
displayName = env["DISPLAY_NAME"]
324+
325+
return ComponentStatus{
326+
Releases: []ComponentReleaseStatus{{
332327
Name: componentName,
333328
DisplayName: displayName,
334329
Version: version.OperatorVersion{Version: componentVersion},
335330
RepoURL: repositoryURL,
336-
}
337-
}
338-
componentsReleaseStatus = append(componentsReleaseStatus, componentStatusMeta)
339-
340-
return ComponentStatus{
341-
Releases: componentsReleaseStatus,
331+
},
332+
},
342333
}
343334
}

0 commit comments

Comments
 (0)