-
Notifications
You must be signed in to change notification settings - Fork 47
CORTX-30141: Remove CORTX secrets custom template file #232
CORTX-30141: Remove CORTX secrets custom template file #232
Conversation
Use kubectl to create the generic secret directly. Signed-off-by: Keith Pine <[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.
lgtm
kubectl_create_secret_cmd="kubectl create -f ${new_secret_gen_file} --namespace=${namespace}" | ||
if ! ${kubectl_create_secret_cmd}; then | ||
|
||
if ! kubectl create secret generic "${cortx_secret_name}" \ |
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.
kubectl apply
is preferred here as it will not fail if the existing secret name already exists, but it will fail if kubectl create
is used and a secret with the same name already exists. It is a valid and expected use case to update the secret with apply as needed.
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.
if ! kubectl create secret generic "${cortx_secret_name}" \ | |
if ! kubectl apply secret generic "${cortx_secret_name}" \ |
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.
It doesn't look like this command exists:
❯ k apply secret generic -f /tmp/foobar.yaml
error: Unexpected args: [secret generic]
See 'kubectl apply -h' for help and examples
If we want to use apply
, then I can just close this PR and move the bespoke template file to another location. I was mostly just attempting to get rid of it.
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.
Ah! Good catch! I was jumping ahead too quickly. For now we can pivot to what you have here. It won't matter much in the near future, so I'm good with what you have above.
Description
Remove the custom template file used for creating the CORTX secret, and generate the secret directly with
kubectl create
. This reduces the number of template files to manage, in support of merging the cortx-configmap Chart into the "unified" Chart.Type of change
Applicable issues
How was this tested?
Additional information
Deployed a cluster and performed S3 I/O for each of these:
Examined the created secret and compared it from previous, no unexpected changes seen.
Checklist
If this change addresses a CORTX Jira issue:
CORTX-XXXXX:
)