-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
internal/pkg/scaffold: add group.go scaffold to prevent deepcopy parse errors #1401
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.
LGTM
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.
Thanks for this!
Just curious would this have any effect on already existing operators when they add a new api? Otherwise lgtm!
@lilic @joelanford the SDK will scaffold |
…up> before scaffolding stub
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.
Makes sense. Still LGTM.
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.
Thanks for clarifying!! 👍
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.
As discussed offline I think it's better if we don't add a new scaffold just to suppress an upstream warning.
This is a noticeable change in a user's project and the reason for it will not be immediately obvious.
Plus if the warning is suppressed later on upstream then we will have this scaffold for no reason.
We should first check if it's possible to address this upstream. And if not then probably suppress it in our CLI.
If we look out for this exact warning then hopefully there shouldn't be any unintended side effects of suppressing other future warnings.
Either way adding a new scaffold for this should be a last resort if at all necessary.
@hasbro17 this is actually an "issue" with From one of the issue comments:
This is exactly what |
Coming back to this, while I was at the workshop a lot of users were super confused by the warning and came to me asking if this is a problem or not. So would be good to bypass this in a way, or suppress it just to avoid confusion IMHO. |
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 after nit since there's no other way to suppress this and it's causing confusion for end users.
@estroz Also mention this in the CHANGELOG in the Added section that we now scaffold group.go
so gengo warnings are suppressed.
It's a (minor) change visible to end users so it's best to point out why.
/test sanity |
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-sdk`, which generate exactly this file when scaffolding a new API. See: operator-framework/operator-sdk#1401 See: operator-framework/operator-sdk#1502 See: operator-framework/operator-sdk#1546
Description of the change: scaffold a
pkg/apis/<group>/group.go
file.Motivation for the change: The following error is generated by the gengo parser:
which doesn't look great. While we could skip reporting the error if it has that form, we might accidentally skip a valid error. Adding a package file to the group package corrects the error without any other changes.
Closes #1502, closes #1546