Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1942616

Summary: [day-2] POST /add_hosts_clusters endpoint returns host_networks and hosts as null
Product: OpenShift Container Platform Reporter: Jiri Tomasek <jtomasek>
Component: assisted-installerAssignee: Elior Erez <eerez>
assisted-installer sub component: assisted-service QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, lgamliel, mchernyk
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: OCP-Metal-v1.0.18.1 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-20 18:52:40 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:

Description Jiri Tomasek 2021-03-24 16:02:38 UTC
Description of problem:

A response from POST /add_hosts_clusters endpoint returns host_networks and hosts as null which is not consistent with POST /clusters which always returns an array.

UI uses default function parameters to initialize hosts as [] but this fails due to hosts being set to null.
According to swagger a response from POST /add_hosts_clusters is either undefined or Host array.

Current POST /add_hosts_clusters response:

{
    "api_vip_dns_name": "api.jtomasek.redhat.com",
    "controller_logs_collected_at": "0001-01-01T00:00:00.000Z",
    "controller_logs_started_at": "0001-01-01T00:00:00.000Z",
    "created_at": "2021-03-24T15:50:04.034Z",
    "email_domain": "redhat.com",
    "host_networks": null,
    "hosts": null,
    "href": "/api/assisted-install/v1/clusters/bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "id": "bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "image_info": {
        "created_at": "0001-01-01T00:00:00.000Z",
        "expires_at": "0001-01-01T00:00:00.000Z"
    },
    "install_completed_at": "2000-01-01T00:00:00.000Z",
    "install_started_at": "2000-01-01T00:00:00.000Z",
    "kind": "AddHostsCluster",
    "name": "scale-up-bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "openshift_version": "4.7",
    "org_id": "10920204",
    "progress": {
        "progress_updated_at": "0001-01-01T00:00:00.000Z"
    },
    "status": "adding-hosts",
    "status_info": "cluster is adding hosts to existing OCP cluster",
    "status_updated_at": "2021-03-24T15:50:04.019Z",
    "updated_at": "2021-03-24T15:50:04.034Z",
    "user_name": "jtomasek"
}

Expected POST /add_hosts_clusters response:

{
    "api_vip_dns_name": "api.jtomasek.redhat.com",
    "controller_logs_collected_at": "0001-01-01T00:00:00.000Z",
    "controller_logs_started_at": "0001-01-01T00:00:00.000Z",
    "created_at": "2021-03-24T15:50:04.034Z",
    "email_domain": "redhat.com",
    "host_networks": [],
    "hosts": [],
    "href": "/api/assisted-install/v1/clusters/bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "id": "bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "image_info": {
        "created_at": "0001-01-01T00:00:00.000Z",
        "expires_at": "0001-01-01T00:00:00.000Z"
    },
    "install_completed_at": "2000-01-01T00:00:00.000Z",
    "install_started_at": "2000-01-01T00:00:00.000Z",
    "kind": "AddHostsCluster",
    "name": "scale-up-bfb5dc2b-a007-4908-9837-c84cd916e2dc",
    "openshift_version": "4.7",
    "org_id": "10920204",
    "progress": {
        "progress_updated_at": "0001-01-01T00:00:00.000Z"
    },
    "status": "adding-hosts",
    "status_info": "cluster is adding hosts to existing OCP cluster",
    "status_updated_at": "2021-03-24T15:50:04.019Z",
    "updated_at": "2021-03-24T15:50:04.034Z",
    "user_name": "jtomasek"
}

UI can fix this by avoiding using default parameters to initialize hosts as [] but it would be better to align the API endpoints response.

Comment 1 Jiri Tomasek 2021-03-29 06:29:47 UTC
UI bug: https://bugzilla.redhat.com/show_bug.cgi?id=1938357

Comment 2 mchernyk 2021-04-06 14:57:00 UTC
Verified on stage environment, 
assisted service: v1.0.18.1

Comment 5 errata-xmlrpc 2021-04-20 18:52:40 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 (OpenShift Container Platform 4.7.7 bug fix update), 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-2021:1149