acorn-io / runtime

A simple application deployment framework built on Kubernetes

Home Page:https://docs.acorn.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default values set for credential data fields are not usable.

sangee2004 opened this issue · comments

acorn version - v0.10.0-rc2-9-g43dbcbf4+43dbcbf4

Steps to reproduce the problem:

  1. 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"
	}
}
  1. 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 
  1. Choosing to enter no values for these fields , does not result in credentials being created with the default values.

Expected Behavior:

  1. Default values should be presented when user is prompted to enter values for the fields .
  2. When user does not do any changes to the existing value, credential should get created with default values set for the data.

Just merged the fix.

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?

Merged the fix. There is now no default displayed if the value is set to "".

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.