From 76318c144f0580baa93e47341e17ed814b2ff844 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Thu, 2 Jan 2020 14:22:08 -0800 Subject: [PATCH] Remove container cluster password from test for VCR reasons --- .../google_container_cluster/google_container_cluster.erb | 2 -- .../google_container_cluster_attributes.erb | 3 +-- .../inspec/custom_functions/google_compute_firewall.erb | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/templates/inspec/examples/google_container_cluster/google_container_cluster.erb b/templates/inspec/examples/google_container_cluster/google_container_cluster.erb index 39cf970a9075..bbd98deaed4a 100644 --- a/templates/inspec/examples/google_container_cluster/google_container_cluster.erb +++ b/templates/inspec/examples/google_container_cluster/google_container_cluster.erb @@ -5,13 +5,11 @@ <% gcp_kube_cluster_zone_extra1 = "#{external_attribute('gcp_kube_cluster_zone_extra1', doc_generation)}" -%> <% gcp_kube_cluster_zone_extra2 = "#{external_attribute('gcp_kube_cluster_zone_extra2', doc_generation)}" -%> <% gcp_kube_cluster_master_user = "#{external_attribute('gcp_kube_cluster_master_user', doc_generation)}" -%> -<% gcp_kube_cluster_master_pass = "#{external_attribute('gcp_kube_cluster_master_pass', doc_generation)}" -%> describe google_container_cluster(project: <%= gcp_project_id -%>, location: <%= gcp_kube_cluster_zone -%>, name: <%= gcp_kube_cluster_name -%>) do it { should exist } its('locations.sort'){ should cmp [ <%= gcp_kube_cluster_zone -%>, <%= gcp_kube_cluster_zone_extra1 -%>, <%= gcp_kube_cluster_zone_extra2 -%> ].sort } its('master_auth.username') { should eq <%= gcp_kube_cluster_master_user -%> } - its('master_auth.password') { should eq <%= gcp_kube_cluster_master_pass -%> } end describe google_container_cluster(project: <%= gcp_project_id -%>, location: <%= gcp_kube_cluster_zone -%>, name: 'nonexistent') do diff --git a/templates/inspec/examples/google_container_cluster/google_container_cluster_attributes.erb b/templates/inspec/examples/google_container_cluster/google_container_cluster_attributes.erb index 48eb8a7d68c4..c0a43756537c 100644 --- a/templates/inspec/examples/google_container_cluster/google_container_cluster_attributes.erb +++ b/templates/inspec/examples/google_container_cluster/google_container_cluster_attributes.erb @@ -4,5 +4,4 @@ gcp_kube_cluster_zone = attribute(:gcp_kube_cluster_zone, default: '<%= external gcp_kube_cluster_size = attribute(:gcp_kube_cluster_size, default: '<%= external_attribute('gcp_kube_cluster_size') -%>', description: 'GCP container cluster size') gcp_kube_cluster_zone_extra1 = attribute(:gcp_kube_cluster_zone_extra1, default: '<%= external_attribute('gcp_kube_cluster_zone_extra1') -%>', description: 'First extra zone for the cluster') gcp_kube_cluster_zone_extra2 = attribute(:gcp_kube_cluster_zone_extra2, default: '<%= external_attribute('gcp_kube_cluster_zone_extra2') -%>', description: 'Second extra zone for the cluster') -gcp_kube_cluster_master_user = attribute(:gcp_kube_cluster_master_user, default: '<%= external_attribute('gcp_kube_cluster_master_user') -%>', description: 'GCP container cluster admin username') -gcp_kube_cluster_master_pass = attribute(:gcp_kube_cluster_master_pass, default: '<%= external_attribute('gcp_kube_cluster_master_pass') -%>', description: 'GCP container cluster admin password') \ No newline at end of file +gcp_kube_cluster_master_user = attribute(:gcp_kube_cluster_master_user, default: '<%= external_attribute('gcp_kube_cluster_master_user') -%>', description: 'GCP container cluster admin username') \ No newline at end of file diff --git a/third_party/inspec/custom_functions/google_compute_firewall.erb b/third_party/inspec/custom_functions/google_compute_firewall.erb index 921790963b79..e8d64416e910 100644 --- a/third_party/inspec/custom_functions/google_compute_firewall.erb +++ b/third_party/inspec/custom_functions/google_compute_firewall.erb @@ -177,6 +177,6 @@ def single_port_matches(rule_port, single_port) end def log_config_enabled? - return false if !defined?(log_config) || !defined?(log_config.enable) - log_config.enable + return false if !defined?(log_config) || !defined?(log_config.enable_logging) + log_config.enable_logging end \ No newline at end of file