-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrates AIO version 0.3.0-preview + refactors + other improv…
…ements (#132) * feat: integrates AIO version 0.3.0-preview * refactor: removes user `--cluster-location`. The target cluster location will always be queried. * refactor: orchestration host module connectivity checks for more re-usable code. * refactor: permission check (which currently only evaluates rg role-write permissions) runs if resource sync is enabled (default) * introduces a template optimizer python script to trim or modify attributes of the deployment template.
- Loading branch information
Showing
13 changed files
with
261 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
azext_edge/edge/providers/orchestration/connected_cluster.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# coding=utf-8 | ||
# ---------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License file in the project root for license information. | ||
# ---------------------------------------------------------------------------------------------- | ||
|
||
from ...util.az_client import get_resource_client | ||
|
||
CONNECTED_CLUSTER_API_VERSION = "2022-10-01-preview" | ||
|
||
|
||
class ConnectedCluster: | ||
def __init__(self, subscription_id: str, cluster_name: str, resource_group_name: str): | ||
self.subscription_id = subscription_id | ||
self.cluster_name = cluster_name | ||
self.resource_group_name = resource_group_name | ||
self.resource_client = get_resource_client(self.subscription_id) | ||
|
||
@property | ||
def resource(self) -> dict: | ||
return self.resource_client.resources.get_by_id( | ||
resource_id=f"/subscriptions/{self.subscription_id}/resourceGroups/{self.resource_group_name}" | ||
f"/providers/Microsoft.Kubernetes/connectedClusters/{self.cluster_name}", | ||
api_version=CONNECTED_CLUSTER_API_VERSION, | ||
).as_dict() | ||
|
||
@property | ||
def location(self) -> str: | ||
return self.resource["location"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.