generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
Labels
area/code-generationIssues or PRs as related to controllers or docs code generationIssues or PRs as related to controllers or docs code generationkind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
Describe the bug
ack-generate doesn't generate a complete "merge" logic in sdkFind when one the CRD fields is renamed, and the related API call returns a list of objects (e.g ecr.DescribeRepositories)
Steps to reproduce
Regenerate ECR controller with the following configuration
resources:
Repository:
renames:
operations:
CreateRepository:
input_fields:
RepositoryName: Name
Note the following diff
$ git diff main
@@ -108,16 +109,6 @@ func (rm *resourceManager) sdkFind(
tmpARN := ackv1alpha1.AWSResourceName(*elem.RepositoryArn)
ko.Status.ACKResourceMetadata.ARN = &tmpARN
}
- if elem.RepositoryName != nil {
- if ko.Spec.RepositoryName != nil {
- if *elem.RepositoryName != *ko.Spec.RepositoryName {
- continue
- }
- }
- ko.Spec.RepositoryName = elem.RepositoryName
- } else {
- ko.Spec.RepositoryName = nil
- }
if elem.RepositoryUri != nil {
ko.Status.RepositoryURI = elem.RepositoryUri
} else {Expected outcome
The delete block of code should be changed to something like instead:
if elem.RepositoryName != nil {
if ko.Spec.Name != nil {
if *elem.RepositoryName != *ko.Spec.Name {
continue
}
}
ko.Spec.Name = elem.RepositoryName
} else {
ko.Spec.Name = nil
}Metadata
Metadata
Assignees
Labels
area/code-generationIssues or PRs as related to controllers or docs code generationIssues or PRs as related to controllers or docs code generationkind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.