Default values set for credential data fields are not usable.
sangee2004 opened this issue · 4 comments
sangee2004 commented
acorn version - v0.10.0-rc2-9-g43dbcbf4+43dbcbf4
Steps to reproduce the problem:
- Deploy app with credentials that have default values set for data fields
secrets: config: {
type: "credential.acorn.io/mytestcred"
params: {
promptOrder: ["username", "password"]
}
data: {
username: "abc"
password: "ppp"
}
}
containers: {
mytest: {
image: "nginx"
}
}
- When user chooses to create a new credential , the default values are not presented when user is prompted to enter values for the fields (it is empty)
? Choose an existing credential or enter a new one Enter a new credential
? password
? username
- Choosing to enter no values for these fields , does not result in credentials being created with the default values.
Expected Behavior:
- Default values should be presented when user is prompted to enter values for the fields .
- When user does not do any changes to the existing value, credential should get created with default values set for the data.
g-linville commented
Just merged the fix.
sangee2004 commented
Tested with acorn version - v0.10.0-rc2-23-g70b569f8+70b569f8
Default values are now presented as follows when user is prompted to create a new credential:
For this secret:
secrets: config: {
type: "credential.acorn.io/mytestcred"
params: {
promptOrder: ["username", "password"]
}
data: {
username: "abcd"
password: "ppp"
testnodef: ""
}
User is prompted as:
? Choose an existing credential or enter a new one Enter a new credential
? password (default: ppp)
? testnodef (default: ) ***
? username (default: abcd) ******
When there are no defaults provided for a field , we still get an entry with default:
.
Can this be improved?
g-linville commented
Merged the fix. There is now no default displayed if the value is set to ""
.
sangee2004 commented
Tested with acorn version - v0.10.0-rc2-35-g3cf6c107+3cf6c107
Default label is not presented for fields that do not have default values when prompted to enter credentials.