-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with workload_meta_config.mode matcher #410
Comments
Basic POC that shows this against current trunk as well. title "GKE Nodepool test"
gcp_project_id = input("gcp_project_id")
gke_cluster = input("gke_cluster")
gke_cluster_location = input("gke_cluster_location")
gke_nodepool_name = input("gke_nodepool_name")
# you add controls here
control "gke-cluster-1.0" do
impact 1.0
title "Ensure cluster exists."
desc "Testing"
describe google_container_cluster(project: gcp_project_id, name: gke_cluster, location: gke_cluster_location) do
it { should exist }
end
describe google_container_node_pool(project: gcp_project_id, nodepool_name: gke_nodepool_name, cluster_name: gke_cluster, location: gke_cluster_location) do
it { should exist }
its('config.workload_meta_config.mode') { should be_in %w[GCE_METADATA GKE_METADATA] }
end
end
dumping out the config object, it's got:
the GCP CLI also shows config:
workloadMetadataConfig:
mode: GKE_METADATA |
Woo! thanks @sa-progress! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
I've got a situation where
workloadMetadataConfig.mode
is set toGKE_METADATA
, and yet theworkload_meta_config.mode
matcher seesm to be nil. This is using a slightly older version of this that's vendored in with https://github.com/GoogleCloudPlatform/inspec-gcp-helpers, so I can try to doublecheck if this issue affects the latest version as well.Described in more detail at:
GoogleCloudPlatform/inspec-gke-cis-benchmark#30
Possible Solution
The text was updated successfully, but these errors were encountered: