Skip to content

Instantly share code, notes, and snippets.

@ziporah
Created May 24, 2019 09:08
Show Gist options
  • Save ziporah/b927628247ded05e76d07b383a7a0db0 to your computer and use it in GitHub Desktop.
Save ziporah/b927628247ded05e76d07b383a7a0db0 to your computer and use it in GitHub Desktop.
docker run --rm -it \
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=/cft/workdir/credentials.json \
-e GOOGLE_APPLICATION_CREDENTIALS=/cft/workdir/credentials.json \
-v /home/jo/development/github.com/ziporah/gce-container:/cft/workdir \
gcr.io/cloud-foundation-cicd/cft/kitchen-terraform:2.0.0 \
/bin/bash -c "kitchen verify"
Activated service account credentials for: [---]
-----> Starting Kitchen (v1.24.0)
-----> Converging <simple-instance-local>...
$$$$$$ Verification of support for the available version of Terraform is disabled
$$$$$$ Running command `terraform workspace select kitchen-terraform-simple-instance-local` in directory /cft/workdir/test/fixtures/simple_instance
$$$$$$ Running command `terraform get -update` in directory /cft/workdir/test/fixtures/simple_instance
- example in ../../../examples/simple_instance
- example.gce-container in ../../..
$$$$$$ Running command `terraform validate ` in directory /cft/workdir/test/fixtures/simple_instance
Success! The configuration is valid.
$$$$$$ Running command `terraform apply -lock=true -lock-timeout=0s -input=false -auto-approve=true -parallelism=10 -refresh=true ` in directory /cft/workdir/test/fixtures/simple_instance
module.example.module.gce-container.data.external.spec_as_yaml: Refreshing state...
module.example.data.google_compute_zones.available: Refreshing state...
module.example.module.gce-container.data.google_compute_image.coreos: Refreshing state...
random_string.suffix: Creating...
module.example.random_shuffle.zone: Creating...
module.example.random_shuffle.zone: Creation complete after 0s [id=-]
random_string.suffix: Creation complete after 0s [id=none]
google_compute_network.main: Creating...
google_compute_network.main: Still creating... [10s elapsed]
google_compute_network.main: Creation complete after 16s [id=cft-container-vm-test-simple-iqvq]
google_compute_subnetwork.main: Creating...
google_compute_subnetwork.main: Still creating... [10s elapsed]
google_compute_subnetwork.main: Creation complete after 17s [id=europe-west1/cft-container-vm-test-simple-iqvq]
google_compute_firewall.ssh: Creating...
module.example.google_compute_instance.vm: Creating...
google_compute_firewall.ssh: Creation complete after 8s [id=cft-test-iqvq-simple-ssh]
module.example.google_compute_instance.vm: Still creating... [10s elapsed]
module.example.google_compute_instance.vm: Creation complete after 18s [id=cft-test-simple-iqvq]
Apply complete! Resources: 6 added, 0 changed, 0 destroyed.
Outputs:
container = {
"env" = [
{
"name" = "TEST_VAR"
"value" = "Hello World!"
},
]
"image" = "gcr.io/google-samples/hello-app:1.0"
"volumeMounts" = [
{
"mountPath" = "/cache"
"name" = "tempfs-0"
"readOnly" = "false"
},
]
}
instance_name = cft-test-simple-iqvq
ipv4 =
network = cft-container-vm-test-simple-iqvq
project_id = prj-pte-ops-dev-6724
subnetwork = cft-container-vm-test-simple-iqvq
vm_container_label = cos-stable-74-11895-86-0
volumes = [
{
"emptyDir" = {
"medium" = "Memory"
}
"name" = "tempfs-0"
},
]
zone = europe-west1-c
Finished converging <simple-instance-local> (0m58.64s).
-----> Setting up <simple-instance-local>...
Finished setting up <simple-instance-local> (0m0.00s).
-----> Verifying <simple-instance-local>...
$$$$$$ Running command `terraform workspace select kitchen-terraform-simple-instance-local` in directory /cft/workdir/test/fixtures/simple_instance
$$$$$$ Running command `terraform output -json` in directory /cft/workdir/test/fixtures/simple_instance
system: Verifying
Profile: simple_instance
Version: (not specified)
Target: local://
✔ gce: Google Compute Engine instance configuration
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` is in a running state
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` is in the correct network
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` is in the correct subnetwork
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` is the expected machine type
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` has the expected labels
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` is configured with the expected container(s), volumes, env and restart policy
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` exit_status should equal 0
✔ Command: `gcloud --project=prj-pte-ops-dev-6724 compute instances describe cft-test-simple-iqvq --zone=europe-west1-c --format json` stderr should eq ""
Profile Summary: 1 successful control, 0 control failures, 0 controls skipped
Test Summary: 8 successful, 0 failures, 0 skipped
Finished verifying <simple-instance-local> (0m2.19s).
-----> Converging <instance-with-attached-disk-local>...
$$$$$$ Verification of support for the available version of Terraform is disabled
$$$$$$ Running command `terraform workspace select kitchen-terraform-instance-with-attached-disk-local` in directory /cft/workdir/test/fixtures/instance_with_attached_disk
$$$$$$ Running command `terraform get -update` in directory /cft/workdir/test/fixtures/instance_with_attached_disk
- example in ../../../examples/instance_with_attached_disk
- example.gce-container in ../../..
$$$$$$ Running command `terraform validate ` in directory /cft/workdir/test/fixtures/instance_with_attached_disk
Error: Could not satisfy plugin requirements
Plugin reinitialization required. Please run "terraform init".
Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.
Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints from each module, run "terraform providers".
Error: provider.google: new or changed plugin executable
-----> Converging <managed-instance-group-local>...
$$$$$$ Verification of support for the available version of Terraform is disabled
$$$$$$ Running command `terraform workspace select kitchen-terraform-managed-instance-group-local` in directory /cft/workdir/test/fixtures/managed_instance_group
$$$$$$ Running command `terraform get -update` in directory /cft/workdir/test/fixtures/managed_instance_group
- example in ../../../examples/managed_instance_group
- example.gce-container in ../../..
Downloading github.com/GoogleCloudPlatform/terraform-google-lb-http for example.http-lb...
- example.http-lb in .terraform/modules/example.http-lb
Downloading GoogleCloudPlatform/managed-instance-group/google 1.1.14 for example.mig...
- example.mig in .terraform/modules/example.mig/GoogleCloudPlatform-terraform-google-managed-instance-group-7550567
$$$$$$ Running command `terraform validate ` in directory /cft/workdir/test/fixtures/managed_instance_group
Error: Could not satisfy plugin requirements
Plugin reinitialization required. Please run "terraform init".
Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.
Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints from each module, run "terraform providers".
Error: provider.google: new or changed plugin executable
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 2 actions failed.
>>>>>> Converge failed on instance <instance-with-attached-disk-local>. Please see .kitchen/logs/instance-with-attached-disk-local.log for more details
>>>>>> Converge failed on instance <managed-instance-group-local>. Please see .kitchen/logs/managed-instance-group-local.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
Makefile:120: recipe for target 'docker_verify' failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment