1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Bump swarmkit to 1a0ebd43b2d156983a695f90e56f4ecba6ced902

Full diff: 8af8c420f4...1a0ebd43b2

relevant changes:

- swarmkit#2771 Allow using Configs as CredentialSpecs
- swarmkit#2804 Make Service.UpdateStatus non-ambiguous
- swarmkit#2805 Refactor condition in restart supervisor
- swarmkit#2780 api: add BindOptions.NonRecursive
  - related to moby#38003
- swarmkit#2790 Fix possible panic if NetworkConfig is nil
- swarmkit#2797 Include old error-message for backward compatibility
  - related to swarmkit#2779 / moby#38140 / moby#38142

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-02-01 01:21:43 +01:00
parent 87903f2fb5
commit 0e60e48134
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
9 changed files with 772 additions and 386 deletions

View file

@ -130,7 +130,7 @@ github.com/containerd/ttrpc 2a805f71863501300ae1976d29f0454ae003e85a
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
# cluster
github.com/docker/swarmkit 8af8c420f491f006ab1730e08d446a795b1667d7
github.com/docker/swarmkit 1a0ebd43b2d156983a695f90e56f4ecba6ced902
github.com/gogo/protobuf v1.0.0
github.com/cloudflare/cfssl 1.3.2
github.com/fernet/fernet-go 1b2437bc582b3cfbb341ee5a29f8ef5b42912ff2

View file

@ -205,6 +205,7 @@
EncryptionKey
ManagerStatus
FileTarget
RuntimeTarget
SecretReference
ConfigReference
BlacklistedCertificate

File diff suppressed because it is too large Load diff

View file

@ -246,6 +246,8 @@ message Mount {
// Propagation mode of mount.
Propagation propagation = 1;
// allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind".
bool nonrecursive = 2 [(gogoproto.customname) = "NonRecursive"];
}
// VolumeOptions contains parameters for mounting the volume.
@ -976,6 +978,12 @@ message FileTarget {
uint32 mode = 4 [(gogoproto.customtype) = "os.FileMode", (gogoproto.nullable) = false];
}
// RuntimeTarget represents that this secret is _not_ mounted into the
// container, but is used for some other purpose by the container runtime.
//
// Currently, RuntimeTarget has no fields; it's just a placeholder.
message RuntimeTarget {}
// SecretReference is the linkage between a service and a secret that it uses.
message SecretReference {
// SecretID represents the ID of the specific Secret that we're
@ -1003,9 +1011,10 @@ message ConfigReference {
// lookup/display purposes. The config in the reference will be identified by its ID.
string config_name = 2;
// Target specifies how this secret should be exposed to the task.
// Target specifies how this config should be exposed to the task.
oneof target {
FileTarget file = 3;
RuntimeTarget runtime = 4;
}
}
@ -1075,6 +1084,10 @@ message Privileges {
oneof source {
string file = 1;
string registry = 2;
// Config represents a Config ID from which to get the CredentialSpec.
// The Config MUST be included in the SecretReferences with a RuntimeTarget
string Config = 3;
}
}
CredentialSpec credential_spec = 1;

View file

@ -682,7 +682,10 @@ func (s *Server) CreateService(ctx context.Context, request *api.CreateServiceRe
})
switch err {
case store.ErrNameConflict:
return nil, status.Errorf(codes.AlreadyExists, "service %s already exists", request.Spec.Annotations.Name)
// Enhance the name-confict error to include the service name. The original
// `ErrNameConflict` error-message is included for backward-compatibility
// with older consumers of the API performing string-matching.
return nil, status.Errorf(codes.AlreadyExists, "%s: service %s already exists", err.Error(), request.Spec.Annotations.Name)
case nil:
return &api.CreateServiceResponse{Service: service}, nil
default:

View file

@ -1010,10 +1010,16 @@ func (m *Manager) becomeLeader(ctx context.Context) {
cluster = store.GetCluster(tx, clusterID)
})
if cluster.DefaultAddressPool != nil {
if m.config.NetworkConfig == nil {
m.config.NetworkConfig = &cnmallocator.NetworkConfig{}
}
m.config.NetworkConfig.DefaultAddrPool = append(m.config.NetworkConfig.DefaultAddrPool, cluster.DefaultAddressPool...)
m.config.NetworkConfig.SubnetSize = cluster.SubnetSize
}
if cluster.VXLANUDPPort != 0 {
if m.config.NetworkConfig == nil {
m.config.NetworkConfig = &cnmallocator.NetworkConfig{}
}
m.config.NetworkConfig.VXLANUDPPort = cluster.VXLANUDPPort
}
}

View file

@ -194,10 +194,18 @@ func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Clus
// restart policy.
func (r *Supervisor) shouldRestart(ctx context.Context, t *api.Task, service *api.Service) bool {
// TODO(aluzzardi): This function should not depend on `service`.
condition := orchestrator.RestartCondition(t)
if condition != api.RestartOnAny &&
(condition != api.RestartOnFailure || t.Status.State == api.TaskStateCompleted) {
// There are 3 possible restart policies.
switch orchestrator.RestartCondition(t) {
case api.RestartOnAny:
// we will be restarting, we just need to do a few more checks
case api.RestartOnFailure:
// we won't restart if the task is in TaskStateCompleted, as this is a
// not a failed state -- it indicates that the task exited with 0
if t.Status.State == api.TaskStateCompleted {
return false
}
case api.RestartOnNone:
// RestartOnNone means we just don't restart, ever
return false
}

View file

@ -141,10 +141,17 @@ func (u *Updater) Run(ctx context.Context, slots []orchestrator.Slot) {
}
// Abort immediately if all tasks are clean.
if len(dirtySlots) == 0 {
if service.UpdateStatus != nil &&
(service.UpdateStatus.State == api.UpdateStatus_UPDATING ||
service.UpdateStatus.State == api.UpdateStatus_ROLLBACK_STARTED) {
u.completeUpdate(ctx, service.ID)
if service.UpdateStatus == nil {
if u.annotationsUpdated(service) {
// Annotation-only update; mark the update as completed
u.completeUpdate(ctx, service.ID, true)
}
return
}
if service.UpdateStatus.State == api.UpdateStatus_UPDATING || service.UpdateStatus.State == api.UpdateStatus_ROLLBACK_STARTED {
// Update or rollback was started, and is now complete
u.completeUpdate(ctx, service.ID, true)
return
}
return
}
@ -303,7 +310,7 @@ slotsLoop:
// have reached RUNNING by this point.
if !stopped {
u.completeUpdate(ctx, service.ID)
u.completeUpdate(ctx, service.ID, false)
}
}
@ -616,25 +623,32 @@ func (u *Updater) rollbackUpdate(ctx context.Context, serviceID, message string)
}
}
func (u *Updater) completeUpdate(ctx context.Context, serviceID string) {
func (u *Updater) completeUpdate(ctx context.Context, serviceID string, force bool) {
log.G(ctx).Debugf("update of service %s complete", serviceID)
err := u.store.Update(func(tx store.Tx) error {
service := store.GetService(tx, serviceID)
if service == nil {
switch {
case service == nil:
return nil
}
if service.UpdateStatus == nil {
case service.UpdateStatus == nil && force:
// Force marking the status as updated; to account for annotation-only updates.
service.UpdateStatus = &api.UpdateStatus{
StartedAt: ptypes.MustTimestampProto(time.Now()),
State: api.UpdateStatus_COMPLETED,
Message: "update completed",
}
case service.UpdateStatus == nil:
// The service was changed since we started this update
return nil
}
if service.UpdateStatus.State == api.UpdateStatus_ROLLBACK_STARTED {
case service.UpdateStatus.State == api.UpdateStatus_ROLLBACK_STARTED:
service.UpdateStatus.State = api.UpdateStatus_ROLLBACK_COMPLETED
service.UpdateStatus.Message = "rollback completed"
} else {
default:
service.UpdateStatus.State = api.UpdateStatus_COMPLETED
service.UpdateStatus.Message = "update completed"
}
service.UpdateStatus.CompletedAt = ptypes.MustTimestampProto(time.Now())
return store.UpdateService(tx, service)
@ -644,3 +658,10 @@ func (u *Updater) completeUpdate(ctx context.Context, serviceID string) {
log.G(ctx).WithError(err).Errorf("failed to mark update of service %s complete", serviceID)
}
}
func (u *Updater) annotationsUpdated(service *api.Service) bool {
if service.PreviousSpec == nil {
return false
}
return !reflect.DeepEqual(service.Spec, service.PreviousSpec)
}

View file

@ -15,41 +15,41 @@ github.com/matttproud/golang_protobuf_extensions v1.0.0
google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9
# metrics
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18
# etcd/raft
github.com/coreos/etcd v3.2.1
github.com/coreos/etcd v3.3.9
github.com/coreos/go-systemd v17
github.com/coreos/pkg v3
github.com/prometheus/client_golang 52437c81da6b127a9925d17eb3a382a2e5fd395e
github.com/prometheus/client_model fa8ad6fec33561be4280a8f0514318c79d7f6cb6
github.com/prometheus/common ebdfc6da46522d58825777cf1f90490a5b1ef1d8
github.com/prometheus/procfs abf152e5f3e97f2fafac028d2cc06c1feb87ffa5
github.com/prometheus/client_golang v0.8.0
github.com/prometheus/client_model 6f3806018612930941127f2a7c6c453ba2c527d2
github.com/prometheus/common 7600349dcfe1abd18d72d3a1770870d9800a7801
github.com/prometheus/procfs 7d6f385de8bea29190f15ba9931442a0eaef9af7
github.com/docker/distribution 83389a148052d74ac602f5f1d62f86ff2f3c4aa5
github.com/docker/docker b9bb3bae5161f931c1dede43c67948c599197f50
github.com/docker/go-connections 7beb39f0b969b075d1325fecb092faf27fd357b6
github.com/docker/docker 5a718ef0f94f605fe4e4885937133c2f76ad2a41
github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/docker/go-units 9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1
github.com/docker/libkv 1d8431073ae03cdaedb198a89722f3aab6d418ef
github.com/docker/libnetwork 1f28166bb386cf9223d2d00a28382b0e474be314
github.com/opencontainers/runc ad0f5255060d36872be04de22f8731f38ef2d7b1
github.com/docker/libkv 458977154600b9f23984d9f4b82e79570b5ae12b
github.com/docker/libnetwork 1a06131fb8a047d919f7deaf02a4c414d7884b83
github.com/opencontainers/runc 96ec2177ae841256168fcf76954f7177af9446eb
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec v1.0.1
github.com/ishidawataru/sctp 07191f837fedd2f13d1ec7b5f885f0f3ec54b1cb
github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76 # v1.1.0
github.com/Microsoft/go-winio v0.4.8
github.com/sirupsen/logrus v1.0.3
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
github.com/Microsoft/go-winio v0.4.11
github.com/sirupsen/logrus v1.0.6
github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceaf
github.com/cloudflare/cfssl 1.3.2
github.com/dustin/go-humanize 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0
github.com/fernet/fernet-go 1b2437bc582b3cfbb341ee5a29f8ef5b42912ff2
github.com/google/certificate-transparency-go v1.0.20
github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git
github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad
github.com/hashicorp/golang-lru a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4
github.com/hashicorp/golang-lru 0fb14efe8c47ae851c0034ed7a448854d3d34cf3
github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5
github.com/pivotal-golang/clock 3fd3c1944c59d9742e1cd333672181cd1a6f9fa0
@ -60,8 +60,8 @@ github.com/spf13/cobra 8e91712f174ced10270cf66615e0a9127e7c4de5
github.com/spf13/pflag 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7
github.com/stretchr/testify v1.1.4
go.etcd.io/bbolt v1.3.1-etcd.8
golang.org/x/crypto 1a580b3eff7814fc9b40602fd35256c63b50f491
golang.org/x/net 0ed95abb35c445290478a5348a7b38bb154135fd
golang.org/x/sys 37707fdb30a5b38865cfb95e5aab41707daec7fd
golang.org/x/text f72d8390a633d5dfb0cc84043294db9f6c935756
golang.org/x/time a4bde12657593d5e90d0533a3e4fd95e635124cb
golang.org/x/crypto 0709b304e793a5edb4a2c0145f281ecdc20838a4
golang.org/x/net a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1
golang.org/x/sys 90868a75fefd03942536221d7c0e2f84ec62a668
golang.org/x/text f21a4dfb5e38f5895301dc265a8def02365cc3d0 # v0.3.0
golang.org/x/time fbb02b2291d28baffd63558aa44b4b56f178d650