Skip to content

Commit

Permalink
This reverts commit 6600709.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara4994 committed Oct 28, 2024
1 parent 6600709 commit 04bee7b
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions controllers/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package status

import (
"path/filepath"
"strings"

"github.com/blang/semver/v4"
conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
Expand Down Expand Up @@ -307,37 +306,29 @@ func GetReleaseVersion(defaultManifestPath string, componentName string) Compone
var componentVersion semver.Version
var repositoryURL string
var displayName string
var componentStatusMeta ComponentReleaseStatus
var componentsReleaseStatus []ComponentReleaseStatus

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

if err != nil {
return ComponentStatus{}
}
for key, value := range env {
switch {
case strings.Contains(key, "release-version"):
componentVersion, err = semver.Parse(value)

if err != nil {
return ComponentStatus{}
}
case strings.Contains(key, "repository-url"):
repositoryURL = value
case strings.Contains(key, "display-name"):
displayName = value
}
componentStatusMeta = ComponentReleaseStatus{

componentVersion, err = semver.Parse(env["RHOAI_RELEASE_VERSION"])

if err != nil {
return ComponentStatus{}
}
repositoryURL = env["REPOSITORY_URL"]

displayName = env["DISPLAY_NAME"]

return ComponentStatus{
Releases: []ComponentReleaseStatus{{
Name: componentName,
DisplayName: displayName,
Version: version.OperatorVersion{Version: componentVersion},
RepoURL: repositoryURL,
}
}
componentsReleaseStatus = append(componentsReleaseStatus, componentStatusMeta)

return ComponentStatus{
Releases: componentsReleaseStatus,
},
},
}
}

0 comments on commit 04bee7b

Please sign in to comment.