-
Notifications
You must be signed in to change notification settings - Fork 6
Add Pipes Resource
#1
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
6475e0a to
86df0fa
Compare
|
I'll split the two commits into two PRs as discussed with @a-hilaly |
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
c9f710e to
9c34d77
Compare
|
|
||
| // hasNilDifference returns true if the supplied subjects' nilness is | ||
| // different | ||
| func hasNilDifference(a, b interface{}) bool { |
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.
99% copy and paste from runtime and code-gen because we need to treat empty struct responses as nil :/
Changing this in the runtime would very likely lead to breaking changes.
| client_interface: PipesAPI | ||
| resources: | ||
| Pipe: | ||
| fields: |
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.
Let me know if we need custom compare for tags as per API def they're a map type (which I guess you'd consider non-deterministic) -> Tags.
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.
Just added one :)
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
7bceb14 to
8a1fcaa
Compare
d4f4f81 to
ca538b3
Compare
980a59a to
2fa02eb
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.
I'm almost there on this one. I do, however, think it would be best to rename Spec.DesiredState to just Spec.State and ignore the Status.CurrentState field path (see note inline...
go.mod
Outdated
| require ( | ||
| github.com/aws-controllers-k8s/runtime v0.24.1 | ||
| github.com/aws/aws-sdk-go v1.44.218 | ||
| github.com/aws/aws-sdk-go v1.44.209 |
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.
Any reason we're going back 9 releases?
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
| - name: ACK Admins | ||
| url: https://github.com/orgs/aws-controllers-k8s/teams/ack-admin | ||
| - name: Admins | ||
| - name: Pipes Admins |
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.
You can just use my full name 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.
Sure you can handle that :-p ?
| // hack (by the great @a-hilaly): forces a requeue in update if currentState != desiredState to reconcile | ||
| // and update status fields in Kubernetes resource e.g., in case of UPDATE_FAILED | ||
| if *bDesiredState != *b.ko.Status.CurrentState { | ||
| // setting Spec. because Status. is not considered in delta logic | ||
| delta.Add("Spec.CurrentState", *bDesiredState, *b.ko.Status.CurrentState) | ||
| } |
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.
Instead of doing this, you could rename the DesiredState field to just State, then ignore the CreatePipeOutput.CurrentState field path and in the sdk_read_one_post_set_output code hook, simply do:
if resp.CurrentState != nil {
ko.Spec.State = resp.CurrentState
}then the standard comparison logic would be just fine.
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.
A better hack by the great EventBridge "Jay" Pipes
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.
The only concern I have here is from a debugging pov since an operator could be confused a) by the field name and b) why this field name has a value which is not allowed as per API:
DesiredState
The state the pipe should be in.
Type: String
Valid Values: RUNNING | STOPPED
Required: No
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.
|
@jaypipes took me some time to think about this but I'm a little bit confused about why would we remove the |
88163f5 to
b27016b
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.
|
Awesome, thx a ton for your help throughout these EDA controllers :) |
| // _____ _ _____ _ _____ ____ ____ _ ____ _____ _____ | ||
| // / __// \ |\/ __// \ /|/__ __\/ _ \/ __\/ \/ _ \/ __// __/ | ||
| // | \ | | //| \ | |\ || / \ | | //| \/|| || | \|| | _| \ | ||
| // | /_ | \// | /_ | | \|| | | | |_\\| /| || |_/|| |_//| /_ | ||
| // \____\\__/ \____\\_/ \| \_/ \____/\_/\_\\_/\____/\____\\____\ | ||
| // | ||
| // _ _ _ ____ ___ __ _ ____ _ ____ _____ ____ | ||
| // \||/ / |/ _ \\ \//\||/ / __\/ \/ __\/ __// ___\ | ||
| // | || / \| \ / | \/|| || \/|| \ | \ | ||
| // /\_| || |-|| / / | __/| || __/| /_ \___ | | ||
| // \____/\_/ \|/_/ \_/ \_/\_/ \____\\____/ | ||
|
|
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.
🤣 Your friendly 24/7 support
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.
LOL :)
Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, embano1, jaypipes 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 |
Description of changes: Add
PipesResourceBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.