Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
outdir = os.environ.get('TEST_OUTDIR', '/tmp')
kubeconfig = os.path.join(outdir, 'kubeconfig')


def apply_handler(event, context):
logger.info(json.dumps(event))

Expand All @@ -35,6 +36,9 @@ def apply_handler(event, context):
logger.info(f'Running command: {cmd}')
subprocess.check_call(cmd)

if os.path.isfile(kubeconfig):
os.chmod(kubeconfig, 0o600)

# write resource manifests in sequence: { r1 }{ r2 }{ r3 } (this is how
# a stream of JSON objects can be included in a k8s manifest).
manifest_list = json.loads(manifest_text)
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-eks/lib/kubectl-handler/get/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
outdir = os.environ.get('TEST_OUTDIR', '/tmp')
kubeconfig = os.path.join(outdir, 'kubeconfig')


def get_handler(event, context):
logger.info(json.dumps(event))

Expand All @@ -30,6 +31,9 @@ def get_handler(event, context):
'--kubeconfig', kubeconfig
])

if os.path.isfile(kubeconfig):
os.chmod(kubeconfig, 0o600)

object_type = props['ObjectType']
object_name = props['ObjectName']
object_namespace = props['ObjectNamespace']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
outdir = os.environ.get('TEST_OUTDIR', '/tmp')
kubeconfig = os.path.join(outdir, 'kubeconfig')


def helm_handler(event, context):
logger.info(json.dumps(event))

Expand All @@ -38,6 +39,9 @@ def helm_handler(event, context):
'--kubeconfig', kubeconfig
])

if os.path.isfile(kubeconfig):
os.chmod(kubeconfig, 0o600)

# Write out the values to a file and include them with the install and upgrade
values_file = None
if not request_type == "Delete" and not values_text is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
outdir = os.environ.get('TEST_OUTDIR', '/tmp')
kubeconfig = os.path.join(outdir, 'kubeconfig')


def patch_handler(event, context):
logger.info(json.dumps(event))

Expand All @@ -29,6 +30,9 @@ def patch_handler(event, context):
'--kubeconfig', kubeconfig
])

if os.path.isfile(kubeconfig):
os.chmod(kubeconfig, 0o600)

resource_name = props['ResourceName']
resource_namespace = props['ResourceNamespace']
apply_patch_json = props['ApplyPatchJson']
Expand Down