Adding svc-optional
Some checks failed
Go-Tests / tests (pull_request) Successful in 5m21s
Go-Tests / sonar (pull_request) Failing after 37s

This commit is contained in:
2025-12-02 20:40:57 -06:00
parent 7230081401
commit 3a1c170140
6 changed files with 33 additions and 1 deletions

View File

@@ -83,6 +83,14 @@ func isIgnored(service types.ServiceConfig) bool {
return false
}
// isSvcOptionald returns true if the service is optional.
func isSvcOptional(service types.ServiceConfig) bool {
if v, ok := service.Labels[labels.LabelSvcOptional]; ok {
return v == "true" || v == "yes" || v == "1"
}
return false
}
// UnWrapTPL removes the line wrapping from a template.
func UnWrapTPL(in []byte) []byte {
return regexpLineWrap.ReplaceAll(in, []byte(" }}"))