Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalClient
Commits
a197eb0a
Commit
a197eb0a
authored
Nov 07, 2018
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
task.go
View file @
a197eb0a
...
...
@@ -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
userCredential
State
s
=
make
(
s
.
UserCredential
State
s
)
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
:=
userCredential
State
s
[
credType
];
!
ok
{
userCredential
State
s
[
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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment