Skip to content

Commit

Permalink
Add distro validation for osm-arc (Azure#53)
Browse files Browse the repository at this point in the history
removed release-train logic
  • Loading branch information
nshankar13 authored Jun 15, 2021
1 parent b9b932a commit b0af598
Showing 1 changed file with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,15 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
scope_cluster = ScopeCluster(release_namespace=release_namespace)
ext_scope = Scope(cluster=scope_cluster, namespace=None)

valid_release_trains = ['staging', 'pilot']
# If release-train is not input, set it to 'stable'
if release_train is None:
# version is a mandatory if release-train is staging or pilot
if version is None:
raise RequiredArgumentMissingError(
"A release-train must be provided. Valid values are 'staging', 'pilot'."
)

if release_train.lower() in valid_release_trains:
# version is a mandatory if release-train is staging or pilot
if version is None:
raise RequiredArgumentMissingError(
"A version must be provided for release-train {}.".format(release_train)
)
# If the release-train is 'staging' or 'pilot' then auto-upgrade-minor-version MUST be set to False
if auto_upgrade_minor_version or auto_upgrade_minor_version is None:
auto_upgrade_minor_version = False
logger.warning("Setting auto-upgrade-minor-version to False since release-train is '%s'", release_train)
else:
raise InvalidArgumentValueError(
"Invalid release-train '{}'. Valid values are 'staging', 'pilot'.".format(release_train)
"A version must be provided for release-train {}.".format(release_train)
)
# If the release-train is 'staging' or 'pilot' then auto-upgrade-minor-version MUST be set to False
if auto_upgrade_minor_version or auto_upgrade_minor_version is None:
auto_upgrade_minor_version = False
logger.warning("Setting auto-upgrade-minor-version to False since release-train is '%s'", release_train)

# NOTE-2: Return a valid ExtensionInstance object, Instance name and flag for Identity
create_identity = False
Expand Down

0 comments on commit b0af598

Please sign in to comment.