-
Notifications
You must be signed in to change notification settings - Fork 82
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
new: [BREAKING] Add support for LKE Control Plane ACL #495
Conversation
@@ -6,6 +6,7 @@ require ( | |||
github.com/jarcoal/httpmock v1.3.1 | |||
github.com/linode/linodego v1.30.0 | |||
github.com/linode/linodego/k8s v0.0.0-00010101000000-000000000000 | |||
github.com/stretchr/testify v1.9.0 |
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 was originally added in the parent/child project branch
As a team we decided to go ahead with this breaking change 🙂 |
2566e82
to
ac5c248
Compare
IPv4 *[]string `json:"ipv4,omitempty"` | ||
IPv6 *[]string `json:"ipv6,omitempty"` |
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 pointer to a slice might be considered an anti-pattern but in this case we need omitempty to only apply to nil values.
lke_clusters_control_plane.go
Outdated
|
||
// LKEClusterControlPlaneACLResponse represents the response structure | ||
// for the Client.GetLKEClusterControlPlaneACL(...) method. | ||
type LKEClusterControlPlaneACLResponse struct { |
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 didn't quite know what to name this response struct. For reference, this response body is unique to GetLKEClusterControlPlaneACL(...)
and UpdateLKEClusterControlPlaneACL(...)
.
0095ae5
to
a8843f9
Compare
Enabled *bool `json:"enabled,omitempty"` | ||
Addresses *LKEClusterControlPlaneACLAddressesOptions `json:"addresses,omitempty"` |
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 slightly concerned about the UX impact of making all update fields pointers but I don't think there's a better way to do it.
Maybe we could introduce a helper like this to make defining pointers to literals bit cleaner?
func Optional[T any](value T) *T {
return &value
}
// Usage: linodego.Optional("test-string")
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 adding this helper is a good idea 👍
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.
@yec-akamai Sounds good! I'll track adding that helper as a separate ticket/PR just to keep the scope of this PR reasonable 🙂
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! Tests passed locally 🎉
Enabled *bool `json:"enabled,omitempty"` | ||
Addresses *LKEClusterControlPlaneACLAddressesOptions `json:"addresses,omitempty"` |
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 adding this helper is a good idea 👍
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.
LGTM, Tests pass locally. Should we add the required customer tag to all the test account?
@ykim-1 Great idea, yeah we should definitely add the customer tag until this reaches GA |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/linode/linodego](https://togithub.com/linode/linodego) | `v1.33.1` -> `v1.34.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2flinode%2flinodego/v1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2flinode%2flinodego/v1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2flinode%2flinodego/v1.33.1/v1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2flinode%2flinodego/v1.33.1/v1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>linode/linodego (github.com/linode/linodego)</summary> ### [`v1.34.0`](https://togithub.com/linode/linodego/releases/tag/v1.34.0) [Compare Source](https://togithub.com/linode/linodego/compare/v1.33.1...v1.34.0) #### What's Changed #####⚠️ Breaking Change - \[BREAKING] Add support for LKE Control Plane ACL by [@​lgarber-akamai](https://togithub.com/lgarber-akamai) in [https://github.com/linode/linodego/pull/495](https://togithub.com/linode/linodego/pull/495) ##### 🐛 Bug Fixes - Prevent unexpected warning from Resty when calling `Client.SetDebug(false)` by [@​lgarber-akamai](https://togithub.com/lgarber-akamai) in [https://github.com/linode/linodego/pull/508](https://togithub.com/linode/linodego/pull/508) ##### 💡 Improvements - Mask the value of the Authorization header if debug is enabled by [@​rosskirkpat](https://togithub.com/rosskirkpat) in [https://github.com/linode/linodego/pull/501](https://togithub.com/linode/linodego/pull/501) - Expose region capabilities enum by [@​yec-akamai](https://togithub.com/yec-akamai) in [https://github.com/linode/linodego/pull/507](https://togithub.com/linode/linodego/pull/507) ##### ⚙️ Repo/CI Improvements - replace test execution handler with conditional by [@​ykim-1](https://togithub.com/ykim-1) in [https://github.com/linode/linodego/pull/502](https://togithub.com/linode/linodego/pull/502) ##### 📦 Dependency Updates - bump golang.org/x/net from 0.24.0 to 0.25.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/linode/linodego/pull/500](https://togithub.com/linode/linodego/pull/500) - bump github.com/go-resty/resty/v2 from 2.12.0 to 2.13.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/linode/linodego/pull/505](https://togithub.com/linode/linodego/pull/505) - bump golangci/golangci-lint-action from 5 to 6 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/linode/linodego/pull/506](https://togithub.com/linode/linodego/pull/506) #### New Contributors - [@​rosskirkpat](https://togithub.com/rosskirkpat) made their first contribution in [https://github.com/linode/linodego/pull/501](https://togithub.com/linode/linodego/pull/501) **Full Changelog**: linode/linodego@v1.33.1...v1.34.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/anza-labs/lke-operator). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFyZWEvZGVwZW5kZW5jeSJdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
📝 Description
This pull request adds support for the upcoming LKE Control Plane ACL feature, including the following changes:
Updated Endpoints
/lke/clusters
- Updated to include ACL undercontrol_plane
field/lke/clusters/{cluster_id}
- Updated to include ACL undercontrol_plane
field/lke/clusters
- Updated to include ACL undercontrol_plane
field/lke/clusters/{cluster_id}
- Updated to include ACL undercontrol_plane
fieldNew Endpoints
/lke/clusters/{cluster_id}/control_plane_acl
/lke/clusters/{cluster_id}/control_plane_acl
/lke/clusters/{cluster_id}/control_plane_acl
New Event Action Constants
lke_control_plane_acl_create
lke_control_plane_acl_update
lke_control_plane_acl_delete
✔️ How to Test
The following test steps assume you have pulled down this repo locally and have configured your Linode account according to the guidelines commented on
TPT-2854
.Integration Testing
Manual Testing
In a linodego sandbox environment (e.g. dx-devenv), run the following: