-
Notifications
You must be signed in to change notification settings - Fork 145
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
CON-7851\Register Lb validation handler #586
Conversation
PR to fix CI: #585 |
f8c98a4
to
f32aad7
Compare
c94c22b
to
522db10
Compare
4b0965e
to
5fe2f02
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'd appreciate if we could introduce a flag / environment variable at this point already that causes the webhook to not do anything (and log clearly about it) unless it is enabled specifically.
This is to guard against users eventually discovered our (unfinished) work and trying it out, possibly creating more tickets due to confusion.
cloud-controller-manager/cmd/digitalocean-cloud-controller-manager/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
5fe2f02
to
7571254
Compare
7571254
to
f6abbfb
Compare
go.mod
Outdated
@@ -4,7 +4,8 @@ go 1.19 | |||
|
|||
require ( | |||
github.com/davecgh/go-spew v1.1.1 | |||
github.com/digitalocean/godo v1.97.0 | |||
github.com/digitalocean/godo v1.97.1-0.20230308191258-ca2138d84446 |
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 should be 1.98. Change might've got lost in the rebase here. Pretty sure he had it at one point.
e2a673b
to
17d2f0c
Compare
82e0b0f
to
1718245
Compare
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
} | ||
|
||
err = v.decoder.DecodeRaw(req.OldObject, svc) | ||
if err != nil { |
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 IP would only be available once an LB is fully provisioned, so I'm not sure we can use that.
Can you check if status.loadBalancer.ingress
exists right after a managed LB is created? If it does even though the IP address is still missing, then we could use that as a trigger.
The other possibility is to check the LB ID annotation, though using something on the status should be a bit more reliable.
} | ||
|
||
err = v.decoder.DecodeRaw(req.OldObject, svc) | ||
if err != nil { |
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.
Can you answer this question of mine:
Is req.OldObject possibly nil when the Service is brand new?
4ce49ca
to
af13250
Compare
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
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.
We should also have a very clear note/disclaimer about the state of the web hook, i.e., that it is purely experimental yet. I suggest we
- add a README.md right next to the
main.go
file - add a loud and clear log message at the start of the webhook
- add a comment header in the
main.go
file
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/README.md
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/Dockerfile
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
4f5040d
to
7e55ff6
Compare
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
cloud-controller-manager/cmd/digitalocean-webhook-server/main.go
Outdated
Show resolved
Hide resolved
839ff25
to
d083584
Compare
@elijahomolo you seem to have merge commit markers in your |
Closing in favor of #676 and several follow-up PRs that were submitted/merged by now to continue and complete the validation web hook work. |
https://jira.internal.digitalocean.com/browse/CON-7851
This PR addresses CON-7851 by adding a new validation handler to handle LB type requests. This PR only adds the functionality to parse the LB service type and pass Create and Update requests to the appropriate LBAAS DO API endpoints. A followup PR will add validation for individual configurations.