Skip to content

Commit

Permalink
Merge pull request #65 from tomaspinho/master
Browse files Browse the repository at this point in the history
Fix for issue #52 and potentially #62
  • Loading branch information
sl1pm4t authored Apr 23, 2020
2 parents 661e762 + c4f434f commit e8c0fd7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/tfkschema/name_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func init() {
inflection.AddSingular("resources", "resources")
inflection.AddSingular("requests", "requests")
inflection.AddSingular("imagePullSecrets", "imagePullSecrets")
inflection.AddSingular("capabilities", "capabilities")

inflection.AddUncountable("data")
inflection.AddUncountable("metadata")
Expand Down
10 changes: 9 additions & 1 deletion pkg/tfkschema/name_mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ func Test_NormalizeTerraformName(t *testing.T) {
},
"image_pull_secrets",
},

{
"capabilities",
args{
"capabilities",
true,
"",
},
"capabilities",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
6 changes: 6 additions & 0 deletions test-fixtures/deployment.tf.golden
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ resource "kubernetes_deployment" "backend_api" {
}
termination_message_path = "/dev/termination-log"
image_pull_policy = "IfNotPresent"
security_context {
capabilities {
add = ["NET_BIND_SERVICE"]
drop = ["ALL"]
}
}
}
container {
name = "api"
Expand Down
6 changes: 6 additions & 0 deletions test-fixtures/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ spec:
port: 443
timeoutSeconds: 1
resources: {}
securityContext:
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
Expand Down

0 comments on commit e8c0fd7

Please sign in to comment.