Skip to content

Commit

Permalink
[k8s-runtime] Vendor Azure SDKs (#7898)
Browse files Browse the repository at this point in the history
* vendor sdks

* pass lint

* update version

* update changelog

---------

Co-authored-by: Junda Chen <jundachen@microsoft.com>
  • Loading branch information
ddadaal and Junda Chen authored Aug 21, 2024
1 parent 271812a commit 91d6b71
Show file tree
Hide file tree
Showing 442 changed files with 107,528 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/k8s-runtime/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.0.3
++++++
* Vendor Azure SDKs and remove Azure SDKs from dependencies

1.0.2
++++++
* Use `preview` release train storage class extension when enabling storage class service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from knack.log import get_logger

from azure.cli.core.commands import AzCliCommand
from azure.mgmt.kubernetesconfiguration import SourceControlConfigurationClient
from azure.mgmt.kubernetesconfiguration.models import Extension, Identity
from ..vendored_sdks.kubernetesconfiguration import SourceControlConfigurationClient
from ..vendored_sdks.kubernetesconfiguration.models import Extension, Identity
from azure.cli.core.commands.client_factory import get_mgmt_service_client

from .common import ConnectedClusterResourceId, check_rp_registration, query_rp_oid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
from azure.cli.core.commands import AzCliCommand
from azure.mgmt.authorization import AuthorizationManagementClient
from azure.mgmt.authorization.models import RoleAssignmentCreateParameters, PrincipalType
from azure.mgmt.kubernetesconfiguration import SourceControlConfigurationClient
from azure.mgmt.kubernetesconfiguration.models import Extension, Identity
from ..vendored_sdks.kubernetesconfiguration import SourceControlConfigurationClient
from ..vendored_sdks.kubernetesconfiguration.models import Extension, Identity
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.resourcegraph import ResourceGraphClient
from azure.mgmt.resourcegraph.models import QueryRequest
from ..vendored_sdks.resourcegraph import ResourceGraphClient
from ..vendored_sdks.resourcegraph.models import QueryRequest

from .common import KUBERNETES_RUNTIME_FPA_APP_ID, check_rp_registration, ConnectedClusterResourceId, query_rp_oid

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._source_control_configuration_client import SourceControlConfigurationClient
__all__ = ['SourceControlConfigurationClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass

from ._version import VERSION

__version__ = VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class SourceControlConfigurationClientConfiguration(Configuration):
"""Configuration for SourceControlConfigurationClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
):
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-kubernetesconfiguration/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs: Any
):
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading

0 comments on commit 91d6b71

Please sign in to comment.