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

Feat:supports custom folder expressions and setting folder names by annotation #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kuengroc
Copy link

No description provided.

@kuengroc kuengroc changed the title feat:support custom host path Feat:support custom host path Feb 21, 2023
@derekbit
Copy link
Member

@kuengroc
Thanks for the PR.
Can you elaborate more on the PR? The directory is able to be specified in the config file, why do we need the extra annotation? Thank you.

@kuengroc
Copy link
Author

@kuengroc Thanks for the PR. Can you elaborate more on the PR? The directory is able to be specified in the config file, why do we need the extra annotation? Thank you.

@derekbit
Thank you for your reply.
This annotation is used to solve the scenario where the specified directory needs to be mounted through pvc.
At present, our strategy is to randomly generate paths through PVC name.

@derekbit
Copy link
Member

Got it. Do we need the full path or just need to specify the folder name customFolderNameAnnotation?

@kuengroc
Copy link
Author

The base path required for a random directory may be inconsistent with the specified directory. For security reasons, it is recommended to provide two base path settings.

@derekbit
Copy link
Member

derekbit commented Feb 21, 2023

The base path required for a random directory may be inconsistent with the specified directory. For security reasons, it is recommended to provide two base path settings.

Sorry, what does two base path settings mean?

@kuengroc
Copy link
Author

The base path required for a random directory may be inconsistent with the specified directory. For security reasons, it is recommended to provide two base path settings.

Sroy, what does two base path settings mean?

One is used for the use of random directories, but the prefix of the random directory is often inconsistent with the prefix of the specified directory, but it is necessary to restrict the use of the specified directory, so two base paths are required.

@kuengroc kuengroc changed the title Feat:support custom host path Feat:feat:support custom folder expression and by annotation setting folder name Feb 21, 2023
@kuengroc kuengroc changed the title Feat:feat:support custom folder expression and by annotation setting folder name Feat:support custom folder expression and by annotation setting folder name Feb 21, 2023
@derekbit
Copy link
Member

The base path required for a random directory may be inconsistent with the specified directory. For security reasons, it is recommended to provide two base path settings.

Sroy, what does two base path settings mean?

One is used for the use of random directories, but the prefix of the random directory is often inconsistent with the prefix of the specified directory, but it is necessary to restrict the use of the specified directory, so two base paths are required.

Sounds good. Let me know if the PR is ready. I will continue the review. Thank you.

@derekbit
Copy link
Member

@kuengroc The test failed. Could you please check the failure? Thank you.

@kuengroc kuengroc changed the title Feat:support custom folder expression and by annotation setting folder name Feat:supports custom folder expressions and setting folder names by annotation Feb 22, 2023
@kuengroc kuengroc force-pushed the master branch 2 times, most recently from 5111a92 to a10a078 Compare February 22, 2023 01:52
@kuengroc
Copy link
Author

@kuengroc The test failed. Could you please check the failure? Thank you.

Integration testing has been OK

@derekbit
Copy link
Member

@kuengroc Can you help add the usage in the README.md as well? Thank you.

@kuengroc
Copy link
Author

@kuengroc Can you help add the usage in the README.md as well? Thank you.

REASME.md Added completed

@kuengroc
Copy link
Author

kuengroc commented Mar 1, 2023

@kuengroc Can you help add the usage in the README.md as well? Thank you.

@kuengroc Can you help add the usage in the README.md as well? Thank you.

REASME.md Added completed

@derekbit Can you help me look at this pr?

@@ -653,5 +662,10 @@ func canonicalizeConfig(data *ConfigData) (cfg *Config, err error) {
} else {
cfg.CmdTimeoutSeconds = defaultCmdTimeoutSeconds
}
if data.FolderExpression != "" {
cfg.FolderExpression = data.FolderExpression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of we can validate the input of the data.FolderExpression?
If there is a typo or capitalization prob, for example, data.FolderExpression = {{.PVName}}-{{.namespace}}-{{.pvcNane}}, what will happen?

@@ -155,7 +155,8 @@ data:
"node":"yasker-lp-dev3",
"paths":[]
}
]
],
"folderExpression":"{{.pvName}}-{{.namespace}}-{{.pvcName}}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have test for folderExpression?

@derekbit
Copy link
Member

derekbit commented Mar 6, 2023

@kuengroc Will you update the PR soon? I'd like to put it in the upcoming v0.0.24. Many thanks.

@derekbit
Copy link
Member

Ping @kuengroc

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.

2 participants