diff --git a/schema/compose-spec.json b/schema/compose-spec.json index b95a1498..f103a93d 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -499,8 +499,9 @@ "properties": { "ignore": {"type": "array", "items": {"type": "string"}}, "path": {"type": "string"}, - "action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart"]}, - "target": {"type": "string"} + "action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart", "sync+exec"]}, + "target": {"type": "string"}, + "exec": {"$ref": "#/definitions/service_hook"} }, "additionalProperties": false, "patternProperties": {"^x-": {}} diff --git a/types/derived.gen.go b/types/derived.gen.go index d33ae280..aa9547c1 100644 --- a/types/derived.gen.go +++ b/types/derived.gen.go @@ -1428,6 +1428,12 @@ func deriveDeepCopy_24(dst, src *NetworkConfig) { } else { dst.Labels = nil } + if src.CustomLabels != nil { + dst.CustomLabels = make(map[string]string, len(src.CustomLabels)) + deriveDeepCopy_4(dst.CustomLabels, src.CustomLabels) + } else { + dst.CustomLabels = nil + } if src.EnableIPv6 == nil { dst.EnableIPv6 = nil } else { @@ -1459,6 +1465,12 @@ func deriveDeepCopy_25(dst, src *VolumeConfig) { } else { dst.Labels = nil } + if src.CustomLabels != nil { + dst.CustomLabels = make(map[string]string, len(src.CustomLabels)) + deriveDeepCopy_4(dst.CustomLabels, src.CustomLabels) + } else { + dst.CustomLabels = nil + } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) src.Extensions.DeepCopy(dst.Extensions) @@ -1473,6 +1485,7 @@ func deriveDeepCopy_26(dst, src *SecretConfig) { dst.File = src.File dst.Environment = src.Environment dst.Content = src.Content + dst.marshallContent = src.marshallContent dst.External = src.External if src.Labels != nil { dst.Labels = make(map[string]string, len(src.Labels)) @@ -1502,6 +1515,7 @@ func deriveDeepCopy_27(dst, src *ConfigObjConfig) { dst.File = src.File dst.Environment = src.Environment dst.Content = src.Content + dst.marshallContent = src.marshallContent dst.External = src.External if src.Labels != nil { dst.Labels = make(map[string]string, len(src.Labels)) @@ -1981,6 +1995,11 @@ func deriveDeepCopy_46(dst, src *Trigger) { dst.Path = src.Path dst.Action = src.Action dst.Target = src.Target + func() { + field := new(ServiceHook) + deriveDeepCopy_44(field, &src.Exec) + dst.Exec = *field + }() if src.Ignore == nil { dst.Ignore = nil } else { diff --git a/types/develop.go b/types/develop.go index 24e142c3..b904d685 100644 --- a/types/develop.go +++ b/types/develop.go @@ -28,12 +28,14 @@ const ( WatchActionSync WatchAction = "sync" WatchActionRebuild WatchAction = "rebuild" WatchActionSyncRestart WatchAction = "sync+restart" + WatchActionSyncExec WatchAction = "sync+exec" ) type Trigger struct { Path string `yaml:"path" json:"path"` Action WatchAction `yaml:"action" json:"action"` Target string `yaml:"target,omitempty" json:"target,omitempty"` + Exec ServiceHook `yaml:"exec,omitempty" json:"exec,omitempty"` Ignore []string `yaml:"ignore,omitempty" json:"ignore,omitempty"` Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` } diff --git a/types/mapping.go b/types/mapping.go index de6fb123..63f6e58b 100644 --- a/types/mapping.go +++ b/types/mapping.go @@ -72,6 +72,16 @@ func (m MappingWithEquals) RemoveEmpty() MappingWithEquals { return m } +func (m MappingWithEquals) ToMapping() Mapping { + o := Mapping{} + for k, v := range m { + if v != nil { + o[k] = *v + } + } + return o +} + func (m *MappingWithEquals) DecodeMapstructure(value interface{}) error { switch v := value.(type) { case map[string]interface{}: