From bffc9358c80d491da663194d7374454b8707f3c5 Mon Sep 17 00:00:00 2001 From: Justin Ashworth Date: Thu, 27 Jun 2024 14:05:06 -0400 Subject: [PATCH 1/2] Networking fixes --- gcp/couchbase-server/resources/firewall_rule.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcp/couchbase-server/resources/firewall_rule.py b/gcp/couchbase-server/resources/firewall_rule.py index 1a7146d..dfa909f 100644 --- a/gcp/couchbase-server/resources/firewall_rule.py +++ b/gcp/couchbase-server/resources/firewall_rule.py @@ -5,10 +5,8 @@ def generate_config(context): network = context.properties['network'] if isinstance(network, list): network = network[0] - if network == "default": - network = 'projects/{}/global/networks/{}'.format(project, network) - + network = 'projects/{}/global/networks/{}'.format(project, network) suffix = context.properties['nameSuffix'] project = context.env['project'] sourceCidr = context.properties['accessCIDR'] From 2e934deaf32fecd364f882853a31cc534b0461ac Mon Sep 17 00:00:00 2001 From: Justin Ashworth Date: Thu, 27 Jun 2024 14:24:37 -0400 Subject: [PATCH 2/2] fixed issues with network and firewall rule --- gcp/couchbase-server/resources/firewall_rule.py | 6 +++--- gcp/couchbase-server/test_config.local.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcp/couchbase-server/resources/firewall_rule.py b/gcp/couchbase-server/resources/firewall_rule.py index dfa909f..fbf638a 100644 --- a/gcp/couchbase-server/resources/firewall_rule.py +++ b/gcp/couchbase-server/resources/firewall_rule.py @@ -2,15 +2,15 @@ def generate_config(context): # Here is where work is done. This method is what is called to retrieve a dictionary that represents the type. # All required parameters defined in the schema will be present on the context object. This must return a # python dict with a structure that matches the API items found + suffix = context.properties['nameSuffix'] + project = context.env['project'] network = context.properties['network'] if isinstance(network, list): network = network[0] if network == "default": network = 'projects/{}/global/networks/{}'.format(project, network) - suffix = context.properties['nameSuffix'] - project = context.env['project'] + sourceCidr = context.properties['accessCIDR'] - network = 'projects/{}/global/networks/{}'.format(project, network) tag = 'couchbase-server-{}'.format(suffix) resources = [] output = [] diff --git a/gcp/couchbase-server/test_config.local.yaml b/gcp/couchbase-server/test_config.local.yaml index 3f7b9ce..e9e5a60 100644 --- a/gcp/couchbase-server/test_config.local.yaml +++ b/gcp/couchbase-server/test_config.local.yaml @@ -5,7 +5,7 @@ resources: - name: test-couchbase-deployment type: couchbase.py properties: - name: couchbase-server-test + name: ja-test-stack serverNodeCount: 3 serverNodeType: n1-standard-4 serverDiskSize: 20