Adding svc-optional
This commit is contained in:
@@ -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(" }}"))
|
||||
|
||||
Reference in New Issue
Block a user