Commit a197eb0a authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Move the UserCredentialStates into the script output

This will make the translation towards using the real script output
easier
parent 999efeb8
......@@ -52,10 +52,6 @@ type (
// Service is the service for which we performed the deploy action
Service service `json:"service"`
// UserCredentials serves to inform, which specific credentials we deployed
// maps credential types to maps of credential names to credential state
UserCredentials map[string]map[string]s.State `json:"user_credentials"`
}
// ackResponse response of the backend for our response
......@@ -372,11 +368,11 @@ func (c *config) handleTask(t task) (err error) {
// TODO change the API towards the scripts so the can tell us which credentials they actually deploy
// here we just expect the script to make them all reach the StateTarget
var userCredentials = make(map[string]map[string]s.State)
var userCredentialStates = make(s.UserCredentialStates)
for credType, credList := range t.Credentials {
for _, credential := range credList {
if stateMap, ok := userCredentials[credType]; !ok {
userCredentials[credType] = map[string]s.State{
if stateMap, ok := userCredentialStates[credType]; !ok {
userCredentialStates[credType] = map[string]s.State{
credential.Name: t.StateTarget,
}
} else {
......@@ -385,11 +381,12 @@ func (c *config) handleTask(t task) (err error) {
}
}
output.UserCredentialStates = userCredentialStates
c.DoneTasks <- taskReply{
ID: t.ID,
Service: t.Service,
Output: output,
UserCredentials: userCredentials,
ID: t.ID,
Service: t.Service,
Output: output,
}
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment