Add Pipes Resource#1
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.
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.
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.
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
7bceb14 to
8a1fcaa
Compare
d4f4f81 to
ca538b3
Compare
980a59a to
2fa02eb
Compare
jaypipes
left a comment
There was a problem hiding this comment.
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.
Any reason we're going back 9 releases?
| - 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.
You can just use my full name here. ;)
There was a problem hiding this comment.
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.
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.
A better hack by the great EventBridge "Jay" Pipes
There was a problem hiding this comment.
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.
|
@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
|
Awesome, thx a ton for your help throughout these EDA controllers :) |
| // _____ _ _____ _ _____ ____ ____ _ ____ _____ _____ | ||
| // / __// \ |\/ __// \ /|/__ __\/ _ \/ __\/ \/ _ \/ __// __/ | ||
| // | \ | | //| \ | |\ || / \ | | //| \/|| || | \|| | _| \ | ||
| // | /_ | \// | /_ | | \|| | | | |_\\| /| || |_/|| |_//| /_ | ||
| // \____\\__/ \____\\_/ \| \_/ \____/\_/\_\\_/\____/\____\\____\ | ||
| // | ||
| // _ _ _ ____ ___ __ _ ____ _ ____ _____ ____ | ||
| // \||/ / |/ _ \\ \//\||/ / __\/ \/ __\/ __// ___\ | ||
| // | || / \| \ / | \/|| || \/|| \ | \ | ||
| // /\_| || |-|| / / | __/| || __/| /_ \___ | | ||
| // \____/\_/ \|/_/ \_/ \_/\_/ \____\\____/ | ||
|
|
There was a problem hiding this comment.
🤣 Your friendly 24/7 support
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 DetailsNeeds 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.