diff --git a/examples/hello/task.yaml b/examples/hello/task.yaml index 4d1343e..492b633 100644 --- a/examples/hello/task.yaml +++ b/examples/hello/task.yaml @@ -10,5 +10,5 @@ plans: parallel: 100 interval: 1 -metadata: - org: lilithgame \ No newline at end of file +environments: + branch: master \ No newline at end of file diff --git a/pkg/agent/engine.go b/pkg/agent/engine.go index 5080f9f..24bc8ae 100644 --- a/pkg/agent/engine.go +++ b/pkg/agent/engine.go @@ -15,7 +15,7 @@ import ( type Config struct { Plans []*transfer.Plan - Metadata map[string]string + Environments map[string]string } func (c *Config) MarshalBinary() (data []byte, err error) { @@ -93,7 +93,7 @@ func (b *Behavior) BuildEngineFromConfig(conf []byte) *Engine { log.Panic("unmarshal plan config", zap.Error(err)) } engine := &Engine{Behavior: b} - engine.metadata = cfg.Metadata + engine.metadata = cfg.Environments for _, plan := range cfg.Plans { if _, ok := b.trees[plan.TreeName]; !ok { log.Panic("plan name not found") @@ -126,6 +126,12 @@ func (e *Engine) setPlans(plans []*transfer.Plan) { e.plans = plans } -func (e *Engine) setMetadata(metadata map[string]string) { - e.metadata = metadata +func (e *Engine) setMetadata(envs map[string]string) { + if len(e.metadata) == 0 { + e.metadata = envs + return + } + for name, value := range envs { + e.metadata[name] = value + } } diff --git a/pkg/agent/manager.go b/pkg/agent/manager.go index b79c007..23c5501 100644 --- a/pkg/agent/manager.go +++ b/pkg/agent/manager.go @@ -61,16 +61,13 @@ func (m *manager) reviewMail(mail *transfer.Mail) error { } func (m *manager) startAgentEngine(content []byte) error { - var conf Config - err := json.Unmarshal(content, &conf) + var envs map[string]string + err := json.Unmarshal(content, &envs) if err != nil { return err } - if conf.Plans != nil { - m.engine.setPlans(conf.Plans) - } - if len(conf.Metadata) != 0 { - m.engine.setMetadata(conf.Metadata) + if len(envs) != 0 { + m.engine.setMetadata(envs) } m.startReadyService() return nil diff --git a/pkg/transfer/transfer.pb.go b/pkg/transfer/transfer.pb.go index fb69a4f..dafc504 100644 --- a/pkg/transfer/transfer.pb.go +++ b/pkg/transfer/transfer.pb.go @@ -258,9 +258,9 @@ type Event struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - AgentNum int32 `protobuf:"varint,2,opt,name=agentNum,proto3" json:"agentNum,omitempty"` - RawCfg []byte `protobuf:"bytes,3,opt,name=rawCfg,proto3" json:"rawCfg,omitempty"` + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + AgentNum int32 `protobuf:"varint,2,opt,name=agentNum,proto3" json:"agentNum,omitempty"` + Environments map[string]string `protobuf:"bytes,3,rep,name=environments,proto3" json:"environments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Event) Reset() { @@ -309,9 +309,9 @@ func (x *Event) GetAgentNum() int32 { return 0 } -func (x *Event) GetRawCfg() []byte { +func (x *Event) GetEnvironments() map[string]string { if x != nil { - return x.RawCfg + return x.Environments } return nil } @@ -686,70 +686,76 @@ var file_transfer_proto_rawDesc = []byte{ 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x51, 0x0a, 0x05, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x77, 0x43, 0x66, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x61, 0x77, 0x43, 0x66, 0x67, 0x22, 0x64, - 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, - 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0a, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x07, 0x72, 0x65, 0x70, - 0x6c, 0x69, 0x65, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, - 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, - 0x1a, 0x3b, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x82, 0x01, - 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0a, 0x71, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x07, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x07, 0x2e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x46, - 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x44, - 0x12, 0x24, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x52, 0x08, 0x6f, 0x75, - 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x2a, 0x4b, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, - 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, - 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, - 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x5f, 0x50, 0x4c, 0x41, - 0x4e, 0x10, 0x03, 0x2a, 0x47, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x12, 0x0b, 0x0a, - 0x07, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, - 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, - 0x52, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, - 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x32, 0x2c, 0x0a, 0x07, - 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, - 0x65, 0x72, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x05, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x1a, 0x05, 0x2e, - 0x4d, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, - 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xb8, 0x01, 0x0a, 0x05, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x3c, 0x0a, 0x0c, 0x65, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x22, 0x96, 0x02, 0x0a, + 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x76, 0x67, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x1a, 0x3b, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x82, 0x01, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x65, 0x67, 0x69, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x29, 0x0a, 0x0a, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, + 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x07, 0x4f, 0x75, + 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x46, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x63, + 0x6f, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4f, 0x75, 0x74, + 0x63, 0x6f, 0x6d, 0x65, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x2a, 0x4b, + 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x52, + 0x54, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x4f, + 0x50, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, + 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x49, + 0x4e, 0x49, 0x53, 0x48, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x03, 0x2a, 0x47, 0x0a, 0x06, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, + 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x04, 0x32, 0x2c, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x05, + 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x1a, 0x05, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x28, 0x01, + 0x30, 0x01, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -765,7 +771,7 @@ func file_transfer_proto_rawDescGZIP() []byte { } var file_transfer_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_transfer_proto_goTypes = []interface{}{ (ACTION)(0), // 0: ACTION (STATUS)(0), // 1: STATUS @@ -777,22 +783,24 @@ var file_transfer_proto_goTypes = []interface{}{ (*PlanReply)(nil), // 7: PlanReply (*Outcome)(nil), // 8: Outcome (*Report)(nil), // 9: Report - nil, // 10: Quantity.ErrorMapEntry + nil, // 10: Event.EnvironmentsEntry + nil, // 11: Quantity.ErrorMapEntry } var file_transfer_proto_depIdxs = []int32{ 0, // 0: Mail.action:type_name -> ACTION - 7, // 1: EventReply.replies:type_name -> PlanReply - 10, // 2: Quantity.errorMap:type_name -> Quantity.ErrorMapEntry - 6, // 3: PlanReply.quantities:type_name -> Quantity - 1, // 4: Outcome.status:type_name -> STATUS - 8, // 5: Report.outcomes:type_name -> Outcome - 2, // 6: Courier.DeliverMail:input_type -> Mail - 2, // 7: Courier.DeliverMail:output_type -> Mail - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 1: Event.environments:type_name -> Event.EnvironmentsEntry + 7, // 2: EventReply.replies:type_name -> PlanReply + 11, // 3: Quantity.errorMap:type_name -> Quantity.ErrorMapEntry + 6, // 4: PlanReply.quantities:type_name -> Quantity + 1, // 5: Outcome.status:type_name -> STATUS + 8, // 6: Report.outcomes:type_name -> Outcome + 2, // 7: Courier.DeliverMail:input_type -> Mail + 2, // 8: Courier.DeliverMail:output_type -> Mail + 8, // [8:9] is the sub-list for method output_type + 7, // [7:8] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_transfer_proto_init() } @@ -904,7 +912,7 @@ func file_transfer_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_transfer_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/transfer/transfer.proto b/pkg/transfer/transfer.proto index 8a2fdda..18dafa2 100644 --- a/pkg/transfer/transfer.proto +++ b/pkg/transfer/transfer.proto @@ -24,7 +24,7 @@ message Plan { message Event { string image = 1; int32 agentNum = 2; - bytes rawCfg = 3; + map environments = 3; } message EventReply {