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

[AKS] az aks get-credentials: Fix permission prompt when saving config file to symlink #22800

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

FumingZhang
Copy link
Member

Related command

az aks get-credentials

Description

Background

I need help on a case where when my customer uses soft link for config file, they get the below prompt :-

/home/sander_flobbe/.kube/config has permissions '777'. It should be readable and writable only by its owner.

As per my understanding, customer shouldn’t be getting this prompt, as symlink has by default permissions of 777 which can't be modified.

Steps to reproduce the behavior:

  1. rm -rf .kube
  2. mkdir .kube
  3. cd .kube
  4. touch my-config
  5. ln -s my-config config
  6. az aks get-credentials --resource-group (..) --name (..) --subscription (..)

This gives a (false) error:
/home/sander_flobbe/.kube/config has permissions "777".
It should be readable and writable only by its owner.
Merged "aks6e827e784bbf2" as current context in /home/sander_flobbe/.kube/config

This behavior is reproducible with the steps shared.

In this PR, it will additionally check if the storage path is a symlink, and if so, skip the permission check.

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@ghost ghost requested review from zhoxing-ms and wangzelin007 June 9, 2022 06:59
@ghost ghost assigned zhoxing-ms Jun 9, 2022
@ghost ghost added this to the Jun 2022 (2022-07-05) milestone Jun 9, 2022
@ghost ghost added the Auto-Assign Auto assign by bot label Jun 9, 2022
@ghost ghost requested a review from yonzhan June 9, 2022 06:59
@ghost ghost added the AKS az aks/acs/openshift label Jun 9, 2022
@FumingZhang FumingZhang marked this pull request as ready for review June 9, 2022 08:54
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 9, 2022

AKS

@zhoxing-ms zhoxing-ms merged commit 09f1b0e into Azure:dev Jun 10, 2022
@FumingZhang FumingZhang deleted the fuming/fix-symlink-0609 branch June 13, 2022 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants