Skip to content

Commit

Permalink
check if secrets defined in services are defined
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed Nov 1, 2022
1 parent 517cf49 commit 7ae3153
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions loader/validate.go
Expand Up @@ -70,6 +70,12 @@ func checkConsistency(project *types.Project) error {
return errors.Wrap(errdefs.ErrInvalid, fmt.Sprintf("service %q refers to undefined config %s", s.Name, config.Source))
}
}

for _, secret := range s.Secrets {
if _, ok := project.Secrets[secret.Source]; !ok {
return errors.Wrap(errdefs.ErrInvalid, fmt.Sprintf("service %q refers to undefined secret %s", s.Name, secret.Source))
}
}
}

for name, secret := range project.Secrets {
Expand Down

0 comments on commit 7ae3153

Please sign in to comment.