Skip to content

Commit

Permalink
adding disableAutoSupport to --v3 manage cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haigh <[email protected]>
  • Loading branch information
MichaelHaigh committed May 28, 2024
1 parent 9b165cc commit 8acc103
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions astraSDK/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ def main(
regCred,
registry=None,
label=None, # should be of 'acs.example.com/policy=allowed' format
disableAutoSupport=False,
name="astra-connector",
namespace="astra-connector",
):
Expand All @@ -1042,6 +1043,8 @@ def main(
}
if label:
body["spec"]["labels"] = {label.split("=")[0]: label.split("=")[1]}
if disableAutoSupport:
body["spec"]["autoSupport"] = {"enrolled": False}
return createResource(
quiet=self.quiet,
dry_run=self.dry_run,
Expand Down
3 changes: 3 additions & 0 deletions tkSrc/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def manageV3Cluster(
cloudID,
ard,
label=None,
disableAutoSupport=False,
config=None,
):
helpers.isRFC1123(clusterName)
Expand Down Expand Up @@ -208,6 +209,7 @@ def manageV3Cluster(
regCred,
registry=registry,
label=label,
disableAutoSupport=disableAutoSupport,
)
if not connector:
raise SystemExit("astraSDK.k8s.createAstraConnector() failed")
Expand Down Expand Up @@ -437,6 +439,7 @@ def main(args, ard, config=None):
args.cloudID,
ard,
label=args.label,
disableAutoSupport=args.disableAutoSupport,
config=config,
)
else:
Expand Down
6 changes: 6 additions & 0 deletions tkSrc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,12 @@ def manage_cluster_args(self):
help="optionally specify a label to be added to the AstraConnector CR, for "
"example: 'acs.example.com/policy=allowed'",
)
self.subparserManageCluster.add_argument(
"--disableAutoSupport",
default=False,
action="store_true",
help="specify to opt-out of automatic upload of auto support bundles",
)
versionGroup = self.subparserManageCluster.add_argument_group(
"operatorGroup", "Astra Connector Operator Version to install"
)
Expand Down

0 comments on commit 8acc103

Please sign in to comment.