forked from moby/swarmkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
specs.pb.go
5584 lines (5399 loc) · 142 KB
/
specs.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo.
// source: specs.proto
// DO NOT EDIT!
package api
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/gogo/protobuf/types"
import github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
import strings "strings"
import reflect "reflect"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type NodeSpec_Membership int32
const (
NodeMembershipPending NodeSpec_Membership = 0
NodeMembershipAccepted NodeSpec_Membership = 1
)
var NodeSpec_Membership_name = map[int32]string{
0: "PENDING",
1: "ACCEPTED",
}
var NodeSpec_Membership_value = map[string]int32{
"PENDING": 0,
"ACCEPTED": 1,
}
func (x NodeSpec_Membership) String() string {
return proto.EnumName(NodeSpec_Membership_name, int32(x))
}
func (NodeSpec_Membership) EnumDescriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{0, 0} }
type NodeSpec_Availability int32
const (
// Active nodes.
NodeAvailabilityActive NodeSpec_Availability = 0
// Paused nodes won't be considered by the scheduler, preventing any
// further task to run on them.
NodeAvailabilityPause NodeSpec_Availability = 1
// Drained nodes are paused and any task already running on them will
// be evicted.
NodeAvailabilityDrain NodeSpec_Availability = 2
)
var NodeSpec_Availability_name = map[int32]string{
0: "ACTIVE",
1: "PAUSE",
2: "DRAIN",
}
var NodeSpec_Availability_value = map[string]int32{
"ACTIVE": 0,
"PAUSE": 1,
"DRAIN": 2,
}
func (x NodeSpec_Availability) String() string {
return proto.EnumName(NodeSpec_Availability_name, int32(x))
}
func (NodeSpec_Availability) EnumDescriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{0, 1} }
// ResolutionMode specifies the mode of resolution to use for
// internal loadbalancing between tasks which are all within
// the cluster. This is sometimes calls east-west data path.
type EndpointSpec_ResolutionMode int32
const (
// VIP resolution mode specifies that the
// service resolves to a logical IP and the requests
// are sent to that logical IP. Packets hitting that
// logical IP are load balanced to a chosen backend.
ResolutionModeVirtualIP EndpointSpec_ResolutionMode = 0
// DNSRR resolution mode specifies that the
// service directly gets resolved to one of the
// backend IP and the client directly initiates a
// request towards the actual backend. This requires
// that the client does not cache the DNS responses
// when the DNS response TTL is 0.
ResolutionModeDNSRoundRobin EndpointSpec_ResolutionMode = 1
)
var EndpointSpec_ResolutionMode_name = map[int32]string{
0: "VIP",
1: "DNSRR",
}
var EndpointSpec_ResolutionMode_value = map[string]int32{
"VIP": 0,
"DNSRR": 1,
}
func (x EndpointSpec_ResolutionMode) String() string {
return proto.EnumName(EndpointSpec_ResolutionMode_name, int32(x))
}
func (EndpointSpec_ResolutionMode) EnumDescriptor() ([]byte, []int) {
return fileDescriptorSpecs, []int{8, 0}
}
type NodeSpec struct {
Annotations Annotations `protobuf:"bytes,1,opt,name=annotations" json:"annotations"`
// DesiredRole defines the role the node should have.
DesiredRole NodeRole `protobuf:"varint,2,opt,name=desired_role,json=desiredRole,proto3,enum=docker.swarmkit.v1.NodeRole" json:"desired_role,omitempty"`
// Membership controls the admission of the node into the cluster.
Membership NodeSpec_Membership `protobuf:"varint,3,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership" json:"membership,omitempty"`
// Availability allows a user to control the current scheduling status of a
// node.
Availability NodeSpec_Availability `protobuf:"varint,4,opt,name=availability,proto3,enum=docker.swarmkit.v1.NodeSpec_Availability" json:"availability,omitempty"`
}
func (m *NodeSpec) Reset() { *m = NodeSpec{} }
func (*NodeSpec) ProtoMessage() {}
func (*NodeSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{0} }
// ServiceSpec defines the properties of a service.
//
// A service instructs the cluster in orchestrating repeated instances of a
// template, implemented as tasks. Based on the number of instances, scheduling
// strategy and restart policy, a number of application-level behaviors can be
// defined.
type ServiceSpec struct {
Annotations Annotations `protobuf:"bytes,1,opt,name=annotations" json:"annotations"`
// Task defines the task template this service will spawn.
Task TaskSpec `protobuf:"bytes,2,opt,name=task" json:"task"`
// Types that are valid to be assigned to Mode:
// *ServiceSpec_Replicated
// *ServiceSpec_Global
Mode isServiceSpec_Mode `protobuf_oneof:"mode"`
// Update contains settings which affect updates.
Update *UpdateConfig `protobuf:"bytes,6,opt,name=update" json:"update,omitempty"`
// Rollback contains settings which affect rollbacks of updates.
Rollback *UpdateConfig `protobuf:"bytes,9,opt,name=rollback" json:"rollback,omitempty"`
// ServiceSpec.Networks has been deprecated and is replaced by
// Networks field in Task (TaskSpec.Networks).
// This field (ServiceSpec.Networks) is kept for compatibility.
// In case TaskSpec.Networks does not exist, ServiceSpec.Networks
// is still honored if it exists.
Networks []*NetworkAttachmentConfig `protobuf:"bytes,7,rep,name=networks" json:"networks,omitempty"`
// Service endpoint specifies the user provided configuration
// to properly discover and load balance a service.
Endpoint *EndpointSpec `protobuf:"bytes,8,opt,name=endpoint" json:"endpoint,omitempty"`
}
func (m *ServiceSpec) Reset() { *m = ServiceSpec{} }
func (*ServiceSpec) ProtoMessage() {}
func (*ServiceSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{1} }
type isServiceSpec_Mode interface {
isServiceSpec_Mode()
MarshalTo([]byte) (int, error)
Size() int
}
type ServiceSpec_Replicated struct {
Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,oneof"`
}
type ServiceSpec_Global struct {
Global *GlobalService `protobuf:"bytes,4,opt,name=global,oneof"`
}
func (*ServiceSpec_Replicated) isServiceSpec_Mode() {}
func (*ServiceSpec_Global) isServiceSpec_Mode() {}
func (m *ServiceSpec) GetMode() isServiceSpec_Mode {
if m != nil {
return m.Mode
}
return nil
}
func (m *ServiceSpec) GetReplicated() *ReplicatedService {
if x, ok := m.GetMode().(*ServiceSpec_Replicated); ok {
return x.Replicated
}
return nil
}
func (m *ServiceSpec) GetGlobal() *GlobalService {
if x, ok := m.GetMode().(*ServiceSpec_Global); ok {
return x.Global
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{
(*ServiceSpec_Replicated)(nil),
(*ServiceSpec_Global)(nil),
}
}
func _ServiceSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*ServiceSpec)
// mode
switch x := m.Mode.(type) {
case *ServiceSpec_Replicated:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Replicated); err != nil {
return err
}
case *ServiceSpec_Global:
_ = b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Global); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("ServiceSpec.Mode has unexpected type %T", x)
}
return nil
}
func _ServiceSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*ServiceSpec)
switch tag {
case 3: // mode.replicated
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ReplicatedService)
err := b.DecodeMessage(msg)
m.Mode = &ServiceSpec_Replicated{msg}
return true, err
case 4: // mode.global
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(GlobalService)
err := b.DecodeMessage(msg)
m.Mode = &ServiceSpec_Global{msg}
return true, err
default:
return false, nil
}
}
func _ServiceSpec_OneofSizer(msg proto.Message) (n int) {
m := msg.(*ServiceSpec)
// mode
switch x := m.Mode.(type) {
case *ServiceSpec_Replicated:
s := proto.Size(x.Replicated)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *ServiceSpec_Global:
s := proto.Size(x.Global)
n += proto.SizeVarint(4<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// ReplicatedService sets the reconciliation target to certain number of replicas.
type ReplicatedService struct {
Replicas uint64 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"`
}
func (m *ReplicatedService) Reset() { *m = ReplicatedService{} }
func (*ReplicatedService) ProtoMessage() {}
func (*ReplicatedService) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{2} }
// GlobalService represents global service.
type GlobalService struct {
}
func (m *GlobalService) Reset() { *m = GlobalService{} }
func (*GlobalService) ProtoMessage() {}
func (*GlobalService) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{3} }
type TaskSpec struct {
// Types that are valid to be assigned to Runtime:
// *TaskSpec_Attachment
// *TaskSpec_Container
// *TaskSpec_Plugin
Runtime isTaskSpec_Runtime `protobuf_oneof:"runtime"`
// Resource requirements for the container.
Resources *ResourceRequirements `protobuf:"bytes,2,opt,name=resources" json:"resources,omitempty"`
// RestartPolicy specifies what to do when a task fails or finishes.
Restart *RestartPolicy `protobuf:"bytes,4,opt,name=restart" json:"restart,omitempty"`
// Placement specifies node selection constraints
Placement *Placement `protobuf:"bytes,5,opt,name=placement" json:"placement,omitempty"`
// LogDriver specifies the log driver to use for the task. Any runtime will
// direct logs into the specified driver for the duration of the task.
LogDriver *Driver `protobuf:"bytes,6,opt,name=log_driver,json=logDriver" json:"log_driver,omitempty"`
// Networks specifies the list of network attachment
// configurations (which specify the network and per-network
// aliases) that this task spec is bound to.
Networks []*NetworkAttachmentConfig `protobuf:"bytes,7,rep,name=networks" json:"networks,omitempty"`
// ForceUpdate is a counter that triggers an update even if no relevant
// parameters have been changed. We do this to allow forced restarts
// using the same reconciliation-based mechanism that performs rolling
// updates.
ForceUpdate uint64 `protobuf:"varint,9,opt,name=force_update,json=forceUpdate,proto3" json:"force_update,omitempty"`
}
func (m *TaskSpec) Reset() { *m = TaskSpec{} }
func (*TaskSpec) ProtoMessage() {}
func (*TaskSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{4} }
type isTaskSpec_Runtime interface {
isTaskSpec_Runtime()
MarshalTo([]byte) (int, error)
Size() int
}
type TaskSpec_Attachment struct {
Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,oneof"`
}
type TaskSpec_Container struct {
Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,oneof"`
}
type TaskSpec_Plugin struct {
Plugin *PluginSpec `protobuf:"bytes,10,opt,name=plugin,oneof"`
}
func (*TaskSpec_Attachment) isTaskSpec_Runtime() {}
func (*TaskSpec_Container) isTaskSpec_Runtime() {}
func (*TaskSpec_Plugin) isTaskSpec_Runtime() {}
func (m *TaskSpec) GetRuntime() isTaskSpec_Runtime {
if m != nil {
return m.Runtime
}
return nil
}
func (m *TaskSpec) GetAttachment() *NetworkAttachmentSpec {
if x, ok := m.GetRuntime().(*TaskSpec_Attachment); ok {
return x.Attachment
}
return nil
}
func (m *TaskSpec) GetContainer() *ContainerSpec {
if x, ok := m.GetRuntime().(*TaskSpec_Container); ok {
return x.Container
}
return nil
}
func (m *TaskSpec) GetPlugin() *PluginSpec {
if x, ok := m.GetRuntime().(*TaskSpec_Plugin); ok {
return x.Plugin
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*TaskSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _TaskSpec_OneofMarshaler, _TaskSpec_OneofUnmarshaler, _TaskSpec_OneofSizer, []interface{}{
(*TaskSpec_Attachment)(nil),
(*TaskSpec_Container)(nil),
(*TaskSpec_Plugin)(nil),
}
}
func _TaskSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*TaskSpec)
// runtime
switch x := m.Runtime.(type) {
case *TaskSpec_Attachment:
_ = b.EncodeVarint(8<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Attachment); err != nil {
return err
}
case *TaskSpec_Container:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Container); err != nil {
return err
}
case *TaskSpec_Plugin:
_ = b.EncodeVarint(10<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Plugin); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("TaskSpec.Runtime has unexpected type %T", x)
}
return nil
}
func _TaskSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*TaskSpec)
switch tag {
case 8: // runtime.attachment
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(NetworkAttachmentSpec)
err := b.DecodeMessage(msg)
m.Runtime = &TaskSpec_Attachment{msg}
return true, err
case 1: // runtime.container
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ContainerSpec)
err := b.DecodeMessage(msg)
m.Runtime = &TaskSpec_Container{msg}
return true, err
case 10: // runtime.plugin
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PluginSpec)
err := b.DecodeMessage(msg)
m.Runtime = &TaskSpec_Plugin{msg}
return true, err
default:
return false, nil
}
}
func _TaskSpec_OneofSizer(msg proto.Message) (n int) {
m := msg.(*TaskSpec)
// runtime
switch x := m.Runtime.(type) {
case *TaskSpec_Attachment:
s := proto.Size(x.Attachment)
n += proto.SizeVarint(8<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *TaskSpec_Container:
s := proto.Size(x.Container)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *TaskSpec_Plugin:
s := proto.Size(x.Plugin)
n += proto.SizeVarint(10<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// NetworkAttachmentSpec specifies runtime parameters required to attach
// a container to a network.
type NetworkAttachmentSpec struct {
// ContainerID specifies a unique ID of the container for which
// this attachment is for.
ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
}
func (m *NetworkAttachmentSpec) Reset() { *m = NetworkAttachmentSpec{} }
func (*NetworkAttachmentSpec) ProtoMessage() {}
func (*NetworkAttachmentSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{5} }
// Container specifies runtime parameters for a container.
type ContainerSpec struct {
// image defines the image reference, as specified in the
// distribution/reference package. This may include a registry host, name,
// tag or digest.
//
// The field will be directly passed to the engine pulling. Well-behaved
// service definitions will used immutable references, either through tags
// that don't change or verifiable digests.
Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
// Labels defines labels to be added to the container at creation time. If
// collisions with system labels occur, these labels will be overridden.
//
// This field *must* remain compatible with the Labels field of
// Annotations.
Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Command to run the the container. The first element is a path to the
// executable and the following elements are treated as arguments.
//
// If command is empty, execution will fall back to the image's entrypoint.
//
// Command should only be used when overriding entrypoint.
Command []string `protobuf:"bytes,3,rep,name=command" json:"command,omitempty"`
// Args specifies arguments provided to the image's entrypoint.
//
// If Command and Args are provided, Args will be appended to Command.
Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"`
// Hostname specifies the hostname that will be set on containers created by docker swarm.
// All containers for a given service will have the same hostname
Hostname string `protobuf:"bytes,14,opt,name=hostname,proto3" json:"hostname,omitempty"`
// Env specifies the environment variables for the container in NAME=VALUE
// format. These must be compliant with [IEEE Std
// 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html).
Env []string `protobuf:"bytes,5,rep,name=env" json:"env,omitempty"`
// Dir defines the working directory to set for the container process.
Dir string `protobuf:"bytes,6,opt,name=dir,proto3" json:"dir,omitempty"`
// User specifies the user that should be employed to run the container.
//
// Note that the primary group may be specified by appending the group name
// or id to the user name, separated by a `:`. This syntax is
// `<user>:<group>`.
User string `protobuf:"bytes,7,opt,name=user,proto3" json:"user,omitempty"`
// Groups specifies supplementary groups available to the user.
Groups []string `protobuf:"bytes,11,rep,name=groups" json:"groups,omitempty"`
// TTY declares that a TTY should be attached to the standard streams,
// including stdin if it is still open.
TTY bool `protobuf:"varint,13,opt,name=tty,proto3" json:"tty,omitempty"`
// OpenStdin declares that the standard input (stdin) should be open.
OpenStdin bool `protobuf:"varint,18,opt,name=open_stdin,json=openStdin,proto3" json:"open_stdin,omitempty"`
// ReadOnly declares that the container root filesystem is read-only.
// This only impacts the root filesystem, not additional mounts (including
// tmpfs). For additional mounts that are not part of the initial rootfs,
// they will be decided by the modes passed in the mount definition.
ReadOnly bool `protobuf:"varint,19,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
// StopSignal defines the signal to stop the container.
StopSignal string `protobuf:"bytes,20,opt,name=stop_signal,json=stopSignal,proto3" json:"stop_signal,omitempty"`
Mounts []Mount `protobuf:"bytes,8,rep,name=mounts" json:"mounts"`
// StopGracePeriod the grace period for stopping the container before
// forcefully killing the container.
// Note: Can't use stdduration here because this needs to be nullable.
StopGracePeriod *google_protobuf1.Duration `protobuf:"bytes,9,opt,name=stop_grace_period,json=stopGracePeriod" json:"stop_grace_period,omitempty"`
// PullOptions parameterize the behavior of image pulls.
PullOptions *ContainerSpec_PullOptions `protobuf:"bytes,10,opt,name=pull_options,json=pullOptions" json:"pull_options,omitempty"`
// SecretReference contains references to zero or more secrets that
// will be exposed to the container.
Secrets []*SecretReference `protobuf:"bytes,12,rep,name=secrets" json:"secrets,omitempty"`
// Hosts allow additional entries to be specified in /etc/hosts
// that associates IP addresses with hostnames.
// Detailed documentation is available in:
// http://man7.org/linux/man-pages/man5/hosts.5.html
// IP_address canonical_hostname [aliases...]
//
// The format of the Hosts in swarmkit follows the same as
// above.
// This is different from `docker run --add-host <hostname>:<ip>`
// where format is `<hostname>:<ip>`
Hosts []string `protobuf:"bytes,17,rep,name=hosts" json:"hosts,omitempty"`
// DNSConfig allows one to specify DNS related configuration in resolv.conf
DNSConfig *ContainerSpec_DNSConfig `protobuf:"bytes,15,opt,name=dns_config,json=dnsConfig" json:"dns_config,omitempty"`
// Healthcheck describes how to check the container is healthy. If the
// container is considered unhealthy, it will be destroyed, its creating
// task will exit and a new task will be rescheduled elsewhere. A container
// is considered unhealthy after `Retries` number of consecutive failures.
Healthcheck *HealthConfig `protobuf:"bytes,16,opt,name=healthcheck" json:"healthcheck,omitempty"`
}
func (m *ContainerSpec) Reset() { *m = ContainerSpec{} }
func (*ContainerSpec) ProtoMessage() {}
func (*ContainerSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{6} }
// PullOptions allows one to parameterize an image pull.
type ContainerSpec_PullOptions struct {
// RegistryAuth is the registry auth token obtained from the client, required
// to pull private images. This is the unmodified JSON used as part of
// the `X-Registry-Auth` header.
// TODO(nishanttotla): This field will later be deprecated
RegistryAuth string `protobuf:"bytes,64,opt,name=registry_auth,json=registryAuth,proto3" json:"registry_auth,omitempty"`
}
func (m *ContainerSpec_PullOptions) Reset() { *m = ContainerSpec_PullOptions{} }
func (*ContainerSpec_PullOptions) ProtoMessage() {}
func (*ContainerSpec_PullOptions) Descriptor() ([]byte, []int) {
return fileDescriptorSpecs, []int{6, 1}
}
// DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf)
// Detailed documentation is available in:
// http://man7.org/linux/man-pages/man5/resolv.conf.5.html
// TODO: domain is not supported yet
type ContainerSpec_DNSConfig struct {
// Nameservers specifies the IP addresses of the name servers
Nameservers []string `protobuf:"bytes,1,rep,name=nameservers" json:"nameservers,omitempty"`
// Search specifies the search list for host-name lookup
Search []string `protobuf:"bytes,2,rep,name=search" json:"search,omitempty"`
// Options allows certain internal resolver variables to be modified
Options []string `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
}
func (m *ContainerSpec_DNSConfig) Reset() { *m = ContainerSpec_DNSConfig{} }
func (*ContainerSpec_DNSConfig) ProtoMessage() {}
func (*ContainerSpec_DNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{6, 2} }
// PluginSpec specifies runtime parameters for a plugin.
type PluginSpec struct {
// image defines the image reference, as specified in the
// distribution/reference package. This may include a registry host, name,
// tag or digest.
Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
}
func (m *PluginSpec) Reset() { *m = PluginSpec{} }
func (*PluginSpec) ProtoMessage() {}
func (*PluginSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{7} }
// EndpointSpec defines the properties that can be configured to
// access and loadbalance the service.
type EndpointSpec struct {
Mode EndpointSpec_ResolutionMode `protobuf:"varint,1,opt,name=mode,proto3,enum=docker.swarmkit.v1.EndpointSpec_ResolutionMode" json:"mode,omitempty"`
// List of exposed ports that this service is accessible from
// external to the cluster.
Ports []*PortConfig `protobuf:"bytes,2,rep,name=ports" json:"ports,omitempty"`
}
func (m *EndpointSpec) Reset() { *m = EndpointSpec{} }
func (*EndpointSpec) ProtoMessage() {}
func (*EndpointSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{8} }
// NetworkSpec specifies user defined network parameters.
type NetworkSpec struct {
Annotations Annotations `protobuf:"bytes,1,opt,name=annotations" json:"annotations"`
// DriverConfig specific configuration consumed by the network driver.
DriverConfig *Driver `protobuf:"bytes,2,opt,name=driver_config,json=driverConfig" json:"driver_config,omitempty"`
// IPv6Enabled enables support for IPv6 on the network.
Ipv6Enabled bool `protobuf:"varint,3,opt,name=ipv6_enabled,json=ipv6Enabled,proto3" json:"ipv6_enabled,omitempty"`
// internal restricts external access to the network. This may be
// accomplished by disabling the default gateway or through other means.
Internal bool `protobuf:"varint,4,opt,name=internal,proto3" json:"internal,omitempty"`
IPAM *IPAMOptions `protobuf:"bytes,5,opt,name=ipam" json:"ipam,omitempty"`
// Attachable allows external(to swarm) entities to manually
// attach to this network. With this flag enabled, external
// entities such as containers running in an worker node in
// the cluster can manually attach to this network and access
// the services attached to this network. If this flag is not
// enabled(default case) no manual attachment to this network
// can happen.
Attachable bool `protobuf:"varint,6,opt,name=attachable,proto3" json:"attachable,omitempty"`
}
func (m *NetworkSpec) Reset() { *m = NetworkSpec{} }
func (*NetworkSpec) ProtoMessage() {}
func (*NetworkSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{9} }
// ClusterSpec specifies global cluster settings.
type ClusterSpec struct {
Annotations Annotations `protobuf:"bytes,1,opt,name=annotations" json:"annotations"`
// DEPRECATED: AcceptancePolicy defines the certificate issuance policy.
// Acceptance policy is no longer customizable, and secrets have been
// replaced with join tokens.
AcceptancePolicy AcceptancePolicy `protobuf:"bytes,2,opt,name=acceptance_policy,json=acceptancePolicy" json:"acceptance_policy"`
// Orchestration defines cluster-level orchestration settings.
Orchestration OrchestrationConfig `protobuf:"bytes,3,opt,name=orchestration" json:"orchestration"`
// Raft defines the cluster's raft settings.
Raft RaftConfig `protobuf:"bytes,4,opt,name=raft" json:"raft"`
// Dispatcher defines cluster-level dispatcher settings.
Dispatcher DispatcherConfig `protobuf:"bytes,5,opt,name=dispatcher" json:"dispatcher"`
// CAConfig defines cluster-level certificate authority settings.
CAConfig CAConfig `protobuf:"bytes,6,opt,name=ca_config,json=caConfig" json:"ca_config"`
// TaskDefaults specifies the default values to use for task creation.
TaskDefaults TaskDefaults `protobuf:"bytes,7,opt,name=task_defaults,json=taskDefaults" json:"task_defaults"`
// EncryptionConfig defines the cluster's encryption settings.
EncryptionConfig EncryptionConfig `protobuf:"bytes,8,opt,name=encryption_config,json=encryptionConfig" json:"encryption_config"`
}
func (m *ClusterSpec) Reset() { *m = ClusterSpec{} }
func (*ClusterSpec) ProtoMessage() {}
func (*ClusterSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{10} }
// SecretSpec specifies a user-provided secret.
type SecretSpec struct {
Annotations Annotations `protobuf:"bytes,1,opt,name=annotations" json:"annotations"`
// Data is the secret payload - the maximum size is 500KB (that is, 500*1024 bytes)
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *SecretSpec) Reset() { *m = SecretSpec{} }
func (*SecretSpec) ProtoMessage() {}
func (*SecretSpec) Descriptor() ([]byte, []int) { return fileDescriptorSpecs, []int{11} }
func init() {
proto.RegisterType((*NodeSpec)(nil), "docker.swarmkit.v1.NodeSpec")
proto.RegisterType((*ServiceSpec)(nil), "docker.swarmkit.v1.ServiceSpec")
proto.RegisterType((*ReplicatedService)(nil), "docker.swarmkit.v1.ReplicatedService")
proto.RegisterType((*GlobalService)(nil), "docker.swarmkit.v1.GlobalService")
proto.RegisterType((*TaskSpec)(nil), "docker.swarmkit.v1.TaskSpec")
proto.RegisterType((*NetworkAttachmentSpec)(nil), "docker.swarmkit.v1.NetworkAttachmentSpec")
proto.RegisterType((*ContainerSpec)(nil), "docker.swarmkit.v1.ContainerSpec")
proto.RegisterType((*ContainerSpec_PullOptions)(nil), "docker.swarmkit.v1.ContainerSpec.PullOptions")
proto.RegisterType((*ContainerSpec_DNSConfig)(nil), "docker.swarmkit.v1.ContainerSpec.DNSConfig")
proto.RegisterType((*PluginSpec)(nil), "docker.swarmkit.v1.PluginSpec")
proto.RegisterType((*EndpointSpec)(nil), "docker.swarmkit.v1.EndpointSpec")
proto.RegisterType((*NetworkSpec)(nil), "docker.swarmkit.v1.NetworkSpec")
proto.RegisterType((*ClusterSpec)(nil), "docker.swarmkit.v1.ClusterSpec")
proto.RegisterType((*SecretSpec)(nil), "docker.swarmkit.v1.SecretSpec")
proto.RegisterEnum("docker.swarmkit.v1.NodeSpec_Membership", NodeSpec_Membership_name, NodeSpec_Membership_value)
proto.RegisterEnum("docker.swarmkit.v1.NodeSpec_Availability", NodeSpec_Availability_name, NodeSpec_Availability_value)
proto.RegisterEnum("docker.swarmkit.v1.EndpointSpec_ResolutionMode", EndpointSpec_ResolutionMode_name, EndpointSpec_ResolutionMode_value)
}
func (m *NodeSpec) Copy() *NodeSpec {
if m == nil {
return nil
}
o := &NodeSpec{}
o.CopyFrom(m)
return o
}
func (m *NodeSpec) CopyFrom(src interface{}) {
o := src.(*NodeSpec)
*m = *o
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Annotations, &o.Annotations)
}
func (m *ServiceSpec) Copy() *ServiceSpec {
if m == nil {
return nil
}
o := &ServiceSpec{}
o.CopyFrom(m)
return o
}
func (m *ServiceSpec) CopyFrom(src interface{}) {
o := src.(*ServiceSpec)
*m = *o
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Annotations, &o.Annotations)
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Task, &o.Task)
if o.Update != nil {
m.Update = &UpdateConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Update, o.Update)
}
if o.Rollback != nil {
m.Rollback = &UpdateConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Rollback, o.Rollback)
}
if o.Networks != nil {
m.Networks = make([]*NetworkAttachmentConfig, len(o.Networks))
for i := range m.Networks {
m.Networks[i] = &NetworkAttachmentConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Networks[i], o.Networks[i])
}
}
if o.Endpoint != nil {
m.Endpoint = &EndpointSpec{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Endpoint, o.Endpoint)
}
if o.Mode != nil {
switch o.Mode.(type) {
case *ServiceSpec_Replicated:
v := ServiceSpec_Replicated{
Replicated: &ReplicatedService{},
}
github_com_docker_swarmkit_api_deepcopy.Copy(v.Replicated, o.GetReplicated())
m.Mode = &v
case *ServiceSpec_Global:
v := ServiceSpec_Global{
Global: &GlobalService{},
}
github_com_docker_swarmkit_api_deepcopy.Copy(v.Global, o.GetGlobal())
m.Mode = &v
}
}
}
func (m *ReplicatedService) Copy() *ReplicatedService {
if m == nil {
return nil
}
o := &ReplicatedService{}
o.CopyFrom(m)
return o
}
func (m *ReplicatedService) CopyFrom(src interface{}) {
o := src.(*ReplicatedService)
*m = *o
}
func (m *GlobalService) Copy() *GlobalService {
if m == nil {
return nil
}
o := &GlobalService{}
o.CopyFrom(m)
return o
}
func (m *GlobalService) CopyFrom(src interface{}) {}
func (m *TaskSpec) Copy() *TaskSpec {
if m == nil {
return nil
}
o := &TaskSpec{}
o.CopyFrom(m)
return o
}
func (m *TaskSpec) CopyFrom(src interface{}) {
o := src.(*TaskSpec)
*m = *o
if o.Resources != nil {
m.Resources = &ResourceRequirements{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Resources, o.Resources)
}
if o.Restart != nil {
m.Restart = &RestartPolicy{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Restart, o.Restart)
}
if o.Placement != nil {
m.Placement = &Placement{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Placement, o.Placement)
}
if o.LogDriver != nil {
m.LogDriver = &Driver{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.LogDriver, o.LogDriver)
}
if o.Networks != nil {
m.Networks = make([]*NetworkAttachmentConfig, len(o.Networks))
for i := range m.Networks {
m.Networks[i] = &NetworkAttachmentConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Networks[i], o.Networks[i])
}
}
if o.Runtime != nil {
switch o.Runtime.(type) {
case *TaskSpec_Attachment:
v := TaskSpec_Attachment{
Attachment: &NetworkAttachmentSpec{},
}
github_com_docker_swarmkit_api_deepcopy.Copy(v.Attachment, o.GetAttachment())
m.Runtime = &v
case *TaskSpec_Container:
v := TaskSpec_Container{
Container: &ContainerSpec{},
}
github_com_docker_swarmkit_api_deepcopy.Copy(v.Container, o.GetContainer())
m.Runtime = &v
case *TaskSpec_Plugin:
v := TaskSpec_Plugin{
Plugin: &PluginSpec{},
}
github_com_docker_swarmkit_api_deepcopy.Copy(v.Plugin, o.GetPlugin())
m.Runtime = &v
}
}
}
func (m *NetworkAttachmentSpec) Copy() *NetworkAttachmentSpec {
if m == nil {
return nil
}
o := &NetworkAttachmentSpec{}
o.CopyFrom(m)
return o
}
func (m *NetworkAttachmentSpec) CopyFrom(src interface{}) {
o := src.(*NetworkAttachmentSpec)
*m = *o
}
func (m *ContainerSpec) Copy() *ContainerSpec {
if m == nil {
return nil
}
o := &ContainerSpec{}
o.CopyFrom(m)
return o
}
func (m *ContainerSpec) CopyFrom(src interface{}) {
o := src.(*ContainerSpec)
*m = *o
if o.Labels != nil {
m.Labels = make(map[string]string, len(o.Labels))
for k, v := range o.Labels {
m.Labels[k] = v
}
}
if o.Command != nil {
m.Command = make([]string, len(o.Command))
copy(m.Command, o.Command)
}
if o.Args != nil {
m.Args = make([]string, len(o.Args))
copy(m.Args, o.Args)
}
if o.Env != nil {
m.Env = make([]string, len(o.Env))
copy(m.Env, o.Env)
}
if o.Groups != nil {
m.Groups = make([]string, len(o.Groups))
copy(m.Groups, o.Groups)
}
if o.Mounts != nil {
m.Mounts = make([]Mount, len(o.Mounts))
for i := range m.Mounts {
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Mounts[i], &o.Mounts[i])
}
}
if o.StopGracePeriod != nil {
m.StopGracePeriod = &google_protobuf1.Duration{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.StopGracePeriod, o.StopGracePeriod)
}
if o.PullOptions != nil {
m.PullOptions = &ContainerSpec_PullOptions{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.PullOptions, o.PullOptions)
}
if o.Secrets != nil {
m.Secrets = make([]*SecretReference, len(o.Secrets))
for i := range m.Secrets {
m.Secrets[i] = &SecretReference{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i])
}
}
if o.Hosts != nil {
m.Hosts = make([]string, len(o.Hosts))
copy(m.Hosts, o.Hosts)
}
if o.DNSConfig != nil {
m.DNSConfig = &ContainerSpec_DNSConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.DNSConfig, o.DNSConfig)
}
if o.Healthcheck != nil {
m.Healthcheck = &HealthConfig{}
github_com_docker_swarmkit_api_deepcopy.Copy(m.Healthcheck, o.Healthcheck)
}
}
func (m *ContainerSpec_PullOptions) Copy() *ContainerSpec_PullOptions {
if m == nil {
return nil
}
o := &ContainerSpec_PullOptions{}
o.CopyFrom(m)
return o
}
func (m *ContainerSpec_PullOptions) CopyFrom(src interface{}) {
o := src.(*ContainerSpec_PullOptions)
*m = *o
}
func (m *ContainerSpec_DNSConfig) Copy() *ContainerSpec_DNSConfig {
if m == nil {
return nil
}
o := &ContainerSpec_DNSConfig{}
o.CopyFrom(m)
return o
}
func (m *ContainerSpec_DNSConfig) CopyFrom(src interface{}) {
o := src.(*ContainerSpec_DNSConfig)
*m = *o
if o.Nameservers != nil {
m.Nameservers = make([]string, len(o.Nameservers))
copy(m.Nameservers, o.Nameservers)
}
if o.Search != nil {
m.Search = make([]string, len(o.Search))
copy(m.Search, o.Search)
}
if o.Options != nil {
m.Options = make([]string, len(o.Options))
copy(m.Options, o.Options)
}
}
func (m *PluginSpec) Copy() *PluginSpec {
if m == nil {
return nil
}
o := &PluginSpec{}
o.CopyFrom(m)
return o