Skip to content

Commit

Permalink
Merge pull request #56 from andy000923/master
Browse files Browse the repository at this point in the history
rename NKS service group, service type
  • Loading branch information
in-seo authored Aug 19, 2024
2 parents 66530d5 + 87a1e78 commit 6f6d398
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
_LOGGER = logging.getLogger("cloudforet")


class NKSConnector(NHNCloudBaseConnector):
class ClusterConnector(NHNCloudBaseConnector):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
_LOGGER = logging.getLogger("cloudforet")


class NKSGroupConnector(NHNCloudBaseConnector):
class NodeGroupConnector(NHNCloudBaseConnector):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions src/plugin/manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
from plugin.manager.network_acl.network_acl_manager import NetworkACLManager
from plugin.manager.network_acl.rule_manger import RuleManager
from plugin.manager.network_acl.binding_manager import BindingManager
from plugin.manager.nks.node_group_manager import NodeGroupManager
from plugin.manager.nks.cluster_manager import ClusterManager
from plugin.manager.object_storage.container_manager import ContainerManager
from plugin.manager.push.token_manager import PushTokenManager
from plugin.manager.push.tag_manager import PushTagManager
from plugin.manager.rds_for_mariadb.db_security_group_manager import DBSecurityGroupManager
Expand Down Expand Up @@ -58,7 +61,4 @@
from plugin.manager.transit_hub.multicast_domain_manager import MulticastDomainManager
from plugin.manager.vpc.vpc_manager import VPCManager
from plugin.manager.vpc.subnet_manager import VPCSubnetManager
from plugin.manager.vpc.routing_table_manager import RoutingTableManager
from plugin.manager.nks.group_manager import NKSGroupManager
from plugin.manager.nks.nks_manager import NKSManager
from plugin.manager.object_storage.container_manager import ContainerManager
from plugin.manager.vpc.routing_table_manager import RoutingTableManager
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
from spaceone.inventory.plugin.collector.lib import *

from plugin.conf.cloud_service_conf import AUTH_TYPE, REGION, ASSET_URL
from plugin.connector.nks.nks_connector import NKSConnector
from plugin.connector.nks.cluster_connector import ClusterConnector
from plugin.manager.base import NHNCloudBaseManager

_LOGGER = logging.getLogger("cloudforet")


class NKSManager(NHNCloudBaseManager):
class ClusterManager(NHNCloudBaseManager):
auth_type = AUTH_TYPE.TOKEN
AVAILABLE_REGIONS = [REGION.KR1, REGION.KR2]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

self.cloud_service_group = "Container"
self.cloud_service_type = "NKS"
self.cloud_service_group = "NKS"
self.cloud_service_type = "Cluster"
self.provider = "nhncloud"
self.metadata_path = "metadata/nks/nks.yaml"
self.metadata_path = "metadata/nks/cluster.yaml"

def create_cloud_service_type(self):
cloud_service_type = make_cloud_service_type(
Expand All @@ -37,7 +37,7 @@ def create_cloud_service_type(self):
return cloud_service_type

def create_cloud_service(self, secret_data):
nks_connector = NKSConnector()
nks_connector = ClusterConnector()
for AVAILABLE_REGION in self.AVAILABLE_REGIONS:
resources = nks_connector.get_cluster(secret_data, AVAILABLE_REGION)
for resource in resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
from spaceone.inventory.plugin.collector.lib import *

from plugin.conf.cloud_service_conf import AUTH_TYPE, ASSET_URL, REGION
from plugin.connector.nks.nks_connector import NKSConnector
from plugin.connector.nks.group_connector import NKSGroupConnector
from plugin.connector.nks.node_group_connector import NodeGroupConnector
from plugin.connector.nks.cluster_connector import ClusterConnector
from plugin.manager.base import NHNCloudBaseManager

_LOGGER = logging.getLogger("cloudforet")


class NKSGroupManager(NHNCloudBaseManager):
class NodeGroupManager(NHNCloudBaseManager):
auth_type = AUTH_TYPE.TOKEN
AVAILABLE_REGIONS = [REGION.KR1, REGION.KR2]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

self.cloud_service_group = "Container"
self.cloud_service_group = "NKS"
self.cloud_service_type = "Node Group"
self.provider = "nhncloud"
self.metadata_path = "metadata/nks/group.yaml"
self.metadata_path = "metadata/nks/node_group.yaml"

def create_cloud_service_type(self):
cloud_service_type = make_cloud_service_type(
Expand All @@ -38,8 +38,8 @@ def create_cloud_service_type(self):
return cloud_service_type

def create_cloud_service(self, secret_data):
group_connector = NKSGroupConnector()
cluster_connector = NKSConnector()
group_connector = NodeGroupConnector()
cluster_connector = ClusterConnector()
for AVAILABLE_REGION in self.AVAILABLE_REGIONS:
for cluster in cluster_connector.get_cluster(secret_data, AVAILABLE_REGION):
cluster_id = cluster['uuid']
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6f6d398

Please sign in to comment.