Skip to content

Commit 3dc7051

Browse files
committed
Safely assign resources to the sdk opType maps
While trying to re-generate controllers, we observed this rare error where the code-generator tries to assign a key/value into a nil map. Which is an illegal assignement... This should be handled now. Signed-off-by: Amine Hilaly <[email protected]>
1 parent d3b23cd commit 3dc7051

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/model/sdk_api.go

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func (a *SDKAPI) GetOperationMap(cfg *ackgenconfig.Config) *OperationMap {
111111
for _, operationType := range opCfg.OperationType {
112112
opType := OpTypeFromString(operationType)
113113
for _, resName := range opCfg.ResourceName {
114+
resMap, ok := opMap[opType]
115+
if !ok {
116+
resMap = map[string]*awssdkmodel.Operation{}
117+
opMap[opType] = resMap
118+
}
114119
opMap[opType][resName] = op
115120
}
116121
}

0 commit comments

Comments
 (0)