Skip to content

Commit de7d1d6

Browse files
authored
Merge pull request #19 from kopachevsky/feature/added-docker-env-section
added container env section
2 parents 1c4942d + 1b799e6 commit de7d1d6

File tree

7 files changed

+30
-3
lines changed

7 files changed

+30
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ test/fixtures/**/terraform.tfstate.d
55
test/fixtures/**/ssh/key
66
*.pyc
77
test/fixtures/shared/terraform.tfvars
8+
.idea

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Extending the adopted spec, each change should have a link to its corresponding
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- added docker environment variables section example [#19]
14+
1115
## [0.1.1]
1216

1317
### Fixed
@@ -22,4 +26,5 @@ Extending the adopted spec, each change should have a link to its corresponding
2226
[Unreleased]: https://github.com/terraform-google-modules/terraform-google-container-vm/compare/v0.1.1...HEAD
2327
[0.1.1]: https://github.com/terraform-google-modules/terraform-google-container-vm/compare/v0.1.0...v0.1.1
2428

29+
[#19]: https://github.com/terraform-google-modules/terraform-google-container-vm/pull/19
2530
[#17]: https://github.com/terraform-google-modules/terraform-google-container-vm/pull/17

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ module "gce-container" {
1313
1414
container = {
1515
image="gcr.io/google-samples/hello-app:1.0"
16-
16+
env = [
17+
{
18+
name = "TEST_VAR"
19+
value = "Hello World!"
20+
}
21+
],
1722
volumeMounts = [
1823
{
1924
mountPath = "/cache"

examples/instance_with_attached_disk/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ module "gce-container" {
2424
container = {
2525
image = "${var.image}"
2626

27+
env = [
28+
{
29+
name = "TEST_VAR"
30+
value = "Hello World!"
31+
},
32+
]
33+
2734
volumeMounts = [
2835
{
2936
mountPath = "/cache"

examples/simple_instance/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ module "gce-container" {
3434
container = {
3535
image = "gcr.io/google-samples/hello-app:1.0"
3636

37+
env = [
38+
{
39+
name = "TEST_VAR"
40+
value = "Hello World!"
41+
},
42+
]
43+
3744
volumeMounts = [
3845
{
3946
mountPath = "/cache"

test/integration/instance_with_attached_disk/controls/gce.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@
5959
expect(data['labels']['container-vm']).to eq vm_container_label
6060
end
6161

62-
it "is configured with the expected container(s), volumes, and restart policy" do
62+
it "is configured with the expected container(s), volumes, env and restart policy" do
6363
expect(container_declaration).to eq({
6464
"spec" => {
6565
"containers" => [
6666
{
6767
"image" => "gcr.io/google-samples/hello-app:1.0",
68+
"env"=>[{"name"=>"TEST_VAR", "value"=>"Hello World!"}],
6869
"volumeMounts" => [
6970
{
7071
"mountPath" => "/cache",

test/integration/simple_instance/controls/gce.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@
5959
expect(data['labels']['container-vm']).to eq vm_container_label
6060
end
6161

62-
it "is configured with the expected container(s), volumes, and restart policy" do
62+
it "is configured with the expected container(s), volumes, env and restart policy" do
6363
expect(container_declaration).to eq({
6464
"spec" => {
6565
"containers" => [
6666
{
67+
"env"=>[{"name"=>"TEST_VAR", "value"=>"Hello World!"}],
6768
"image" => "gcr.io/google-samples/hello-app:1.0",
6869
"volumeMounts" => [
6970
{

0 commit comments

Comments
 (0)