Skip to content

Commit

Permalink
OCPBUGS-51209: Updated logic to address failures in unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: DAMISETTI-VEERABHADRARAO <[email protected]>
  • Loading branch information
veera-damisetti committed Mar 6, 2025
1 parent 6292143 commit d5e0678
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions internal/handlers/boot_artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,19 @@ func parseArtifact(path, arch, version, isoFileName string) (string, error) {
}

var artifact string
var rhelVersion int
var err error

// Fetching rhcosVersion from isoFileName

rhcosVersionSplit := strings.Split(isoFileName, version+"-")
rhcosVersion := rhcosVersionSplit[len(rhcosVersionSplit)-1]

// Fetching rhelVersion from rhcosVersiom
if len(strings.Split(rhcosVersion, ".")) > 1 {
rhelVersion, err = strconv.Atoi(strings.Split(rhcosVersion, ".")[1])
}

// Fetching rhelVersion from IsoFileName
rhelVersion, err := strconv.Atoi(strings.Split(strings.Split(isoFileName, version+"-")[1], ".")[1])
if err != nil {
fmt.Println("Error in fetching RHCOS Version from ISO file")
return "", err
Expand Down

0 comments on commit d5e0678

Please sign in to comment.