-
Notifications
You must be signed in to change notification settings - Fork 89
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
Include full state under status.atProvider #164
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.
Thanks @turkenh. Left some comments for you to consider.
@@ -277,6 +277,12 @@ func (r *resource) addParameterField(f *Field, field *types.Var) { | |||
} | |||
|
|||
func (r *resource) addObservationField(f *Field, field *types.Var) { | |||
for _, obsF := range r.obsFields { | |||
if obsF.Name() == field.Name() { | |||
// If the field is already added, we don't add it again. |
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.
Why do observation fields get added multiple times? Is it related to this code segment? The comment above that segment states that it prevents elimination of fields in the observation type. If we are unconditionally adding every field as an observation field, can we remove that segment? And if we did so, would we still need this duplication check?
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.
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.
I added a comment on where those previous additions are coming from.
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.
Thank you @turkenh for giving it a try. I believe we can rename those types if desired in a future PR once we understand the implications as they are now shared between spec.forProvider
and status.atProvider
, when the status.atProvider
becomes a superset.
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.
Signed-off-by: Hasan Turken <[email protected]>
Signed-off-by: Hasan Turken <[email protected]>
Signed-off-by: Hasan Turken <[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.
Thank you @turkenh, lgtm.
Description of your changes
This PR changes schema generation to include the entire state under
status.atProvider
as proposed in the Observe Only design doc. In other words,status.atProvider
will become superset ofspec.forProvider
.I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
See this PR crossplane-contrib/provider-upjet-aws#571