-
Notifications
You must be signed in to change notification settings - Fork 226
include Spec fields in GetAttributes SetResource #380
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please mention in the PR description how we could go about reproducing the compilation error(s) that prompted this change? Which version of code-generator
and which controller?
done! :) |
Attempting to generate the SNS controller with code-generator <= v0.21.0 results in various `make test` failures that look like this: ``` [jaypipes@thelio sns-controller]$ make test go test -v ./... ? github.com/aws-controllers-k8s/sns-controller/apis/v1alpha1 [no test files] pkg/resource/topic/sdk.go:225:8: undefined: err pkg/resource/platform_application/sdk.go:75:6: resp declared but not used pkg/resource/platform_application/sdk.go:217:8: undefined: err pkg/resource/platform_endpoint/sdk.go:75:6: resp declared but not used pkg/resource/platform_endpoint/sdk.go:113:48: r.ko.Spec.EndpointARN undefined (type "github.com/aws-controllers-k8s/sns-controller/apis/v1alpha1".PlatformEndpointSpec has no field or method EndpointARN) pkg/resource/platform_endpoint/sdk.go:202:8: undefined: err pkg/resource/platform_endpoint/sdk.go:270:48: r.ko.Spec.EndpointARN undefined (type "github.com/aws-controllers-k8s/sns-controller/apis/v1alpha1".PlatformEndpointSpec has no field or method EndpointARN) make: *** [Makefile:19: test] Error 2 ``` We were not including Spec fields in the processing of SetResourceGetAttributes, which resulted in a bunch of `resp variable declared and not used` compile-time failures. This patch fixes that by pulling attributes from the resulting Attributes map into Spec fields when the field is_read_only=false. In addition, fixes the template for sdk_update_set_attributes to declare an `err` variable before referencing it. Signed-off-by: Jay Pipes <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm :)
@jaypipes: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alles gut!
/retest
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Attempting to generate the SNS controller with code-generator <=
v0.21.0 results in various
make test
failures that look like this:We were not including Spec fields in the processing of
SetResourceGetAttributes, which resulted in a bunch of
resp variable declared and not used
compile-time failures. This patch fixes that bypulling attributes from the resulting Attributes map into Spec fields
when the field is_read_only=false.
In addition, fixes the template for sdk_update_set_attributes to declare
an
err
variable before referencing it.Signed-off-by: Jay Pipes [email protected]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.