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

grammar tense issue ran -> run #5538

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,14 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
t.Logf("actual terraform output in %s", actualPath)
}

if os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") != "" {
fp := path.Join(srcDir, expectedCfPath)
t.Logf("HACK_UPDATE_EXPECTED_IN_PLACE: writing expected output %s", fp)
if err := ioutil.WriteFile(fp, actualCF, 0644); err != nil {
t.Errorf("error writing expected output file %q: %v", fp, err)
}
}

t.Fatalf("cloudformation output differed from expected. Test file: %s", path.Join(srcDir, expectedCfPath))
}

Expand Down
4 changes: 2 additions & 2 deletions docs/iam_roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ Now run a cluster update to create the new launch configuration, using [lifecycl
kops update cluster ${CLUSTER_NAME} --yes --lifecycle-overrides IAMRole=ExistsAndWarnIfChanges,IAMRolePolicy=ExistsAndWarnIfChanges,IAMInstanceProfileRole=ExistsAndWarnIfChanges
```

*Everytime `kops update cluster` is ran, it must include the above `--lifecycle-overrides` unless a non-`security` phase is specified.*
*Everytime `kops update cluster` is run, it must include the above `--lifecycle-overrides` unless a non-`security` phase is specified.*

Finally, perform a rolling update in order to replace EC2 instances in the ASG with the new launch configuration:

```
kops rolling-update cluster ${CLUSTER_NAME} --yes
```
```
4 changes: 1 addition & 3 deletions pkg/model/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package model
import (
"encoding/json"
"fmt"
"reflect"
"strings"
"text/template"

Expand Down Expand Up @@ -168,10 +167,9 @@ func (b *IAMModelBuilder) buildIAMTasks(igRole kops.InstanceGroupRole, iamName s
{
additionalPolicy := ""
if b.Cluster.Spec.AdditionalPolicies != nil {
roleAsString := reflect.ValueOf(igRole).String()
additionalPolicies := *(b.Cluster.Spec.AdditionalPolicies)

additionalPolicy = additionalPolicies[strings.ToLower(roleAsString)]
additionalPolicy = additionalPolicies[strings.ToLower(string(igRole))]
}

additionalPolicyName := "additional." + iamName
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/templater/templater.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func indentContent(indent int, content string) string {
return b.String()
}

// includenSnippet is responsible for including a snippet
// includeSnippet is responsible for including a snippet
func includeSnippet(tm *template.Template, name string, context map[string]interface{}) (string, error) {
b := bytes.NewBufferString("")
if err := tm.ExecuteTemplate(b, name, context); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,31 @@
]
}
},
"AWSIAMPolicyadditionalmastersadditionaluserdataexamplecom": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "additional.masters.additionaluserdata.example.com",
"Roles": [
{
"Ref": "AWSIAMRolemastersadditionaluserdataexamplecom"
}
],
"PolicyDocument": {
"Statement": [
{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::somebucket/someobject"
]
}
],
"Version": "2012-10-17"
}
}
},
"AWSIAMPolicymastersadditionaluserdataexamplecom": {
"Type": "AWS::IAM::Policy",
"Properties": {
Expand Down Expand Up @@ -840,4 +865,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: additionaluserdata.example.com
spec:
additionalPolicies:
master: |
[
{
"Action": [ "s3:GetObject" ],
"Resource": [ "arn:aws:s3:::somebucket/someobject" ],
"Effect": "Allow"
}
]
kubernetesApiAccess:
- 0.0.0.0/0
channel: stable
Expand Down