Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Default values set for credential data fields are not usable. #2411

Closed
sangee2004 opened this issue Jan 12, 2024 · 4 comments
Closed

Default values set for credential data fields are not usable. #2411

sangee2004 opened this issue Jan 12, 2024 · 4 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@sangee2004
Copy link
Contributor

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.
@sangee2004 sangee2004 added kind/bug Something isn't working help wanted Extra attention is needed labels Jan 12, 2024
@sangee2004 sangee2004 added this to the Backlog milestone Jan 12, 2024
@cjellick cjellick modified the milestones: Backlog, v0.10.0 Jan 16, 2024
@cjellick cjellick removed the help wanted Extra attention is needed label Jan 16, 2024
@g-linville g-linville self-assigned this Jan 17, 2024
@g-linville
Copy link
Contributor

Just merged the fix.

@sangee2004
Copy link
Contributor Author

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
Copy link
Contributor

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

@sangee2004
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants