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

Avoid creating .azcopy under HOME if plan/log location is specified elsewhere #1782

Merged
merged 9 commits into from
Jun 2, 2022

Conversation

tiverma-msft
Copy link
Collaborator

No description provided.

@tiverma-msft
Copy link
Collaborator Author

There are 2 variables here. Log file loc and plan file loc. If one of the locations is specified by an env variable and other is not, we will still create the .azcopy folder to accommodate the file for which user has not provided a location.

Only in the case of both env variables being provided will we skip creating the .azcopy folder.

One of my concerns... something that I'll have to see is if this folder is used for something other than plan and log files. The location of this folder is being shared by cmd.Execute(azcopyAppPathFolder, azcopyLogPathFolder, azcopyJobPlanFolder, 0, jobID) and is then used for common.NewUserOAuthTokenManagerInstance(...)
What is that for? (Adding this to the conversation as a personal note to find out.

@tiverma-msft
Copy link
Collaborator Author

In such a case (when a token json file is being created), the folder .azcopy will be created, and the token will be stored there. The code -DPAPIFilePath: azcopyAppPathFolder in credentialUtil.go decides where the json token will go.
Leaving this as is. i.e as long as the user is not creating tokens, this folder is not created.

@tiverma-msft
Copy link
Collaborator Author

tiverma-msft commented May 25, 2022

Changes suggested: the OAuth token should be where the plan files are located. This way if the user has provided both plan and log locations, the OAuth will be where plan files are located, and the .azcopy folder will not be created at all. Make changes accordingly

main.go Show resolved Hide resolved
@mohsha-msft mohsha-msft merged commit 8346fe9 into dev Jun 2, 2022
@mohsha-msft mohsha-msft deleted the tiverma_avoiding_creation_under_home branch June 2, 2022 10:47
@siminsavani-msft siminsavani-msft added this to the 10.16.0 milestone Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: file already closed when setting AZCOPY_LOG_LOCATION env variable
5 participants