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
0cf9a461
Commit
0cf9a461
authored
Nov 27, 2018
by
Lukas Burgey
Browse files
Adapt to changes at the backend
parent
2425d630
Changes
1
Hide whitespace changes
Inline
Side-by-side
task.go
View file @
0cf9a461
...
...
@@ -35,9 +35,11 @@ type (
User
s
.
User
`json:"user"`
Credentials
map
[
string
][]
s
.
Credential
`json:"credentials"`
Questionnaire
map
[
string
]
string
`json:"questionnaire"`
VO
vo
`json:"vo"`
// Service may be overwritten by scheduleTask
// VO is only set if this is a VODeployment
VO
vo
`json:"vo,omitempty"`
// Service may be filled by scheduleTask
Service
service
`json:"service,omitempty"`
// Exchange and RoutingKey are inserted when we receive the task via RabbitMQ
...
...
@@ -193,7 +195,6 @@ func (c *config) taskResponder() {
}
}
// IMPLEMENTATIONS
func
(
c
*
config
)
fetchTasks
()
(
err
error
)
{
if
len
(
c
.
EntitlementToServices
)
==
0
&&
len
(
c
.
GroupToServices
)
==
0
{
log
.
Printf
(
"[HTTP] Not fetching because the are no services to fetch"
)
...
...
@@ -293,7 +294,7 @@ func (c *config) handleTask(t task) (err error) {
StateTarget
:
t
.
StateTarget
,
User
:
t
.
User
,
Questionnaire
:
t
.
Questionnaire
,
Credentials
:
t
.
Credentials
,
Credentials
:
t
.
User
.
Credentials
,
}
iBytes
,
err
:=
input
.
Marshal
()
...
...
@@ -379,7 +380,7 @@ func (c *config) handleTask(t task) (err error) {
// credentials to have the same state as the whole execution (output.State)
if
output
.
UserCredentialStates
==
nil
{
var
userCredentialStates
=
make
(
s
.
UserCredentialStates
)
for
credType
,
credList
:=
range
t
.
Credentials
{
for
credType
,
credList
:=
range
t
.
User
.
Credentials
{
for
_
,
credential
:=
range
credList
{
if
stateMap
,
ok
:=
userCredentialStates
[
credType
];
!
ok
{
userCredentialStates
[
credType
]
=
map
[
string
]
s
.
State
{
...
...
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