parent
03000c25e0
commit
8ac31330be
@ -137,6 +137,13 @@ var LintRules = map[string][]LintRule{
|
||||
HowToResolve: "name a servce 'app'",
|
||||
Function: LintAppService,
|
||||
},
|
||||
{
|
||||
Ref: "R015",
|
||||
Level: "error",
|
||||
Description: "deploy labels stanza present",
|
||||
HowToResolve: "include \"deploy: labels: ...\" stanza",
|
||||
Function: LintDeployLabelsPresent,
|
||||
},
|
||||
{
|
||||
Ref: "R010",
|
||||
Level: "error",
|
||||
@ -269,6 +276,21 @@ func LintTraefikEnabled(recipe recipe.Recipe) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func LintDeployLabelsPresent(recipe recipe.Recipe) (bool, error) {
|
||||
config, err := recipe.GetComposeConfig(nil)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
for _, service := range config.Services {
|
||||
if service.Name == "app" && service.Deploy.Labels != nil {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func LintHealthchecks(recipe recipe.Recipe) (bool, error) {
|
||||
config, err := recipe.GetComposeConfig(nil)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user