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

acorn run --update/ acorn update does not pick changes made to credentials #2436

Open
sangee2004 opened this issue Jan 18, 2024 · 1 comment
Labels
kind/bug Something isn't working
Milestone

Comments

@sangee2004
Copy link
Contributor

sangee2004 commented Jan 18, 2024

acorn version - v0.10.0-rc2-36-g994b4680+994b4680

Steps to reproduce the problem:

Scenario 1:

  1. Deploy app with credentials - acorn run -n test1
secrets: config: {
	type: "credential.acorn.io/mytestcred"
	params: {
		promptOrder: ["username", "password"]
	}
	data: {
		username:      "xxx"
		password:      ""
	}
}
containers: {
	mytest: {
		image: "nginx"
        env:{
           username: "secret://config/username"
           password: "secret://config/password"
	}
}
}
  1. Once app is deployed, edit the Acornfile to include a new field for creds and change the default value for existing field.
secrets: config: {
	type: "credential.acorn.io/mytestcred"
	params: {
		promptOrder: ["username", "password", "host"]
	}
	data: {
		username:      "xyz"
		password:      ""
                host: "localhost"
	}
}
containers: {
	mytest: {
		image: "nginx"
        env:{
           username: "secret://config/username"
           password: "secret://config/password"
	}
}
}
  1. Update the app - acorn run --update -n test1 to update the credential definition.
    This does not result in prompting the user with new credential definition.

Expected Behavior:
User should be prompted for changing the existing credential associated with the app/create new new credential to be associated with the app.

Scenario 2:

  1. Deploy app with credentials and a container consuming it - acorn run --update -n test3
secrets: config: {
	type: "credential.acorn.io/mytestcred"
	params: {
		promptOrder: ["username", "password"]
	}
	data: {
		username:      "xxx"
		password:      ""
	}
}
containers: {
	mytest: {
		image: "nginx"
        env:{
           username: "secret://config/username"
           password: "secret://config/password"
	}
}
}
  1. Update app with following Acornfile that adds a new field to the credential - acorn run --update -n test3
secrets: config: {
	type: "credential.acorn.io/mytestcred"
	params: {
		promptOrder: ["username", "password", "host"]
	}
	data: {
		username:      "xyz"
		password:      ""
                host: "localhost"
	}
}
containers: {
	mytest: {
		image: "nginx"
        env:{
           username: "secret://config/username"
           password: "secret://config/password"
           host: "secret://config/host"
	}
}
}
  1. App update fails and gets stuck with error - CreateContainerConfigError: couldn't find key host in Secret mytest3-acorn-4b7f1628/config
mytest3
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] pending
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] (container: mytest): updating; (secret: config): updating
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[0/1] (container: mytest): ContainerCreating
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1/2] (container: mytest): ContainerCreating
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1/2] (container: mytest): CreateContainerConfigError: couldn't find key host in Secret mytest3-acorn-4b7f1628/config
^C% 

Same error is also seen when attempting acorn update -f <Acornfile> <appname>

@sangee2004 sangee2004 added kind/bug Something isn't working help wanted Extra attention is needed labels Jan 18, 2024
@sangee2004 sangee2004 added this to the v0.10.0 milestone Jan 18, 2024
@sangee2004 sangee2004 changed the title acorn run --update does not pick changes made to credentials acorn run --update/ acorn update does not pick changes made to credentials Jan 18, 2024
@cjellick
Copy link
Member

non-blocker for v0.10.0. moving out

@cjellick cjellick modified the milestones: v0.10.0, Backlog Jan 19, 2024
@cjellick cjellick removed the help wanted Extra attention is needed label Feb 2, 2024
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

2 participants