Bug 1846521

Summary: CAM cluster version detection not working for some OCP 3.9 clusters "/version" endpoint Major/Minor fields missing
Product: OpenShift Container Platform Reporter: Derek Whatley <dwhatley>
Component: Migration ToolingAssignee: Derek Whatley <dwhatley>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: chezhang, mberube, resantos, rjohnson, sregidor, sseago, whu
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1847191 (view as bug list) Environment:
Last Closed: 2020-09-30 18:42:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1847191    

Description Derek Whatley 2020-06-11 19:21:25 UTC
Description of problem:
After providing MigCluster connection details, CAM hits a "Reconcile failed" error shown on the MigCluster due to:"error":"strconv.Atoi: parsing \"\": invalid syntax"

This problem arises on clusters where k8s major/minor versions are not filled out in the k8s `/version` endpoint

Response Body: {
  "major": "",
  "minor": "",
  "gitVersion": "v1.9.1+a0ce1bc657",
  "gitCommit": "a0ce1bc",
  "gitTreeState": "clean",
  "buildDate": "2018-04-26T16:48:23Z",
  "goVersion": "go1.9.4",
  "compiler": "gc",
  "platform": "linux/amd64"
}


Version-Release number of selected component (if applicable):
CAM v1.2.0
OCP 3.9.27 (other OCP 3.9 versions also affected)

How reproducible:
Always, on select OCP 3.9 clusters where kube major/minor versions aren't available (known to fail on OCP 3.9.27)

Steps to Reproduce:
1. Install CAM 1.2.0
2. Go to web UI (CLI also works) 
3. Set up a MigCluster ("Cluster" in web UI) using connection details of an OCP 3.9.27 cluster
4. Verify that error condition is raised on MigCluster due to reconcile failure. Error message will mention "atoi" conversion.

Actual results:
Reconcile failed on MigCluster, blocks all other actions on this MigCluster

Expected results:
Reconcile works as expected on MigCluster, migrations can be performed


Additional info:

This is a known issue with some OCP 3.9 versions: https://github.com/openshift/origin/pull/19731 

We are developing a fix to overcome the missing major/minor version fields by instead parsing gitVersion, which appears to still be available on OCP 3.9 clusters missing the major/minor fields.

Comment 2 Derek Whatley 2020-06-15 20:02:21 UTC
PRs are merged.

Comment 9 errata-xmlrpc 2020-09-30 18:42:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Migration Toolkit for Containers (MTC) Tool image release advisory 1.3.0), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4148