-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Implement library for topology mutation hooks implementation #7413
✨ Implement library for topology mutation hooks implementation #7413
Conversation
@@ -336,7 +336,7 @@ func (c *client) CallExtension(ctx context.Context, hook runtimecatalog.Hook, fo | |||
} | |||
|
|||
log.Info(fmt.Sprintf("Calling extension handler %q", name)) | |||
var timeoutDuration time.Duration | |||
timeoutDuration := runtimehooksv1.DefaultHandlersTimeoutSeconds * time.Second |
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.
This is consistent with what declared in the API
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 think we can actaully dorp this nil check here. Becasue of the defaulting we have in discovery response this value can never be nill.
We should use this value runtimehooksv1.DefaultHandlersTimeoutSeconds
at l.622 to set the default value.
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.
fixed line 622
I think we should left the defaulting here even if it is redundant (thinking to clusterctl alpha plan, where we are going to use a "hacky version" if discovery)
} | ||
aggregatedResponse.SetMessage(strings.Join(messages, ", ")) |
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 know we want back and forth on this but if the extension's errors do not surface the UX degrades a lot.
So I'm proposing to surface errors, document guidelines for error messages, and take time to implement a protection mechanism for flickering conditions
docs/book/src/tasks/experimental-features/runtime-sdk/implement-extensions.md
Outdated
Show resolved
Hide resolved
docs/book/src/tasks/experimental-features/runtime-sdk/implement-extensions.md
Outdated
Show resolved
Hide resolved
docs/book/src/tasks/experimental-features/runtime-sdk/implement-topology-mutation-hook.md
Outdated
Show resolved
Hide resolved
@@ -336,7 +336,7 @@ func (c *client) CallExtension(ctx context.Context, hook runtimecatalog.Hook, fo | |||
} | |||
|
|||
log.Info(fmt.Sprintf("Calling extension handler %q", name)) | |||
var timeoutDuration time.Duration | |||
timeoutDuration := runtimehooksv1.DefaultHandlersTimeoutSeconds * time.Second |
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 think we can actaully dorp this nil check here. Becasue of the defaulting we have in discovery response this value can never be nill.
We should use this value runtimehooksv1.DefaultHandlersTimeoutSeconds
at l.622 to set the default value.
f16942c
to
0f042d5
Compare
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.
Great work
docs/book/src/tasks/experimental-features/runtime-sdk/implement-extensions.md
Show resolved
Hide resolved
docs/book/src/tasks/experimental-features/runtime-sdk/implement-topology-mutation-hook.md
Show resolved
Hide resolved
/retest |
docs/book/src/tasks/experimental-features/runtime-sdk/implement-extensions.md
Outdated
Show resolved
Hide resolved
lgtm pending #7413 (comment) + squash |
05038a9
to
b6e824c
Compare
Thx! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
What this PR does / why we need it:
This PR moves some of the utilities from our test extension into a library that every Runtime extension author can use.
It also adds comments to the test extension so all the implementation choices are explained and the Runtime extension authors can use it as a reference implementation for their own extension
Which issue(s) this PR fixes:
Fixes #