Skip to content

v5.16.0 - #409

Merged
zliang-akamai merged 11 commits into
mainfrom
dev
Jun 5, 2024
Merged

v5.16.0#409
zliang-akamai merged 11 commits into
mainfrom
dev

Conversation

@zliang-akamai

Copy link
Copy Markdown
Member

No description provided.

zliang-akamai and others added 6 commits March 8, 2024 14:50
* Changes for parent/child account project

* Improved test
…command usage (#397)

* change directory structure and makefile usage

* remove unnecessary init files

* remove unnecessary init files
* add tests for oauth and login client

* remove duplicate lines
## 📝 Description

**What does this PR do and why is this change necessary?**

Updates `pyenv` to point to local environment setup by devenv.
* replace execution handler with conditional

* adding if statement
## 📝 Description

This pull request adds support for configuring and viewing the ACL configuration for an LKE cluster's control plane.

**NOTE: This PR does NOT include the PUT LKE cluster changes because the acl configuration is not returned in the GET LKE cluster response.**

#### New Endpoint Methods

* `control_plane_acl` - GET `/lke/clusters/{cluster_id}/control_plane_acl`
* `control_plane_acl_update(...)` - PUT `/lke/clusters/{cluster_id}/control_plane_acl`
* `control_plane_acl_delete()` - POST `/lke/clusters/{cluster_id}/control_plane_acl`


#### Updated Endpoint Methods

* `LKEGroup.cluster_create(...)` - Add control_plane field to method arguments

#### Misc Changes

* Added data classes for LKE cluster control plane and all substructures
* Added logic to JSONObject to remove `Optional` values from the generated dict if None
    * Added a new `always_include` class var used to designate optional values that should always be included in the generated Dict
* Updated test fixture framework to support underscores in path

## ✔️ How to Test

The following test steps assume you have pulled down this PR locally and run `make install`.

### Unit Testing

```
make testunit
```

### Integration Testing

```
make TEST_COMMAND=models/lke/test_lke.py testint
```

### Manual Testing

In a Python SDK sandbox environment (e.g. dx-devenv), run the following:

```python
import os

from linode_api4 import (
    LinodeClient,
    LKEClusterControlPlaneOptions,
    LKEClusterControlPlaneACLOptions,
    LKEClusterControlPlaneACLAddressesOptions,
)

client = LinodeClient(token=os.getenv("LINODE_TOKEN"))

cluster = client.lke.cluster_create(
    "us-mia",
    "test-cluster",
    client.lke.node_pool("g6-standard-1", 1),
    "1.29",
    control_plane=LKEClusterControlPlaneOptions(
        acl=LKEClusterControlPlaneACLOptions(
            enabled=True,
            addresses=LKEClusterControlPlaneACLAddressesOptions(
                ipv4=["10.0.0.1/32"], ipv6=["1234::5678"]
            ),
        )
    ),
)

print("Original ACL:", cluster.control_plane_acl)

cluster.control_plane_acl_update(
    LKEClusterControlPlaneACLOptions(
        addresses=LKEClusterControlPlaneACLAddressesOptions(ipv4=["10.0.0.2/32"])
    )
)

print("Updated ACL:", cluster.control_plane_acl)

cluster.control_plane_acl_delete()

print("Deleted ACL:", cluster.control_plane_acl)
```

2. Ensure the script runs successfully and the output matches the following:

```
Original ACL: LKEClusterControlPlaneACL(enabled=True, addresses=LKEClusterControlPlaneACLAddresses(ipv4=['10.0.0.1/32'], ipv6=['1234::5678/128']))
Updated ACL: LKEClusterControlPlaneACL(enabled=True, addresses=LKEClusterControlPlaneACLAddresses(ipv4=['10.0.0.2/32'], ipv6=None))
Deleted ACL: LKEClusterControlPlaneACL(enabled=False, addresses=None)
```
@zliang-akamai
zliang-akamai requested a review from a team as a code owner May 28, 2024 17:51
@zliang-akamai
zliang-akamai requested review from lgarber-akamai and ykim-akamai and removed request for a team May 28, 2024 17:51

@lgarber-akamai lgarber-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing tests seem unrelated to any functional code changes in this release, should be good once Ansible tests finish 👍

edit: Just confirmed that the failing test in Ansible is unrelated to this release.

ykim-akamai and others added 5 commits May 28, 2024 15:28
…#407)

* add login_client in Makefile and add initial fixture to oauth test

* lint
 new: Add support for Parent/Child account switching
* unskip lke test, update test_lke_node_recycle, filter swap disk for image create, skip parent child account test

* skip pc account test

* remove comment

* update with cleaner syntax
@ykim-akamai

Copy link
Copy Markdown
Contributor

@zliang-akamai
zliang-akamai merged commit c6726f8 into main Jun 5, 2024
@jriddle-linode jriddle-linode added do-not-merge PRs that should not be merged until the commented issue is resolved ignore-for-release PRs you do not want to render in the changelog and removed do-not-merge PRs that should not be merged until the commented issue is resolved labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release PRs you do not want to render in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants