[K8s]: Project deletion non handled correctly after multi cluster changes

Bug #1779620 reported by Pulkit Tandon on 2018-07-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Released
High
Dinesh Bakiaraj
Trunk
Fix Released
High
Dinesh Bakiaraj

Bug Description

R5.0-117

After deletion of namespace, corresponding project is not getting deleted from contrail.
This has happened after multi cluster changes have been introduced.

While doing a rough inspcetion, following piece of code might be buggy:

File:
/usr/lib/python2.7/site-packages/kube_manager/vnc/vnc_namespace.py
Lines:
554 # delete the namespace
    555 self._delete_namespace(name)

which further calls:
NamespaceKM.find_by_name_or_uuid(ns_name)

I think it will return None if you use ns_name without cluster name appended.
Thus, deletion will fail.
I could be wrong here.

Dinesh Bakiaraj (dineshb) wrote :

The namespace delete problem is here:

https://github.com/Juniper/contrail-controller/blob/master/src/container/kube-manager/kube_manager/vnc/vnc_namespace.py#L563
The check should be : if vnc_kube_config.cluster_project_name(name) == project.name:

Review in progress for https://review.opencontrail.org/44290
Submitter: Pragash Vijayaragavan (<email address hidden>)

OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44327
Submitter: Dinesh Bakiaraj (<email address hidden>)

Review in progress for https://review.opencontrail.org/44334
Submitter: Dinesh Bakiaraj (<email address hidden>)

Reviewed: https://review.opencontrail.org/44327
Committed: http://github.com/Juniper/contrail-controller/commit/2d21e16c1afb8f56c0b94f07bc637a25685a65b3
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 2d21e16c1afb8f56c0b94f07bc637a25685a65b3
Author: dineshb-jnpr <email address hidden>
Date: Tue Jul 3 08:01:00 2018 -0700

Delete project for K8s namespace.

This commit fixes a bug introduced by code changes for multi-
cluster support, due to which a project created for a namespace
is not deleted.

Change-Id: I941f6256fcc5782ae57ca39dbfabf8f5e94bcdfc
Closes-Bug: #1779620

Reviewed: https://review.opencontrail.org/44334
Committed: http://github.com/Juniper/contrail-controller/commit/960bb8fe43ba7788fddc693d4bdc8ad35831078e
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 960bb8fe43ba7788fddc693d4bdc8ad35831078e
Author: dineshb-jnpr <email address hidden>
Date: Tue Jul 3 08:01:00 2018 -0700

Delete project for K8s namespace.

This commit fixes a bug introduced by code changes for multi-
cluster support, due to which a project created for a namespace
is not deleted.

Change-Id: I941f6256fcc5782ae57ca39dbfabf8f5e94bcdfc
Closes-Bug: #1779620

Pulkit Tandon (pulkitt) wrote :

Verified recently on R5.0-133.(5.0.1 branch)
Its working and hence can be closed.

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

Other bug subscribers