Skip to content
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

[WIP] Taint and resource address #12224

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b1f57f6
make use of resource address inside of taint command
huydinhle Feb 23, 2017
c6104f0
change the method's name to get Resource state from State
Feb 23, 2017
4a0e1f9
Merge branch 'master' into taint-and-resource-address
Feb 23, 2017
43c7bd6
fix sorting of module resources during state mv
jbardin Feb 23, 2017
10fb3e6
Merge github.com:huydinhle/terraform into taint-and-resource-address
huydinhle Feb 24, 2017
b5548f7
added a check for negative index of resource address
Feb 24, 2017
6ae28cf
Merge branch 'taint-and-resource-address' of github.com:huydinhle/ter…
huydinhle Feb 24, 2017
6fcd5c0
fixed the awesome unit tests terraform has
huydinhle Feb 24, 2017
ddf7226
clean up module variable, and make GetResource Method only use 2 para…
huydinhle Feb 24, 2017
9006e74
added comment into GetResourceStateFromResourceAddress method
huydinhle Feb 24, 2017
e22d409
added one test for taint command when index of the resource is involved
huydinhle Feb 24, 2017
4423d39
added unit tests for our state.go new method GetResourceStateFromReso…
huydinhle Feb 24, 2017
d6eb7c8
one test was relying on out-of-order output
jbardin Feb 24, 2017
82914b5
Merge pull request #12219 from hashicorp/jbardin/state-mv-sort
jbardin Feb 24, 2017
49cca8d
Fix typo in CHANGELOG.md
pmuller Feb 24, 2017
8ce8839
vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230)
radeksimko Feb 24, 2017
6fd891f
Make sure all azure-sdk packages match
jbardin Feb 24, 2017
7bb3e5d
fix aws-sdk in vendor.json
jbardin Feb 24, 2017
359170d
sync scaleway packages
jbardin Feb 24, 2017
4d26874
fix checksum for http-link-go package
jbardin Feb 24, 2017
5b90087
ssh and curve25519 vendoring
jbardin Feb 24, 2017
065e159
remove gotty-client ... again
jbardin Feb 24, 2017
0220b83
remove scaleway-cli package with borken deps
jbardin Feb 24, 2017
1c50c53
check vendor status in travis
jbardin Feb 24, 2017
79e13b9
remove the docker packages that aren't needed
jbardin Feb 24, 2017
38748f0
Merge pull request #12236 from hashicorp/jbardin/vendor
jbardin Feb 24, 2017
43f62d2
always quote hcl map keys
jbardin Feb 24, 2017
d596d6e
Revert "always quote hcl map keys"
jbardin Feb 24, 2017
71c541c
always quote hcl map keys
jbardin Feb 24, 2017
8038937
Fix the Push test outputs
jbardin Feb 24, 2017
fd2ea3c
remove log.Fatal from test
jbardin Feb 24, 2017
6e9e610
Merge pull request #12245 from hashicorp/jbardin/hcl-encode
jbardin Feb 25, 2017
f1be6cb
Merge pull request #12246 from hashicorp/jbardin/local-exec-test
jbardin Feb 25, 2017
72da290
provider/aws: Fix error message returned when an invalid SSM document…
ericwestfall Feb 25, 2017
a7078ad
provider/aws: Fix argument reference for aws_ssm_document resource; c…
ericwestfall Feb 25, 2017
9d4a423
make use of resource address inside of taint command
huydinhle Feb 23, 2017
364fcdd
change the method's name to get Resource state from State
Feb 23, 2017
32c4921
added a check for negative index of resource address
Feb 24, 2017
02f4c8c
fixed the awesome unit tests terraform has
huydinhle Feb 24, 2017
bae5fca
clean up module variable, and make GetResource Method only use 2 para…
huydinhle Feb 24, 2017
75f58bb
added comment into GetResourceStateFromResourceAddress method
huydinhle Feb 24, 2017
9ff99e2
added one test for taint command when index of the resource is involved
huydinhle Feb 24, 2017
b11f655
added unit tests for our state.go new method GetResourceStateFromReso…
huydinhle Feb 24, 2017
4b7a53c
Merge branch 'taint-and-resource-address' of github.com:huydinhle/ter…
Feb 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install:
- bash scripts/gogetcookie.sh
- go get github.com/kardianos/govendor
script:
- make vet test
- make vet vendor-status test
- GOOS=windows go build
branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ FEATURES:
no more local caching of remote state, and more. ([#11286](https://github.com/hashicorp/terraform/issues/11286))
* **Destroy Provisioners:** Provisioners can now be configured to run
on resource destruction. ([#11329](https://github.com/hashicorp/terraform/issues/11329))
* **State Locking:** State will be autuomatically locked when supported by the backend.
* **State Locking:** State will be automatically locked when supported by the backend.
Backends supporting locking in this release are Local, S3 (via DynamoDB), and Consul. ([#11187](https://github.com/hashicorp/terraform/issues/11187))

IMPROVEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_ssm_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func validateAwsSSMDocumentType(v interface{}, k string) (ws []string, errors []
}

if !types[value] {
errors = append(errors, fmt.Errorf("CodeBuild: Arifacts Namespace Type can only be NONE / BUILD_ID"))
errors = append(errors, fmt.Errorf("Document type %s is invalid. Valid types are Command, Policy or Automation", value))
}
return
}
5 changes: 2 additions & 3 deletions builtin/provisioners/local-exec/resource_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package localexec

import (
"io/ioutil"
"log"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -65,8 +64,8 @@ func TestResourceProvider_stop(t *testing.T) {

select {
case <-doneCh:
case <-time.After(500 * time.Millisecond):
log.Fatal("should finish")
case <-time.After(2 * time.Second):
t.Fatal("should finish")
}
}

Expand Down
2 changes: 1 addition & 1 deletion command/hcl_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (e *encodeState) encodeMap(m map[string]interface{}) error {
for i, k := range sortedKeys(m) {
v := m[k]

e.WriteString(k + " = ")
e.WriteString(fmt.Sprintf("%q = ", k))
err := e.encode(v)
if err != nil {
return err
Expand Down
52 changes: 52 additions & 0 deletions command/hcl_printer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package command

import "testing"

// The command package has it's own HCL encoder to encode variables to push.
// Make sure the variable we encode parse correctly
func TestHCLEncoder_parse(t *testing.T) {
cases := []struct {
Name string
Val interface{}
Error bool
}{
{
Name: "int",
Val: 12345,
},
{
Name: "float",
Val: 1.2345,
},
{
Name: "string",
Val: "terraform",
},
{
Name: "list",
Val: []interface{}{"a", "b", "c"},
},
{
Name: "map",
Val: map[string]interface{}{
"a": 1,
},
},
// a numeric looking identifier requires quotes
{
Name: "map_with_quoted_key",
Val: map[string]interface{}{
"0.0.0.0/24": "mask",
},
},
}

for _, c := range cases {
t.Run(c.Name, func(t *testing.T) {
_, err := encodeHCL(c.Val)
if err != nil {
t.Fatal(err)
}
})
}
}
3 changes: 2 additions & 1 deletion command/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,11 +761,12 @@ func testArchiveStr(t *testing.T, path string) []string {
return result
}

// we always quote map keys to be safe
func pushTFVars() []atlas.TFVar {
return []atlas.TFVar{
{Key: "bar", Value: "foo", IsHCL: false},
{Key: "baz", Value: `{
A = "a"
"A" = "a"
}`, IsHCL: true},
{Key: "fob", Value: `["a", "quotes \"in\" quotes"]`, IsHCL: true},
{Key: "foo", Value: "bar", IsHCL: false},
Expand Down
Loading