-
Notifications
You must be signed in to change notification settings - Fork 986
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
Add secret_namespace to volume_source azure_file #1204
Add secret_namespace to volume_source azure_file #1204
Conversation
Hi, Maybe my testing is wrong, I'm not an expert on these kind of things, but even using you code it still tries to look up the secret in the default namespace:
|
@BazzardTCR it looks like I made a typo in my PR branch. I'll look into adding an acceptance test. |
I did a rebuild check if the last change was in there, it is, but still the same issue.
|
ac7c1c7
to
84feb33
Compare
I've added the acceptance test and hardened the checks for nil and empty values. Changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks really good! Thanks for this contribution. I'm going to run a few more tests, but I wanted to leave some initial feedback.
resource "kubernetes_secret" "test" { | ||
metadata { | ||
name = %[3]q | ||
namespace = %[2]q | ||
} | ||
|
||
data = { | ||
azurestorageaccountname = azurerm_storage_account.test.name | ||
azurestorageaccountkey = azurerm_storage_account.test.primary_access_key | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests look great! I'm especially excited to see an example demonstrating a feature I haven't used before. Thanks for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we would also create a pod and validate that the volume is actually mounted but this is better than nothing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I ended up doing that manually to test. I'll paste it here in case anyone is randomly googling how to mount azure file shares to their pod.
Co-authored-by: Stef Forrester <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on AKS 1.18, 1.19, 1.20 using terraform 0.14.7 and 0.14.8. It looks like it's working reliably. Thanks again!
resource "kubernetes_secret" "test" { | ||
metadata { | ||
name = %[3]q | ||
namespace = %[2]q | ||
} | ||
|
||
data = { | ||
azurestorageaccountname = azurerm_storage_account.test.name | ||
azurestorageaccountkey = azurerm_storage_account.test.primary_access_key | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I ended up doing that manually to test. I'll paste it here in case anyone is randomly googling how to mount azure file shares to their pod.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Description
This adds support for setting
secret_namespace
argument forazure_file
volume type for resourcekubernetes_persistent_volume
(k8s api).Fixes #1160
Acceptance tests
Output from acceptance testing:
Output from
kubectl
during the test:Release Note
Release note for CHANGELOG:
References
Fixes #1160
Community Note