Skip to content

Commit

Permalink
[k8s-configuration] Release v1.5.0 with updated api-version to 2022-0…
Browse files Browse the repository at this point in the history
…3-01 for GA (#4587)

* Create pull.yml

* Update pull.yml

* Update azure-pipelines.yml

* Initial commit of k8s-extension

* Update CODEOWNERS

* Update azure-pipelines.yml

* Create pull.yml

* Update pull.yml

* Update pull.yml

* Update pipelines file

* Update k8s-configuration name

* Update test script params

* Update pipeline file

* Remove codeowners

* Update pipelines file

* Update CODEOWNERS

* Update private preview pipelines

* Remove open service mesh from public release

* Update pipeline files

* Update custom pipelines files

* Add publish step to k8s-configuration

* Update pipeline to publish extension

* Update public extension pipeline

* Change condition variable

* Update pipeline naming

* Add version to public preview/private preview

* Update pipelines

* Add different testing based on private branch

* Add annotations to extension model

* Update k8s-custom-pipelines.yml

* Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13)

* Update sdks with updated swagger spec

* Update version and history rst

* Reorder release history timeline

* Fix ExtensionInstanceForCreate for import

* remove py2 bdist support

* Add custom table formatting

* Remove unnecessary files

* Fix style issues

* Fix branch based on comments

* Update identity piece manually

* Don't handle defaults at the CLI level

* Remove defaults from CLI client

* Check null target namespace with namespace scope

* Update style

* Add cassandra operator and location to model

* Stage Public Version of k8s-extension 0.2.0 for official release (#15)

* Create pull.yml

* Update pull.yml

* Update azure-pipelines.yml

* Initial commit of k8s-extension

* Update pipelines file

* Update CODEOWNERS

* Update private preview pipelines

* Remove open service mesh from public release

* Update pipeline files

* Update public extension pipeline

* Change condition variable

* Add version to public preview/private preview

* Update pipelines

* Add different testing based on private branch

* Add annotations to extension model

* Update k8s-custom-pipelines.yml

* Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13)

* Update sdks with updated swagger spec

* Update version and history rst

* Reorder release history timeline

* Fix ExtensionInstanceForCreate for import

* remove py2 bdist support

* Add custom table formatting

* Remove unnecessary files

* Fix style issues

* Fix branch based on comments

* Update identity piece manually

* Don't handle defaults at the CLI level

* Remove defaults from CLI client

* Check null target namespace with namespace scope

* Update style

* Add cassandra operator and location to model

Co-authored-by: action@github.com <Action - Fork Sync>

* Remove custom pipelines file

* Update extension description, remove private const

* Update pipeline file

* Disable check ref docs

* Disable refs docs

* Update to include better create warning logs and remove update context (#20)

* Update to include better create warning logs and remove update context

* Remove help text for update

* Fix spelling error

* Update message

* Fix k8s-extension conflict with private version

* Fix style errors

* Fix filename

* add customization for microsoft.azureml.kubernetes (#23)

* add customization for microsoft.azureml.kubernetes

* Update release history

Co-authored-by: Yue Yu <yuyu3@microsoft.com>
Co-authored-by: jonathan-innis <jonathan.innis.ji@gmail.com>

* Add E2E Testing from Separate branch into internal code (#26)

* Add internal e2e testing

* Change to testing folder

* Inference CLI validation for Scoring FE (#24)

* cli validation starter

* added the call to the fe validation function

* nodeport validation not required

* test fix

Co-authored-by: Jonathan Innis <jonathan.innis.ji@gmail.com>

* legal warning added (#27)

* Remove deprecated method logger.warn

* Update k8s-custom-pipelines.yml for Azure Pipelines

* Update k8s-custom-pipelines.yml for Azure Pipelines

* Add Azure Defender to E2E testing (#28)

* Add azure defender testing to e2e

* Remove the debug flag

* Add configuration testing

* Fix pipeline failures

* Make test script more intuitive

* Remove parameter from testing

* Add some debug

* Fix wrong location for k8s config whl

* Fix pip install upgrade issue

* Fix pip install upgrade issue

* Add Check for Provider Registration and Refactor (#19)

* Add check for provider registration and refactor

* Fix bug in checking registration

* Add license header to utils

* Update private key check and error messaging

* Update based on refactoring

* Fix failing tests

* Add provider registration check

* Create a test for uppercase url, address comments

* Add blank line to fix style check

* Testing increase to ubuntu-latest

* Update k8s-configuration Models to Track2 (#63)

* Update models to track2

* Increase k8s-configuration version number

* Update kind version

* Change error to warning because of DSA failure

* Upgrade helm operator chart version (#75)

* Pin helm version

* Bump version

* Migrate pipeline (#90)

* Disable updates on configuration tests (#89)

* Release k8s-configuration v1.2.0 for Flux v2 Public Preview (#86)

* Scaffold out the k8s-config package

* Base implementation of CLI commands

* Add create scenario and cleanup in consts

* Add help text to commands, params

* Add other clients to client factory

* Automatically installing the flux extension

* Move flux and extension into modules

* Updated the versioned sdks

* Push working command for testing

* Update to multi api versioned sdk

* Support other extension methods

* Fix nullity check

* Add source control provider

* Add scc commands

* Add defer logic for create with cache

* Use default extension with identity

* Fix identity creation

* Add kustomization caching

* Add formatters

* Add scc provider

* Add help text for k8s-config fluxv1

* Add help text for extension

* Allow force delete of extension and fluxconfiguration

* Add location to the extension model

* Update with latest from k8s-extension

* Add k8s-config testing

* Add license header

* Fix all style issues

* Update codeowners file

* Validate data before checking cluster compliance

* No kustomizations warning

* Fix identity issue in 2020-07-01

* Fix k8s regex

* Fix configuration name regex validation

* Fix name length validation

* Adding some validation warnings

* Add protected settings to request

* Exclude private test path

* Add suspend functionality

* Add correct values to build Kustomization

* Add no_wait

* Fix style issues

* Use base64 encoded httpsUser

* Fix formatting error and base64 encoding error

* Fix style issues

* Fix force

* Updated help text

* Style fixes

* Increase namespace maximum len

* Add managed cluster support to k8s-config

* Custom confirmation when prune is enabled

* Add flux commands to existing k8s-configuration

* Remove extension provider from CLI

* Fix style issues

* Override extension variables

* Strip newlines from known_hosts file

* Update help text and validators

* Strip newlines from known hosts

* Add provisioning state check for flux extension

* Pin helm version

* Remove validation from create command

* Add patch support with new SDK

* Add implementation for CRUD of source and kustomization

* Fix errors on patch

* Fix some bugs in patching properties

* Add fixes for patch in k8s-configuraiton

* Change duration formatting in table output

* Add validation and conversion for durations

* Bump verison and fix typo

* Fix bug with dependencies

* Fix linter and style issues

* Fix delete prune check

* Add flux testing

* Create separate jobs for scenarios

* Update error text

* Fix filepath suggestion from CLI team

* Fix unneeded file edit

* Add a Deployed Object List to the Flux CLI (#91)

* Enable a deployed object list on the CLI

* Show detail when extension install fails

* Bump version

* Update deployed object format (#93)

* Fix help text for consistency

* Enable Bucket Support in the CLI (#92)

* Update vendored_sdks

* Enable source kind generation factories and use kwargs to pass to provider

* Add better validation logic to source generator

* Move away from classes in the provider directory

* Fix style issues using black auto-formatter

* Fix linter failures

* Update identity with api version and rp in same function

* Bucket Testing for E2E Testing (#96)

* Bucket testing

* Add switching kind test to update CLI

* Bump version

* Fix help text and parameter naming for bucket (#100)

* Fix default help text for parameters (#101)

* Edit history with breaking change

* Prepare GA FluxConfiguration 2022-03-01 (#103)

* Add vendored sdks for new api-version

* Update the new depends on definition

* Update table formatting

* BucketDefinition to BucketPatchDefinition

* Remove http url warning

* Update vendored_sdks

* Update action file to add depenencies

* Remove preview from command groups

* Update changelog

* Make dependencies none when not specified

* Remove unneeded files

Co-authored-by: action@github.com <Action - Fork Sync>
Co-authored-by: yuyue9284 <15863499+yuyue9284@users.noreply.github.com>
Co-authored-by: Yue Yu <yuyu3@microsoft.com>
Co-authored-by: Lia Kazakova <58274127+liakaz@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 30, 2022
1 parent 944e523 commit ae5b97c
Show file tree
Hide file tree
Showing 212 changed files with 22,729 additions and 16,511 deletions.
5 changes: 5 additions & 0 deletions src/k8s-configuration/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.5.0
++++++++++++++++++
* Update models to 2022-03-01 for GA
* Remove unneeded warning for HTTPS urls

1.4.1
++++++++++++++++++
* [BREAKING CHANGE] `--access-key` changed to `--bucket-access-key`
Expand Down
18 changes: 7 additions & 11 deletions src/k8s-configuration/azext_k8s_configuration/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

import argparse
from azure.cli.core.azclierror import InvalidArgumentValueError
from .vendored_sdks.v2022_01_01_preview.models import (
from .vendored_sdks.v2022_03_01.models import (
KustomizationDefinition,
KustomizationPatchDefinition,
DependsOnDefinition,
)
from .validators import validate_kustomization
from . import consts
Expand All @@ -18,26 +17,27 @@

class InternalKustomizationDefinition(KustomizationDefinition):
def __init__(self, **kwargs):
self.name = kwargs.get("name", "")
super().__init__(**kwargs)

# This call is after the call to super() to override the init method
# making the self.name field null
self.name = kwargs.get("name", "")

def to_KustomizationDefinition(self):
k_dict = dict(self.__dict__)
del k_dict["name"]
del k_dict["additional_properties"]
return KustomizationDefinition(**k_dict)

def to_KustomizationPatchDefinition(self):
k_dict = dict(self.__dict__)
del k_dict["name"]
del k_dict["additional_properties"]
return KustomizationPatchDefinition(**k_dict)


class KustomizationAddAction(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
validate_kustomization(values)
model_dependency = []
dependencies = None
sync_interval = None
retry_interval = None
timeout = None
Expand All @@ -47,10 +47,6 @@ def __call__(self, parser, namespace, values, option_string=None):
key, value = item.split("=", 1)
if key in consts.DEPENDENCY_KEYS:
dependencies = parse_dependencies(value)
for dep in dependencies:
model_dependency.append(
DependsOnDefinition(kustomization_name=dep)
)
elif key in consts.SYNC_INTERVAL_KEYS:
sync_interval = value
elif key in consts.RETRY_INTERVAL_KEYS:
Expand All @@ -67,7 +63,7 @@ def __call__(self, parser, namespace, values, option_string=None):
parser,
namespace,
InternalKustomizationDefinition(
depends_on=model_dependency,
depends_on=dependencies,
sync_interval_in_seconds=parse_duration(sync_interval),
retry_interval_in_seconds=parse_duration(retry_interval),
timeout_in_seconds=parse_duration(timeout),
Expand Down
3 changes: 0 additions & 3 deletions src/k8s-configuration/azext_k8s_configuration/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def load_command_table(self, _):
"k8s-configuration flux",
k8s_configuration_fluxconfig_client,
custom_command_type=flux_configuration_custom_type,
is_preview=True,
) as g:
g.custom_command("create", "create_config", supports_no_wait=True)
g.custom_command("update", "update_config", supports_no_wait=True)
Expand All @@ -52,7 +51,6 @@ def load_command_table(self, _):
"k8s-configuration flux kustomization",
k8s_configuration_fluxconfig_client,
custom_command_type=flux_configuration_custom_type,
is_preview=True,
) as g:
g.custom_command("create", "create_kustomization", supports_no_wait=True)
g.custom_command("update", "update_kustomization", supports_no_wait=True)
Expand All @@ -72,7 +70,6 @@ def load_command_table(self, _):
"k8s-configuration flux deployed-object",
k8s_configuration_fluxconfig_client,
custom_command_type=flux_configuration_custom_type,
is_preview=True,
) as g:
g.custom_command(
"list",
Expand Down
8 changes: 3 additions & 5 deletions src/k8s-configuration/azext_k8s_configuration/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# API VERSIONS -----------------------------------------

SOURCE_CONTROL_API_VERSION = "2021-03-01"
FLUXCONFIG_API_VERSION = "2022-01-01-preview"
EXTENSION_API_VERSION = "2021-09-01"
SOURCE_CONTROL_API_VERSION = "2022-03-01"
FLUXCONFIG_API_VERSION = "2022-03-01"
EXTENSION_API_VERSION = "2022-03-01"

# ERROR/HELP TEXT DEFINITIONS -----------------------------------------

Expand Down Expand Up @@ -161,8 +161,6 @@
FLUX_EXTENSION_CREATING_ERROR = "Error! 'Microsoft.Flux' extension is currently installing on the cluster. Unable to proceed with Flux v2 configuration install."
FLUX_EXTENSION_CREATING_HELP = "Try again in a few minutes when the 'Microsoft.Flux' extension installation has completed."

HTTP_URL_NO_AUTH_WARNING = "Warning! https url is being used without https auth params, ensure the repository url provided is not a private repo"

NO_KUSTOMIZATIONS_WARNING = "Warning! No kustomizations were specified for this configuration. A kustomization will be generated with the default name 'kustomization-1'."
DEFAULT_KUSTOMIZATION_NAME = "kustomization-1"

Expand Down
10 changes: 3 additions & 7 deletions src/k8s-configuration/azext_k8s_configuration/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def __get_fluxconfig_table_row(result):
("scope", result["scope"]),
("provisioningState", result["provisioningState"]),
("complianceState", result["complianceState"]),
("lastSourceUpdatedAt", result["lastSourceUpdatedAt"]),
("statusUpdatedAt", result["statusUpdatedAt"]),
("sourceUpdatedAt", result["sourceUpdatedAt"]),
]
)

Expand All @@ -58,16 +59,11 @@ def fluxconfig_kustomization_show_table_format(results):


def __get_fluxconfig_kustomization_table_row(key, value):
deps = []
for dep in value.get("dependsOn") or []:
if dep.get("kustomizationName"):
deps.append(dep["kustomizationName"])

return OrderedDict(
[
("name", key),
("path", value["path"]),
("dependsOn", ",".join(deps)),
("dependsOn", ",".join(value.get("dependsOn") or [])),
("syncInterval", format_duration(value["syncIntervalInSeconds"])),
("timeout", format_duration(value["timeoutInSeconds"])),
("prune", value["prune"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@
validate_url_with_params,
)
from .. import consts
from ..vendored_sdks.v2022_01_01_preview.models import (
from ..vendored_sdks.v2022_03_01.models import (
FluxConfiguration,
FluxConfigurationPatch,
GitRepositoryDefinition,
GitRepositoryPatchDefinition,
BucketDefinition,
BucketPatchDefinition,
RepositoryRefDefinition,
KustomizationDefinition,
KustomizationPatchDefinition,
DependsOnDefinition,
SourceKindType,
)
from ..vendored_sdks.v2021_09_01.models import Extension, Identity
from ..vendored_sdks.v2022_03_01.models import Extension, Identity

logger = get_logger(__name__)

Expand Down Expand Up @@ -384,17 +384,10 @@ def create_kustomization(
consts.CREATE_KUSTOMIZATION_EXIST_HELP,
)

# Add the dependencies in their model to the kustomization
model_dependencies = None
if dependencies:
model_dependencies = []
for dep in parse_dependencies(dependencies):
model_dependencies.append(DependsOnDefinition(kustomization_name=dep))

kustomization = {
kustomization_name: KustomizationPatchDefinition(
path=path,
depends_on=model_dependencies,
depends_on=parse_dependencies(dependencies),
timeout_in_seconds=parse_duration(timeout),
sync_interval_in_seconds=parse_duration(sync_interval),
retry_interval_in_seconds=parse_duration(retry_interval),
Expand Down Expand Up @@ -451,17 +444,10 @@ def update_kustomization(
consts.UPDATE_KUSTOMIZATION_NO_EXIST_HELP,
)

# Add the dependencies in their model to the kustomization
model_dependencies = None
if dependencies:
model_dependencies = []
for dep in parse_dependencies(dependencies):
model_dependencies.append(DependsOnDefinition(kustomization_name=dep))

kustomization = {
kustomization_name: KustomizationPatchDefinition(
path=path,
depends_on=model_dependencies,
depends_on=parse_dependencies(dependencies),
timeout_in_seconds=parse_duration(timeout),
sync_interval_in_seconds=parse_duration(sync_interval),
retry_interval_in_seconds=parse_duration(retry_interval),
Expand Down Expand Up @@ -1015,7 +1001,7 @@ def generate_patch_update_func(self, swapped_kind):

def bucket_patch_updater(config):
if any(kwarg is not None for kwarg in self.kwargs.values()):
config.bucket = BucketDefinition(
config.bucket = BucketPatchDefinition(
url=self.url,
bucket_name=self.bucket_name,
timeout_in_seconds=parse_duration(self.timeout),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from .. import consts

from ..vendored_sdks.v2021_03_01.models import (
from ..vendored_sdks.v2022_03_01.models import (
HelmOperatorProperties,
SourceControlConfiguration,
)
Expand Down
Loading

0 comments on commit ae5b97c

Please sign in to comment.