Remove the logic to Create a kubernetes API client for each k8s object

Bug #1502367 reported by Vilobh Meshram
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Vilobh Meshram

Bug Description

Remove the logic to create a kubernetes API client for each k8s object.

As part of https://review.openstack.org/#/c/223384/ additional logic was added to make sure the create a kubernetes API client succeeds for service object and does not fail for pod/rc objects because

- create_k8s_api(context, bay_uuid) => service object so for this in https://review.openstack.org/#/c/223384/ a seperate call
create_k8s_api_service(context, bay_uuid) was introduced.

- create_k8s_api(context, obj) => for pod/rc object

Since this is a common code path making this change after everything has merged so that we will be consistent.

This is a hug change other option would be to propose ~2000 lines of code in one patch set which would be a nightmare for reviewers.

similar changes will be done for respective object.

Changed in magnum:
assignee: nobody → Vilobh Meshram (vilobhmm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to magnum (master)

Reviewed: https://review.openstack.org/213368
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=3b1c0b28cb7910debc26eed7bf8aa8da9ed88a33
Submitter: Jenkins
Branch: master

commit 3b1c0b28cb7910debc26eed7bf8aa8da9ed88a33
Author: Vilobh Meshram <email address hidden>
Date: Tue Sep 8 11:00:41 2015 -0700

    Objects from Bay - Replication Controller

    Currently objects (pod/rc/service) are read from the
    database. In order for native clients to work, they
    must be read from the ReST bay endpoint. To execute
    native clients, we must have one truth of the state
    of the system, not two as we do now. This patch adds
    changes for Replication Controller.

    Also, please refer to the related-bug as to the temporary changes
    done to make the test work for other objects namely pod,
    service. These changes will be removed when the object from bay
    patches for all the k8s objects are merged as part of a seperate
    patch.

    Partially-Implements: bp objects-from-bay
    Related-Bug: #1502367
    Related-Bug: #1504379

    Change-Id: I7905af9e22f47b16d92043cc1fdcb1cdf72ebc48

Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
Eli Qiao (taget-9)
Changed in magnum:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/223384
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=067b38391cfb2e5e393d923364a05b0ae313674b
Submitter: Jenkins
Branch: master

commit 067b38391cfb2e5e393d923364a05b0ae313674b
Author: Vilobh Meshram <email address hidden>
Date: Mon Sep 14 15:02:18 2015 -0700

    Objects from Bay - Services

    Currently k8s objects (pod/rc/service) are read from the
    database. In order for native clients to work, they must
    be read from the ReST bay endpoint. To execute native
    clients, we must have one truth of the state of the
    system, not two as we do now. This patch proposes the
    change to the Service object.

    Also, please refer to the related-bug as to the temporary changes
    done to make the test work for other objects namely pod, rc. These
    changes will be removed when the object from bay patches for
    all the k8s objects are merged as part of a seperate patch.

    Partially-Implements: bp objects-from-bay
    Related-Bug: #1502367
    Related-Bug: #1504379

    Change-Id: I05177944a693710c70a22cae57f521b0fe738e9e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/223367
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=44122d08f8fea0bf6e83c539dde222572957acb7
Submitter: Jenkins
Branch: master

commit 44122d08f8fea0bf6e83c539dde222572957acb7
Author: Vilobh Meshram <email address hidden>
Date: Mon Sep 14 18:39:04 2015 -0700

    Objects from Bay - Pods

    Currently k8s objects (pod/rc/service) are read from the
    database. In order for native clients to work, they must
    be read from the ReST bay endpoint. To execute native
    clients, we must have one truth of the state of the
    system, not two as we do now. This patch proposes the
    change to the Pod object.

    Also, please refer to the related-bug as to the temporary changes
    done to make the test work for other objects namely rc,
    service. These changes will be removed when the object from bay
    patches for all the k8s objects are merged as part of a seperate
    patch.

    Partially-Implements: bp objects-from-bay
    Related-Bug: #1502367
    Related-Bug: #1504379

    Change-Id: Id5be7fba2eb8622fcfeb48068728e440a0af3f5e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/260240

Changed in magnum:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/260240
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=fee4b609c0bacae84d14e277cb9e8cb318a88b5e
Submitter: Jenkins
Branch: master

commit fee4b609c0bacae84d14e277cb9e8cb318a88b5e
Author: Vilobh Meshram <email address hidden>
Date: Mon Dec 21 15:20:49 2015 -0800

    Make kubernetes API client generic

    Make kubernetes API client generic. Right now each k8s object has
    a way to create k8s API client. This was needed to make sure the
    tests passed. Now since all the objects-from-bay patches are merged
    in its better to make the client creation logic generic.

    Change-Id: Ic2a9b16bbd4c13794c7ef95309bd260366ec872e
    Closes-Bug: #1502367

Changed in magnum:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 2.0.0

This issue was fixed in the openstack/magnum 2.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.