From cd344669d381103b8e065617811b928eb895eacb Mon Sep 17 00:00:00 2001 From: Cole Walker Date: Tue, 12 Jan 2021 10:25:18 -0500 Subject: [PATCH] Add api call to trigger creation of gnp Creating an oam network was not correctly setting the flag to trigger the runtime puppet manifest to create the default globalnetwork policy and hostendpoint resources. This change adds the correct api call to ensure that the flag is set when an oam network is created. This ensures that the default globalnetworkpolicy and hostendpoint kubernetes resources are created as intended. This issue was previously masked by the fact that the relevant runtime manifest was being run on every single unlock. This behaviour was changed and revealed that the required flag was not being set upon oam creation. Closes-Bug: https://bugs.launchpad.net/starlingx/+bug/1911213 Signed-off-by: Cole Walker Change-Id: I5b570e82246d82a4243ee68a871333876d231c85 --- .../sysinv/sysinv/api/controllers/v1/interface_network.py | 5 ++++- sysinv/sysinv/sysinv/sysinv/conductor/manager.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/interface_network.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/interface_network.py index ad7065d358..503dda0703 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/interface_network.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/interface_network.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. # -# Copyright (c) 2013-2018 Wind River Systems, Inc. +# Copyright (c) 2013-2021 Wind River Systems, Inc. # import os @@ -194,6 +194,9 @@ class InterfaceNetworkController(rest.RestController): cutils.perform_distributed_cloud_config(pecan.request.dbapi, interface_id) + if network_type == constants.NETWORK_TYPE_OAM: + pecan.request.rpcapi.update_oam_config(pecan.request.context) + return InterfaceNetwork.convert_with_links(result) def _get_interface_network_collection( diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index 13661c3497..318c97aa98 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. # -# Copyright (c) 2013-2020 Wind River Systems, Inc. +# Copyright (c) 2013-2021 Wind River Systems, Inc. # """Conduct all activity related system inventory. @@ -6175,6 +6175,9 @@ class ConductorManager(service.PeriodicService): if utils.get_system_mode(self.dbapi) != constants.SYSTEM_MODE_SIMPLEX: cutils.touch( self._get_oam_runtime_apply_file(standby_controller=True)) + else: + cutils.touch( + self._get_oam_runtime_apply_file(standby_controller=False)) def update_user_config(self, context): """Update the user configuration"""