Bug 1942616 - [day-2] POST /add_hosts_clusters endpoint returns host_networks and hosts as null
Summary: [day-2] POST /add_hosts_clusters endpoint returns host_networks and hosts as ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: assisted-installer
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.7.z
Assignee: Elior Erez
QA Contact: Yuri Obshansky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-24 16:02 UTC by Jiri Tomasek
Modified: 2021-04-20 18:53 UTC (History)
3 users (show)

Fixed In Version: OCP-Metal-v1.0.18.1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-20 18:52:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift-assisted assisted-ui-lib pull 523 0 None open BZ 1942616 Hosts can be null, don't use default parameters 2021-03-24 16:09:28 UTC
Red Hat Product Errata RHBA-2021:1149 0 None None None 2021-04-20 18:53:02 UTC

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


Note You need to log in before you can comment on or make changes to this bug.