@@ -2,11 +2,11 @@ package service
22
33import (
44 "context"
5+ "fmt"
56
67 "github.com/moby/moby/api/types/filters"
78 "github.com/moby/moby/api/types/swarm"
89 "github.com/moby/moby/client"
9- "github.com/pkg/errors"
1010)
1111
1212// ParseSecrets retrieves the secrets with the requested names and fills
@@ -20,7 +20,7 @@ func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, request
2020
2121 for _ , secret := range requestedSecrets {
2222 if _ , exists := secretRefs [secret .File .Name ]; exists {
23- return nil , errors .Errorf ("duplicate secret target for %s not allowed" , secret .SecretName )
23+ return nil , fmt .Errorf ("duplicate secret target for %s not allowed" , secret .SecretName )
2424 }
2525 secretRef := new (swarm.SecretReference )
2626 * secretRef = * secret
@@ -49,7 +49,7 @@ func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, request
4949 for _ , ref := range secretRefs {
5050 id , ok := foundSecrets [ref .SecretName ]
5151 if ! ok {
52- return nil , errors .Errorf ("secret not found: %s" , ref .SecretName )
52+ return nil , fmt .Errorf ("secret not found: %s" , ref .SecretName )
5353 }
5454
5555 // set the id for the ref to properly assign in swarm
@@ -98,7 +98,7 @@ func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, request
9898 }
9999
100100 if _ , exists := configRefs [config .File .Name ]; exists {
101- return nil , errors .Errorf ("duplicate config target for %s not allowed" , config .ConfigName )
101+ return nil , fmt .Errorf ("duplicate config target for %s not allowed" , config .ConfigName )
102102 }
103103
104104 configRefs [config .File .Name ] = configRef
@@ -129,7 +129,7 @@ func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, request
129129 for _ , ref := range configRefs {
130130 id , ok := foundConfigs [ref .ConfigName ]
131131 if ! ok {
132- return nil , errors .Errorf ("config not found: %s" , ref .ConfigName )
132+ return nil , fmt .Errorf ("config not found: %s" , ref .ConfigName )
133133 }
134134
135135 // set the id for the ref to properly assign in swarm
@@ -144,7 +144,7 @@ func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, request
144144 for _ , ref := range runtimeRefs {
145145 id , ok := foundConfigs [ref .ConfigName ]
146146 if ! ok {
147- return nil , errors .Errorf ("config not found: %s" , ref .ConfigName )
147+ return nil , fmt .Errorf ("config not found: %s" , ref .ConfigName )
148148 }
149149
150150 ref .ConfigID = id
0 commit comments