Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connectedk8s extension helm chart cleanup #2321

Merged
merged 88 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
68800b6
Added spn and resource group creation in connectedk8s create
Nov 12, 2019
5090698
Vanilla CLI Code for Connected Cluster
Nov 22, 2019
fda117d
saved location data CLI changes after 0.1.2
Mar 11, 2020
e781176
Added the 0.1.2 version CLI code in master
Mar 11, 2020
969a45f
Removed a print statement
Mar 11, 2020
d60bd23
Fixed container status check
Mar 12, 2020
45e2db7
Updated pod status check
Mar 13, 2020
678c2b7
Merge pull request #1 from akashkeshari/akash/agent_monitor_fix
akashkeshari Mar 16, 2020
85aa7d9
Added 2020 version models and operations
Mar 24, 2020
d345685
Updated with key pair generation
Mar 29, 2020
4e90290
review of public private key pair
Apr 1, 2020
836e6fc
updated models with latest changes in swagger
Apr 4, 2020
a1bea49
Update CLI to support SPN less onboarding
Apr 7, 2020
6522421
Removed location data changes
Apr 13, 2020
dec8fab
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
9bd5580
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
854b36f
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
576704d
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
b26a0eb
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
6d445c3
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
9df8269
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
031639b
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
47ca292
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
b237d9c
Update src/connectedk8s/azext_connectedk8s/custom.py
akashkeshari Apr 21, 2020
6249ea7
Updated error messages
Apr 21, 2020
5223949
resolved a conflict
Apr 21, 2020
c1ecbf8
updated wrt style checks
Apr 21, 2020
f43ebfb
Added a recorded test
Apr 21, 2020
d237667
Updated forked master with original master
Apr 21, 2020
32c5089
Updated with latest master changes
Apr 21, 2020
a97f36e
Updated imports
Apr 21, 2020
025522c
removed python 2.x from setup.py
Apr 21, 2020
1967b02
Updated format.py
Apr 21, 2020
df87f51
Updated readme file
Apr 22, 2020
b747e92
Updated test file
Apr 22, 2020
9d9c954
updated setup.py
Apr 22, 2020
2db8c30
updated knack version in setup.py
Apr 22, 2020
bd26f72
updated knack version to 0.7.0rc4 in setup.py
Apr 22, 2020
9dbfa0b
Updated test file to pass kubeconfig
Apr 23, 2020
c45a3a6
Updated test file to pass kubeconfig
Apr 23, 2020
f27610a
Added async support for delete
Apr 24, 2020
9852a51
Added helm charts to test data folder
Apr 27, 2020
ddad5b7
Updated helm chart pull method
Apr 27, 2020
6e6cd75
corrected import order
Apr 27, 2020
eb723fb
Ran connectedk8s test
Apr 27, 2020
a5407c1
Updated some print statements
Apr 27, 2020
3b8f930
ran test with helm upgrade --install
Apr 27, 2020
9f72a47
Updated print to warning
Apr 27, 2020
5515568
Updated error message
Apr 27, 2020
fac6740
Updated exceptions to be generic
Apr 28, 2020
e0f5022
Added aks creation in tests
Apr 29, 2020
c9d1071
updated warning statements
Apr 29, 2020
3b78ee8
updated test to create aks cluster with ssh keys
Apr 29, 2020
96a2cbe
added spn calls in recorded tests
Apr 29, 2020
2c7b8b3
Updated api-version in recorded tests
Apr 29, 2020
b9fdd1e
removed mc delete as CI test needs it to be persistant
Apr 29, 2020
cfb21ab
switched to livescenariotest
Apr 29, 2020
005e414
updated params.py
Apr 30, 2020
ba268a1
corrected databricks change
Apr 30, 2020
0ff1943
updated pod monitoring
Apr 30, 2020
d77e433
updated identation
Apr 30, 2020
44f4547
updated print statement to warnings
Apr 30, 2020
3fa9b10
added telemetry code for connect cli
May 6, 2020
5c56299
Added exception telemetry for delete operation
May 12, 2020
4ddea41
Updated fork master with latest master
May 12, 2020
47fc01b
Updated with latest master
May 12, 2020
9239f83
Updated setup.py
May 12, 2020
ccdbff0
Changed default kubernetes distro
May 12, 2020
e6333d7
Distro detect.
pasankav May 12, 2020
1ef6cdd
Updated history
May 13, 2020
c1612c2
removed arm resourceid from telemetry
May 13, 2020
3ed99da
Merge branch 'akash/connect_telemetry' into pavan/distro_detect
pasankav May 14, 2020
8b26810
Add kubernetes distro and identifying it.
pasankav May 14, 2020
fdacc2b
Remove additional line.
pasankav May 15, 2020
3860c00
correct indentation.
pasankav May 15, 2020
b9b4915
Merge branch 'master' into pavan/distro_detect
pasankav May 15, 2020
f8c4e04
correct indentation.
pasankav May 15, 2020
b752e92
correct version number.
pasankav May 15, 2020
9404057
Merge pull request #5 from akashkeshari/pavan/distro_detect
akashkeshari May 18, 2020
669071f
Merge pull request #4 from akashkeshari/akash/connect_telemetry
akashkeshari May 18, 2020
65e69b8
Merge pull request #2 from akashkeshari/location_data
akashkeshari May 18, 2020
13b8795
Merge remote-tracking branch 'upstream/master'
Aug 13, 2020
da4a59b
merged with latest master
Aug 13, 2020
fcbda96
resolved merge conflict with upstream
Sep 6, 2020
48be4bd
Added helm chart cleanup code
Sep 6, 2020
2655e77
updated helm error message
Sep 8, 2020
00f3250
Removed version changes
Sep 8, 2020
93247c9
updated error message for helm pre-release check
Sep 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# --------------------------------------------------------------------------------------------

import os
import shutil
import subprocess
from subprocess import Popen, PIPE

Expand All @@ -22,6 +23,7 @@
logger = get_logger(__name__)

# pylint: disable=line-too-long
# pylint: disable=bare-except


def validate_location(cmd, location):
Expand Down Expand Up @@ -50,10 +52,16 @@ def get_chart_path(registry_path, kube_config, kube_context):
os.environ['HELM_EXPERIMENTAL_OCI'] = '1'
pull_helm_chart(registry_path, kube_config, kube_context)

# Exporting helm chart
# Exporting helm chart after cleanup
chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', 'AzureArcCharts')
try:
if os.path.isdir(chart_export_path):
shutil.rmtree(chart_export_path)
except:
logger.warning("Unable to cleanup the azure-arc helm charts already present on the machine. In case of failure, please cleanup the directory '%s' and try again.", chart_export_path)
export_helm_chart(registry_path, chart_export_path, kube_config, kube_context)
# Helm Install

# Returning helm chart path
helm_chart_path = os.path.join(chart_export_path, 'azure-arc-k8sagents')
chart_path = os.getenv('HELMCHART') if os.getenv('HELMCHART') else helm_chart_path
return chart_path
Expand All @@ -74,7 +82,6 @@ def pull_helm_chart(registry_path, kube_config, kube_context):


def export_helm_chart(registry_path, chart_export_path, kube_config, kube_context):
chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', 'AzureArcCharts')
cmd_helm_chart_export = ["helm", "chart", "export", registry_path, "--destination", chart_export_path]
if kube_config:
cmd_helm_chart_export.extend(["--kubeconfig", kube_config])
Expand Down
10 changes: 10 additions & 0 deletions src/connectedk8s/azext_connectedk8s/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, https_pr
helm_version = check_helm_version(kube_config, kube_context)
telemetry.add_extension_event('connectedk8s', {'Context.Default.AzureCLI.HelmVersion': helm_version})

# Check for faulty pre-release helm versions
if "3.3.0-rc" in helm_version:
telemetry.set_user_fault()
raise CLIError("The current helm version is not supported for azure-arc onboarding. Please upgrade helm to a stable version and try again.")

# Validate location
utils.validate_location(cmd, location)
resourceClient = _resource_client_factory(cmd.cli_ctx, subscription_id=subscription_id)
Expand Down Expand Up @@ -688,6 +693,11 @@ def update_agents(cmd, client, resource_group_name, cluster_name, https_proxy=""
helm_version = check_helm_version(kube_config, kube_context)
telemetry.add_extension_event('connectedk8s', {'Context.Default.AzureCLI.HelmVersion': helm_version})

# Check for faulty pre-release helm versions
if "3.3.0-rc" in helm_version:
telemetry.set_user_fault()
raise CLIError("The current helm version is not supported for azure-arc onboarding. Please upgrade helm to a stable version and try again.")

# Check whether Connected Cluster is present
if not connected_cluster_exists(client, resource_group_name, cluster_name):
telemetry.set_user_fault()
Expand Down