Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 1d657b4

Browse files
Adding Code Generated Files for Dynamo Updates
Signed-off-by: Christopher Hein <[email protected]>
1 parent a4318ff commit 1d657b4

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

pkg/apis/service-operator.aws/v1alpha1/dynamodb.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ type DynamoDB struct {
2121

2222
// DynamoDBHashAttribute defines the HashAttribute resource for DynamoDB
2323
type DynamoDBHashAttribute struct {
24-
Name string `json:"Name"`
25-
Type string `json:"Type"`
24+
Name string `json:"name"`
25+
Type string `json:"type"`
2626
}
2727

2828
// DynamoDBRangeAttribute defines the RangeAttribute resource for DynamoDB
2929
type DynamoDBRangeAttribute struct {
30-
Name string `json:"Name"`
31-
Type string `json:"Type"`
30+
Name string `json:"name"`
31+
Type string `json:"type"`
3232
}
3333

3434
// DynamoDBSpec defines the Spec resource for DynamoDB

pkg/operator/dynamodb/cft.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput
8181
namespace := helpers.CreateParam("Namespace", s.DynamoDB.Namespace)
8282
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
8383
tableName := helpers.CreateParam("TableName", helpers.Stringify(s.DynamoDB.Name))
84-
rangeAttributeNameTemp := "{{.Obj.Spec.RangeAttribute.Name}}"
85-
rangeAttributeNameValue, err := helpers.Templatize(rangeAttributeNameTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
84+
rangeAttributenameTemp := "{{.Obj.Spec.RangeAttribute.Name}}"
85+
rangeAttributenameValue, err := helpers.Templatize(rangeAttributenameTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
8686
if err != nil {
8787
return output, err
8888
}
89-
rangeAttributeName := helpers.CreateParam("RangeAttributeName", helpers.Stringify(rangeAttributeNameValue))
90-
rangeAttributeTypeTemp := "{{.Obj.Spec.RangeAttribute.Type}}"
91-
rangeAttributeTypeValue, err := helpers.Templatize(rangeAttributeTypeTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
89+
rangeAttributename := helpers.CreateParam("RangeAttributeName", helpers.Stringify(rangeAttributenameValue))
90+
rangeAttributetypeTemp := "{{.Obj.Spec.RangeAttribute.Type}}"
91+
rangeAttributetypeValue, err := helpers.Templatize(rangeAttributetypeTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
9292
if err != nil {
9393
return output, err
9494
}
95-
rangeAttributeType := helpers.CreateParam("RangeAttributeType", helpers.Stringify(rangeAttributeTypeValue))
95+
rangeAttributetype := helpers.CreateParam("RangeAttributeType", helpers.Stringify(rangeAttributetypeValue))
9696
readCapacityUnitsTemp := "{{.Obj.Spec.ReadCapacityUnits}}"
9797
readCapacityUnitsValue, err := helpers.Templatize(readCapacityUnitsTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
9898
if err != nil {
@@ -105,31 +105,31 @@ func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput
105105
return output, err
106106
}
107107
writeCapacityUnits := helpers.CreateParam("WriteCapacityUnits", helpers.Stringify(writeCapacityUnitsValue))
108-
hashAttributeNameTemp := "{{.Obj.Spec.HashAttribute.Name}}"
109-
hashAttributeNameValue, err := helpers.Templatize(hashAttributeNameTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
108+
hashAttributenameTemp := "{{.Obj.Spec.HashAttribute.Name}}"
109+
hashAttributenameValue, err := helpers.Templatize(hashAttributenameTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
110110
if err != nil {
111111
return output, err
112112
}
113-
hashAttributeName := helpers.CreateParam("HashAttributeName", helpers.Stringify(hashAttributeNameValue))
114-
hashAttributeTypeTemp := "{{.Obj.Spec.HashAttribute.Type}}"
115-
hashAttributeTypeValue, err := helpers.Templatize(hashAttributeTypeTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
113+
hashAttributename := helpers.CreateParam("HashAttributeName", helpers.Stringify(hashAttributenameValue))
114+
hashAttributetypeTemp := "{{.Obj.Spec.HashAttribute.Type}}"
115+
hashAttributetypeValue, err := helpers.Templatize(hashAttributetypeTemp, helpers.Data{Obj: s.DynamoDB, Config: s.config, Helpers: helpers.New()})
116116
if err != nil {
117117
return output, err
118118
}
119-
hashAttributeType := helpers.CreateParam("HashAttributeType", helpers.Stringify(hashAttributeTypeValue))
119+
hashAttributetype := helpers.CreateParam("HashAttributeType", helpers.Stringify(hashAttributetypeValue))
120120

121121
parameters := []*cloudformation.Parameter{}
122122
parameters = append(parameters, resourceName)
123123
parameters = append(parameters, resourceVersion)
124124
parameters = append(parameters, namespace)
125125
parameters = append(parameters, clusterName)
126126
parameters = append(parameters, tableName)
127-
parameters = append(parameters, rangeAttributeName)
128-
parameters = append(parameters, rangeAttributeType)
127+
parameters = append(parameters, rangeAttributename)
128+
parameters = append(parameters, rangeAttributetype)
129129
parameters = append(parameters, readCapacityUnits)
130130
parameters = append(parameters, writeCapacityUnits)
131-
parameters = append(parameters, hashAttributeName)
132-
parameters = append(parameters, hashAttributeType)
131+
parameters = append(parameters, hashAttributename)
132+
parameters = append(parameters, hashAttributetype)
133133

134134
stackInputs.SetParameters(parameters)
135135

@@ -170,18 +170,18 @@ func (s *Cloudformation) UpdateStack(updated *awsV1alpha1.DynamoDB) (output *clo
170170
namespace := helpers.CreateParam("Namespace", s.DynamoDB.Namespace)
171171
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
172172
tableName := helpers.CreateParam("TableName", helpers.Stringify(s.DynamoDB.Name))
173-
rangeAttributeNameTemp := "{{.Obj.Spec.RangeAttribute.Name}}"
174-
rangeAttributeNameValue, err := helpers.Templatize(rangeAttributeNameTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
173+
rangeAttributenameTemp := "{{.Obj.Spec.RangeAttribute.Name}}"
174+
rangeAttributenameValue, err := helpers.Templatize(rangeAttributenameTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
175175
if err != nil {
176176
return output, err
177177
}
178-
rangeAttributeName := helpers.CreateParam("RangeAttributeName", helpers.Stringify(rangeAttributeNameValue))
179-
rangeAttributeTypeTemp := "{{.Obj.Spec.RangeAttribute.Type}}"
180-
rangeAttributeTypeValue, err := helpers.Templatize(rangeAttributeTypeTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
178+
rangeAttributename := helpers.CreateParam("RangeAttributeName", helpers.Stringify(rangeAttributenameValue))
179+
rangeAttributetypeTemp := "{{.Obj.Spec.RangeAttribute.Type}}"
180+
rangeAttributetypeValue, err := helpers.Templatize(rangeAttributetypeTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
181181
if err != nil {
182182
return output, err
183183
}
184-
rangeAttributeType := helpers.CreateParam("RangeAttributeType", helpers.Stringify(rangeAttributeTypeValue))
184+
rangeAttributetype := helpers.CreateParam("RangeAttributeType", helpers.Stringify(rangeAttributetypeValue))
185185
readCapacityUnitsTemp := "{{.Obj.Spec.ReadCapacityUnits}}"
186186
readCapacityUnitsValue, err := helpers.Templatize(readCapacityUnitsTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
187187
if err != nil {
@@ -194,31 +194,31 @@ func (s *Cloudformation) UpdateStack(updated *awsV1alpha1.DynamoDB) (output *clo
194194
return output, err
195195
}
196196
writeCapacityUnits := helpers.CreateParam("WriteCapacityUnits", helpers.Stringify(writeCapacityUnitsValue))
197-
hashAttributeNameTemp := "{{.Obj.Spec.HashAttribute.Name}}"
198-
hashAttributeNameValue, err := helpers.Templatize(hashAttributeNameTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
197+
hashAttributenameTemp := "{{.Obj.Spec.HashAttribute.Name}}"
198+
hashAttributenameValue, err := helpers.Templatize(hashAttributenameTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
199199
if err != nil {
200200
return output, err
201201
}
202-
hashAttributeName := helpers.CreateParam("HashAttributeName", helpers.Stringify(hashAttributeNameValue))
203-
hashAttributeTypeTemp := "{{.Obj.Spec.HashAttribute.Type}}"
204-
hashAttributeTypeValue, err := helpers.Templatize(hashAttributeTypeTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
202+
hashAttributename := helpers.CreateParam("HashAttributeName", helpers.Stringify(hashAttributenameValue))
203+
hashAttributetypeTemp := "{{.Obj.Spec.HashAttribute.Type}}"
204+
hashAttributetypeValue, err := helpers.Templatize(hashAttributetypeTemp, helpers.Data{Obj: updated, Config: s.config, Helpers: helpers.New()})
205205
if err != nil {
206206
return output, err
207207
}
208-
hashAttributeType := helpers.CreateParam("HashAttributeType", helpers.Stringify(hashAttributeTypeValue))
208+
hashAttributetype := helpers.CreateParam("HashAttributeType", helpers.Stringify(hashAttributetypeValue))
209209

210210
parameters := []*cloudformation.Parameter{}
211211
parameters = append(parameters, resourceName)
212212
parameters = append(parameters, resourceVersion)
213213
parameters = append(parameters, namespace)
214214
parameters = append(parameters, clusterName)
215215
parameters = append(parameters, tableName)
216-
parameters = append(parameters, rangeAttributeName)
217-
parameters = append(parameters, rangeAttributeType)
216+
parameters = append(parameters, rangeAttributename)
217+
parameters = append(parameters, rangeAttributetype)
218218
parameters = append(parameters, readCapacityUnits)
219219
parameters = append(parameters, writeCapacityUnits)
220-
parameters = append(parameters, hashAttributeName)
221-
parameters = append(parameters, hashAttributeType)
220+
parameters = append(parameters, hashAttributename)
221+
parameters = append(parameters, hashAttributetype)
222222

223223
stackInputs.SetParameters(parameters)
224224

0 commit comments

Comments
 (0)