Add support for negated placement constraint (#1419)

This commit is contained in:
ichx
2021-08-27 22:49:55 +08:00
committed by GitHub
parent e3c78d7419
commit e82fe96c38
18 changed files with 529 additions and 40 deletions
+8 -2
View File
@@ -145,8 +145,8 @@ type ServiceConfig struct {
GroupAdd []int64 `compose:"group_add"`
Volumes []Volumes `compose:""`
Secrets []dockerCliTypes.ServiceSecretConfig
HealthChecks HealthChecks `compose:""`
Placement map[string]string `compose:""`
HealthChecks HealthChecks `compose:""`
Placement Placement `compose:""`
//This is for long LONG SYNTAX link(https://docs.docker.com/compose/compose-file/#long-syntax)
Configs []dockerCliTypes.ServiceConfigObjConfig `compose:""`
//This is for SHORT SYNTAX link(https://docs.docker.com/compose/compose-file/#configs)
@@ -203,6 +203,12 @@ type Volumes struct {
SelectorValue string // Value of the label selector
}
// Placement holds the placement struct of container
type Placement struct {
PositiveConstraints map[string]string
NegativeConstraints map[string]string
}
// GetConfigMapKeyFromMeta ...
// given a source name ,find the file and extract the filename which will be act as ConfigMap key
// return "" if not found