diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d55c0e..0963d6a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: working_directory: ~/core/<< parameters.module>> executor: name: go/default - tag: '1.18' + tag: '1.22' steps: - checkout: path: ~/core diff --git a/Dockerfile b/Dockerfile index 5a23a49..1dc570b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM golang:1.18-bullseye +FROM golang:1.22-bullseye RUN apt-get update && apt-get upgrade -y && apt-get install -y unzip ARG protoc_version=3.19.4 -ARG protoc_arch=x86_64 +ARG protoc_arch=aarch_64 ARG protoc_release=https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-linux-${protoc_arch}.zip ADD $protoc_release /opt/protoc.zip diff --git a/v2/check.go b/v2/check.go index f816530..3b2c188 100644 --- a/v2/check.go +++ b/v2/check.go @@ -131,6 +131,7 @@ func NewCheck(c *CheckConfig) *Check { MaxOutputSize: c.MaxOutputSize, Scheduler: c.Scheduler, Pipelines: c.Pipelines, + FallbackPipelines: c.FallbackPipelines, } if check.Labels == nil { check.Labels = make(map[string]string) @@ -268,6 +269,9 @@ func (c *Check) MarshalJSON() ([]byte, error) { if c.Pipelines == nil { c.Pipelines = []*ResourceReference{} } + if c.FallbackPipelines == nil { + c.FallbackPipelines = []*ResourceReference{} + } type Clone Check clone := &Clone{} diff --git a/v2/check.pb.go b/v2/check.pb.go index 00fe9de..d116eb9 100644 --- a/v2/check.pb.go +++ b/v2/check.pb.go @@ -316,9 +316,11 @@ type CheckConfig struct { Pipelines []*ResourceReference `protobuf:"bytes,32,rep,name=pipelines,proto3" json:"pipelines"` OutputMetricThresholds []*MetricThreshold `protobuf:"bytes,33,rep,name=output_metric_thresholds,json=outputMetricThresholds,proto3" json:"output_metric_thresholds,omitempty" yaml: "output_metric_thresholds,omitempty"` Subdues []*TimeWindowRepeated `protobuf:"bytes,34,rep,name=subdues,proto3" json:"subdues,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + //added fallback pieplines details in order of execution + FallbackPipelines []*ResourceReference `protobuf:"bytes,35,rep,name=fallback_pipelines,json=fallbackPipelines,proto3" json:"fallback_pipelines" yaml: "fallback_pipelines,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CheckConfig) Reset() { *m = CheckConfig{} } @@ -468,6 +470,8 @@ type Check struct { // the check status. OutputMetricThresholds []*MetricThreshold `protobuf:"bytes,47,rep,name=output_metric_thresholds,json=outputMetricThresholds,proto3" json:"output_metric_thresholds,omitempty" yaml: "output_metric_thresholds,omitempty"` Subdues []*TimeWindowRepeated `protobuf:"bytes,48,rep,name=subdues,proto3" json:"subdues,omitempty"` + //fallback pieplines details in order of execution + FallbackPipelines []*ResourceReference `protobuf:"bytes,49,rep,name=fallback_pipelines,json=fallbackPipelines,proto3" json:"fallback_pipelines" yaml: "fallback_pipelines,omitempty"` // ExtendedAttributes store serialized arbitrary JSON-encoded data ExtendedAttributes []byte `protobuf:"bytes,99,opt,name=ExtendedAttributes,proto3" json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -593,120 +597,123 @@ func init() { } var fileDescriptor_d70eac2f90fbef24 = []byte{ - // 1800 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x73, 0xdb, 0xc6, - 0x15, 0x37, 0x2c, 0x8b, 0x12, 0x97, 0xa6, 0x3e, 0xd6, 0x92, 0xbd, 0x56, 0x6c, 0x82, 0x66, 0x6c, - 0x87, 0xb5, 0x63, 0xca, 0x66, 0x9a, 0x69, 0xea, 0xc9, 0xa1, 0x86, 0x6a, 0x57, 0x69, 0xe3, 0xd8, - 0xb3, 0x56, 0xeb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0x89, 0xf7, - 0xdf, 0x50, 0x91, 0xb8, 0xe0, 0xd5, 0xef, 0xbc, 0xe6, 0xd5, 0x5f, 0xa8, 0x2d, 0x7f, 0xaf, 0xff, - 0x86, 0xdc, 0x9f, 0x64, 0x19, 0x9d, 0x07, 0x8c, 0x85, 0x79, 0xa0, 0x98, 0xfb, 0xce, 0xbf, 0x32, - 0xf7, 0xdd, 0x40, 0xab, 0xaa, 0xac, 0x1b, 0x7a, 0x7e, 0x17, 0xfe, 0x71, 0x5a, 0xcd, 0x16, 0x95, - 0xc3, 0x56, 0xfd, 0x3f, 0xff, 0xaa, 0x19, 0x9f, 0x9f, 0xd6, 0x8c, 0xbf, 0x9f, 0xd6, 0x8c, 0x2f, - 0x4e, 0x6b, 0xc6, 0x97, 0xa7, 0x35, 0xe3, 0x9f, 0xa7, 0x35, 0xe3, 0xcf, 0xff, 0xae, 0x9d, 0xfb, - 0xf5, 0xf9, 0x51, 0xbb, 0x53, 0x82, 0x7f, 0x4c, 0xdf, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x15, 0xf7, 0xdc, 0x16, 0xed, 0x16, 0x00, 0x00, + // 1842 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xf7, 0x4a, 0x11, 0x25, 0x0e, 0x4d, 0x7d, 0x8c, 0x25, 0x7b, 0xac, 0xd8, 0x5c, 0x9a, 0xfe, + 0x88, 0x6a, 0xc7, 0x94, 0xcd, 0x34, 0x68, 0x6a, 0x04, 0x45, 0xbd, 0xaa, 0x5d, 0xa5, 0x8d, 0x63, + 0x63, 0xac, 0xd6, 0x40, 0x81, 0x62, 0x31, 0xdc, 0x1d, 0x91, 0x5b, 0x2d, 0x77, 0xd9, 0x9d, 0x59, + 0x4a, 0xcc, 0xa5, 0xd7, 0xde, 0x5a, 0xf4, 0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, 0xc3, 0x89, + 0x7d, 0x6d, 0xea, 0x7d, 0x15, 0x09, 0x0d, 0x5a, 0x9c, 0x66, 0xb2, 0x6c, 0x6d, 0xbe, 0xd9, 0xb2, + 0x75, 0xf7, 0xdb, 0x5d, 0xb6, 0xde, 0x7b, 0xc3, 0x65, 0xeb, 0xfd, 0x6f, 0xac, 0x6c, 0x9d, 0xf3, + 0x65, 0xc4, 0x79, 0xc5, 0x97, 0x91, 0x42, 0xb5, 0xfb, 0x3b, 0xfd, 0xa9, 0x76, 0x7f, 0x9c, 0xf7, + 0x74, 0x66, 0x32, 0xe6, 0x66, 0xa6, 0x62, 0x36, 0x5e, 0x78, 0x69, 0x36, 0xbe, 0x86, 0x56, 0x54, + 0xa1, 0xd9, 0xf7, 0x82, 0x0e, 0x7c, 0x95, 0x5b, 0xc9, 0x36, 0x95, 0xc3, 0x56, 0xfd, 0x3f, 0xff, + 0xac, 0x19, 0x9f, 0x9f, 0xd6, 0x8c, 0xbf, 0x9f, 0xd6, 0x8c, 0x2f, 0x4e, 0x6b, 0xc6, 0x97, 0xa7, + 0x35, 0xe3, 0x1f, 0xa7, 0x35, 0xe3, 0xcf, 0xff, 0xaa, 0x9d, 0xfb, 0xd5, 0xc2, 0xa0, 0xd5, 0x2e, + 0xc1, 0x57, 0xe5, 0xf7, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x81, 0xba, 0xde, 0x93, 0x11, 0x18, + 0x00, 0x00, } func (this *CheckRequest) Equal(that interface{}) bool { @@ -1005,6 +1012,14 @@ func (this *CheckConfig) Equal(that interface{}) bool { return false } } + if len(this.FallbackPipelines) != len(that1.FallbackPipelines) { + return false + } + for i := range this.FallbackPipelines { + if !this.FallbackPipelines[i].Equal(that1.FallbackPipelines[i]) { + return false + } + } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } @@ -1231,6 +1246,14 @@ func (this *Check) Equal(that interface{}) bool { return false } } + if len(this.FallbackPipelines) != len(that1.FallbackPipelines) { + return false + } + for i := range this.FallbackPipelines { + if !this.FallbackPipelines[i].Equal(that1.FallbackPipelines[i]) { + return false + } + } if !bytes.Equal(this.ExtendedAttributes, that1.ExtendedAttributes) { return false } @@ -1305,6 +1328,7 @@ type CheckConfigFace interface { GetPipelines() []*ResourceReference GetOutputMetricThresholds() []*MetricThreshold GetSubdues() []*TimeWindowRepeated + GetFallbackPipelines() []*ResourceReference } func (this *CheckConfig) Proto() github_com_golang_protobuf_proto.Message { @@ -1435,6 +1459,10 @@ func (this *CheckConfig) GetSubdues() []*TimeWindowRepeated { return this.Subdues } +func (this *CheckConfig) GetFallbackPipelines() []*ResourceReference { + return this.FallbackPipelines +} + func NewCheckConfigFromFace(that CheckConfigFace) *CheckConfig { this := &CheckConfig{} this.Command = that.GetCommand() @@ -1467,6 +1495,7 @@ func NewCheckConfigFromFace(that CheckConfigFace) *CheckConfig { this.Pipelines = that.GetPipelines() this.OutputMetricThresholds = that.GetOutputMetricThresholds() this.Subdues = that.GetSubdues() + this.FallbackPipelines = that.GetFallbackPipelines() return this } @@ -1516,6 +1545,7 @@ type CheckFace interface { GetPipelines() []*ResourceReference GetOutputMetricThresholds() []*MetricThreshold GetSubdues() []*TimeWindowRepeated + GetFallbackPipelines() []*ResourceReference GetExtendedAttributes() []byte } @@ -1703,6 +1733,10 @@ func (this *Check) GetSubdues() []*TimeWindowRepeated { return this.Subdues } +func (this *Check) GetFallbackPipelines() []*ResourceReference { + return this.FallbackPipelines +} + func (this *Check) GetExtendedAttributes() []byte { return this.ExtendedAttributes } @@ -1753,6 +1787,7 @@ func NewCheckFromFace(that CheckFace) *Check { this.Pipelines = that.GetPipelines() this.OutputMetricThresholds = that.GetOutputMetricThresholds() this.Subdues = that.GetSubdues() + this.FallbackPipelines = that.GetFallbackPipelines() this.ExtendedAttributes = that.GetExtendedAttributes() return this } @@ -1980,6 +2015,22 @@ func (m *CheckConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.FallbackPipelines) > 0 { + for iNdEx := len(m.FallbackPipelines) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FallbackPipelines[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + } if len(m.Subdues) > 0 { for iNdEx := len(m.Subdues) - 1; iNdEx >= 0; iNdEx-- { { @@ -2327,6 +2378,22 @@ func (m *Check) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x9a } + if len(m.FallbackPipelines) > 0 { + for iNdEx := len(m.FallbackPipelines) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FallbackPipelines[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCheck(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x8a + } + } if len(m.Subdues) > 0 { for iNdEx := len(m.Subdues) - 1; iNdEx >= 0; iNdEx-- { { @@ -3009,8 +3076,15 @@ func NewPopulatedCheckConfig(r randyCheck, easy bool) *CheckConfig { this.Subdues[i] = NewPopulatedTimeWindowRepeated(r, easy) } } + if r.Intn(5) != 0 { + v24 := r.Intn(5) + this.FallbackPipelines = make([]*ResourceReference, v24) + for i := 0; i < v24; i++ { + this.FallbackPipelines[i] = NewPopulatedResourceReference(r, easy) + } + } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedCheck(r, 35) + this.XXX_unrecognized = randUnrecognizedCheck(r, 36) } return this } @@ -3018,32 +3092,32 @@ func NewPopulatedCheckConfig(r randyCheck, easy bool) *CheckConfig { func NewPopulatedCheck(r randyCheck, easy bool) *Check { this := &Check{} this.Command = string(randStringCheck(r)) - v24 := r.Intn(10) - this.Handlers = make([]string, v24) - for i := 0; i < v24; i++ { + v25 := r.Intn(10) + this.Handlers = make([]string, v25) + for i := 0; i < v25; i++ { this.Handlers[i] = string(randStringCheck(r)) } this.HighFlapThreshold = uint32(r.Uint32()) this.Interval = uint32(r.Uint32()) this.LowFlapThreshold = uint32(r.Uint32()) this.Publish = bool(bool(r.Intn(2) == 0)) - v25 := r.Intn(10) - this.RuntimeAssets = make([]string, v25) - for i := 0; i < v25; i++ { - this.RuntimeAssets[i] = string(randStringCheck(r)) - } v26 := r.Intn(10) - this.Subscriptions = make([]string, v26) + this.RuntimeAssets = make([]string, v26) for i := 0; i < v26; i++ { + this.RuntimeAssets[i] = string(randStringCheck(r)) + } + v27 := r.Intn(10) + this.Subscriptions = make([]string, v27) + for i := 0; i < v27; i++ { this.Subscriptions[i] = string(randStringCheck(r)) } this.ProxyEntityName = string(randStringCheck(r)) if r.Intn(5) != 0 { - v27 := r.Intn(5) - this.CheckHooks = make([]HookList, v27) - for i := 0; i < v27; i++ { - v28 := NewPopulatedHookList(r, easy) - this.CheckHooks[i] = *v28 + v28 := r.Intn(5) + this.CheckHooks = make([]HookList, v28) + for i := 0; i < v28; i++ { + v29 := NewPopulatedHookList(r, easy) + this.CheckHooks[i] = *v29 } } this.Stdin = bool(bool(r.Intn(2) == 0)) @@ -3069,11 +3143,11 @@ func NewPopulatedCheck(r randyCheck, easy bool) *Check { this.Executed *= -1 } if r.Intn(5) != 0 { - v29 := r.Intn(5) - this.History = make([]CheckHistory, v29) - for i := 0; i < v29; i++ { - v30 := NewPopulatedCheckHistory(r, easy) - this.History[i] = *v30 + v30 := r.Intn(5) + this.History = make([]CheckHistory, v30) + for i := 0; i < v30; i++ { + v31 := NewPopulatedCheckHistory(r, easy) + this.History[i] = *v31 } } this.Issued = int64(r.Int63()) @@ -3096,77 +3170,84 @@ func NewPopulatedCheck(r randyCheck, easy bool) *Check { if r.Intn(2) == 0 { this.OccurrencesWatermark *= -1 } - v31 := r.Intn(10) - this.Silenced = make([]string, v31) - for i := 0; i < v31; i++ { + v32 := r.Intn(10) + this.Silenced = make([]string, v32) + for i := 0; i < v32; i++ { this.Silenced[i] = string(randStringCheck(r)) } if r.Intn(5) != 0 { - v32 := r.Intn(5) - this.Hooks = make([]*Hook, v32) - for i := 0; i < v32; i++ { + v33 := r.Intn(5) + this.Hooks = make([]*Hook, v33) + for i := 0; i < v33; i++ { this.Hooks[i] = NewPopulatedHook(r, easy) } } this.OutputMetricFormat = string(randStringCheck(r)) - v33 := r.Intn(10) - this.OutputMetricHandlers = make([]string, v33) - for i := 0; i < v33; i++ { - this.OutputMetricHandlers[i] = string(randStringCheck(r)) - } v34 := r.Intn(10) - this.EnvVars = make([]string, v34) + this.OutputMetricHandlers = make([]string, v34) for i := 0; i < v34; i++ { + this.OutputMetricHandlers[i] = string(randStringCheck(r)) + } + v35 := r.Intn(10) + this.EnvVars = make([]string, v35) + for i := 0; i < v35; i++ { this.EnvVars[i] = string(randStringCheck(r)) } - v35 := NewPopulatedObjectMeta(r, easy) - this.ObjectMeta = *v35 + v36 := NewPopulatedObjectMeta(r, easy) + this.ObjectMeta = *v36 this.MaxOutputSize = int64(r.Int63()) if r.Intn(2) == 0 { this.MaxOutputSize *= -1 } this.DiscardOutput = bool(bool(r.Intn(2) == 0)) if r.Intn(5) != 0 { - v36 := r.Intn(5) - this.Secrets = make([]*Secret, v36) - for i := 0; i < v36; i++ { + v37 := r.Intn(5) + this.Secrets = make([]*Secret, v37) + for i := 0; i < v37; i++ { this.Secrets[i] = NewPopulatedSecret(r, easy) } } this.IsSilenced = bool(bool(r.Intn(2) == 0)) if r.Intn(5) != 0 { - v37 := r.Intn(5) - this.OutputMetricTags = make([]*MetricTag, v37) - for i := 0; i < v37; i++ { + v38 := r.Intn(5) + this.OutputMetricTags = make([]*MetricTag, v38) + for i := 0; i < v38; i++ { this.OutputMetricTags[i] = NewPopulatedMetricTag(r, easy) } } this.Scheduler = string(randStringCheck(r)) this.ProcessedBy = string(randStringCheck(r)) if r.Intn(5) != 0 { - v38 := r.Intn(5) - this.Pipelines = make([]*ResourceReference, v38) - for i := 0; i < v38; i++ { + v39 := r.Intn(5) + this.Pipelines = make([]*ResourceReference, v39) + for i := 0; i < v39; i++ { this.Pipelines[i] = NewPopulatedResourceReference(r, easy) } } if r.Intn(5) != 0 { - v39 := r.Intn(5) - this.OutputMetricThresholds = make([]*MetricThreshold, v39) - for i := 0; i < v39; i++ { + v40 := r.Intn(5) + this.OutputMetricThresholds = make([]*MetricThreshold, v40) + for i := 0; i < v40; i++ { this.OutputMetricThresholds[i] = NewPopulatedMetricThreshold(r, easy) } } if r.Intn(5) != 0 { - v40 := r.Intn(5) - this.Subdues = make([]*TimeWindowRepeated, v40) - for i := 0; i < v40; i++ { + v41 := r.Intn(5) + this.Subdues = make([]*TimeWindowRepeated, v41) + for i := 0; i < v41; i++ { this.Subdues[i] = NewPopulatedTimeWindowRepeated(r, easy) } } - v41 := r.Intn(100) - this.ExtendedAttributes = make([]byte, v41) - for i := 0; i < v41; i++ { + if r.Intn(5) != 0 { + v42 := r.Intn(5) + this.FallbackPipelines = make([]*ResourceReference, v42) + for i := 0; i < v42; i++ { + this.FallbackPipelines[i] = NewPopulatedResourceReference(r, easy) + } + } + v43 := r.Intn(100) + this.ExtendedAttributes = make([]byte, v43) + for i := 0; i < v43; i++ { this.ExtendedAttributes[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { @@ -3208,9 +3289,9 @@ func randUTF8RuneCheck(r randyCheck) rune { return rune(ru + 61) } func randStringCheck(r randyCheck) string { - v42 := r.Intn(100) - tmps := make([]rune, v42) - for i := 0; i < v42; i++ { + v44 := r.Intn(100) + tmps := make([]rune, v44) + for i := 0; i < v44; i++ { tmps[i] = randUTF8RuneCheck(r) } return string(tmps) @@ -3232,11 +3313,11 @@ func randFieldCheck(dAtA []byte, r randyCheck, fieldNumber int, wire int) []byte switch wire { case 0: dAtA = encodeVarintPopulateCheck(dAtA, uint64(key)) - v43 := r.Int63() + v45 := r.Int63() if r.Intn(2) == 0 { - v43 *= -1 + v45 *= -1 } - dAtA = encodeVarintPopulateCheck(dAtA, uint64(v43)) + dAtA = encodeVarintPopulateCheck(dAtA, uint64(v45)) case 1: dAtA = encodeVarintPopulateCheck(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -3489,6 +3570,12 @@ func (m *CheckConfig) Size() (n int) { n += 2 + l + sovCheck(uint64(l)) } } + if len(m.FallbackPipelines) > 0 { + for _, e := range m.FallbackPipelines { + l = e.Size() + n += 2 + l + sovCheck(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3684,6 +3771,12 @@ func (m *Check) Size() (n int) { n += 2 + l + sovCheck(uint64(l)) } } + if len(m.FallbackPipelines) > 0 { + for _, e := range m.FallbackPipelines { + l = e.Size() + n += 2 + l + sovCheck(uint64(l)) + } + } l = len(m.ExtendedAttributes) if l > 0 { n += 2 + l + sovCheck(uint64(l)) @@ -5149,6 +5242,40 @@ func (m *CheckConfig) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FallbackPipelines", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FallbackPipelines = append(m.FallbackPipelines, &ResourceReference{}) + if err := m.FallbackPipelines[len(m.FallbackPipelines)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCheck(dAtA[iNdEx:]) @@ -6383,6 +6510,40 @@ func (m *Check) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 49: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FallbackPipelines", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheck + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FallbackPipelines = append(m.FallbackPipelines, &ResourceReference{}) + if err := m.FallbackPipelines[len(m.FallbackPipelines)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 99: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExtendedAttributes", wireType) diff --git a/v2/check.proto b/v2/check.proto index 5f5f5a2..c725ff4 100644 --- a/v2/check.proto +++ b/v2/check.proto @@ -171,6 +171,9 @@ message CheckConfig { repeated MetricThreshold output_metric_thresholds = 33 [ (gogoproto.jsontag) = "output_metric_thresholds,omitempty", (gogoproto.moretags) = "yaml: \"output_metric_thresholds,omitempty\"" ]; repeated TimeWindowRepeated subdues = 34 [ (gogoproto.jsontag) = "subdues,omitempty" ]; + + //added fallback pieplines details in order of execution + repeated ResourceReference fallback_pipelines = 35 [ (gogoproto.jsontag) = "fallback_pipelines" ,(gogoproto.moretags) = "yaml: \"fallback_pipelines,omitempty\"" ]; } // A Check is a check specification and optionally the results of the check's @@ -334,6 +337,9 @@ message Check { repeated TimeWindowRepeated subdues = 48 [ (gogoproto.jsontag) = "subdues,omitempty" ]; + //fallback pieplines details in order of execution + repeated ResourceReference fallback_pipelines = 49 [ (gogoproto.jsontag) = "fallback_pipelines" ,(gogoproto.moretags) = "yaml: \"fallback_pipelines,omitempty\"" ]; + // ExtendedAttributes store serialized arbitrary JSON-encoded data bytes ExtendedAttributes = 99 [ (gogoproto.jsontag) = "-" ]; } diff --git a/v2/event.go b/v2/event.go index 29d8afe..51bdfbe 100644 --- a/v2/event.go +++ b/v2/event.go @@ -76,6 +76,12 @@ func (e *Event) Validate() error { } } + for _, fallpipelines := range e.FallbackPipelines { + if err := e.validateFallbackPipelineReference(fallpipelines); err != nil { + return errors.New("Fallback-pipeline reference is invalid: " + err.Error()) + } + } + if e.Name != "" { return errors.New("events cannot be named") } @@ -205,6 +211,19 @@ func (e *Event) validatePipelineReference(ref *ResourceReference) error { return fmt.Errorf("resource type not capable of acting as a pipeline: %s.%s", ref.APIVersion, ref.Type) } +// validateFallbackPipelineReference validates that a resource reference is capable of +// acting as a pipeline. +func (e *Event) validateFallbackPipelineReference(ref *ResourceReference) error { + switch ref.APIVersion { + case "core/v2": + switch ref.Type { + case "LegacyPipeline": + return nil + } + } + return fmt.Errorf("resource type not capable of acting as a fallbackpipeline: %s.%s", ref.APIVersion, ref.Type) +} + // FixtureEvent returns a testing fixture for an Event object. func FixtureEvent(entityName, checkID string) *Event { id := uuid.New() diff --git a/v2/event.pb.go b/v2/event.pb.go index 4b1da67..9769698 100644 --- a/v2/event.pb.go +++ b/v2/event.pb.go @@ -47,7 +47,9 @@ type Event struct { // Pipelines are the pipelines that should be used to process an event. // APIVersion should default to "core/v2" and Type should default to // "Pipeline". - Pipelines []*ResourceReference `protobuf:"bytes,8,rep,name=pipelines,proto3" json:"pipelines"` + Pipelines []*ResourceReference `protobuf:"bytes,8,rep,name=pipelines,proto3" json:"pipelines"` + //fallback pipelines + FallbackPipelines []*ResourceReference `protobuf:"bytes,9,rep,name=fallback_pipelines,json=fallbackPipelines,proto3" json:"fallback_pipelines"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -95,35 +97,37 @@ func init() { } var fileDescriptor_f911c654eafd4c9b = []byte{ - // 442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x4f, 0x6e, 0xd3, 0x40, - 0x14, 0x87, 0x33, 0x4e, 0x93, 0xa6, 0xd3, 0x76, 0x33, 0x2a, 0xd5, 0x50, 0x21, 0x8f, 0xc5, 0x3f, - 0x79, 0x35, 0xa6, 0x0e, 0x62, 0xc1, 0x0a, 0x99, 0x76, 0x51, 0xa1, 0x08, 0x69, 0xd8, 0xb1, 0x41, - 0xce, 0xf4, 0x35, 0x35, 0x10, 0x3b, 0xd8, 0x63, 0x4b, 0xdc, 0x80, 0x23, 0xb0, 0xec, 0xb2, 0x0b, - 0x0e, 0xc0, 0x11, 0xb2, 0xec, 0x09, 0x2c, 0x30, 0xbb, 0x9c, 0x80, 0x25, 0xf2, 0x78, 0x9a, 0x80, - 0x25, 0xb3, 0x7b, 0x7a, 0xbf, 0xef, 0xb3, 0xe7, 0xbd, 0x87, 0x1f, 0xce, 0x22, 0x75, 0x99, 0x4f, - 0xb9, 0x4c, 0xe6, 0x5e, 0x06, 0x71, 0x96, 0x7b, 0x32, 0x49, 0xc1, 0x2b, 0x7c, 0x0f, 0x0a, 0x88, - 0x15, 0x5f, 0xa4, 0x89, 0x4a, 0xc8, 0xbe, 0x8e, 0x78, 0x1d, 0xf1, 0xc2, 0x3f, 0x7a, 0xfa, 0x97, - 0x34, 0x4b, 0x66, 0x89, 0xa7, 0xa9, 0x69, 0x7e, 0xf1, 0xa2, 0x38, 0xe6, 0x63, 0xee, 0xeb, 0xa6, - 0xee, 0xe9, 0xaa, 0xf9, 0xc8, 0xd1, 0xa3, 0xee, 0x5f, 0xc5, 0x2a, 0x52, 0x9f, 0x0d, 0xd6, 0xfd, - 0x22, 0x79, 0x09, 0xf2, 0x83, 0xa1, 0x1e, 0x77, 0x52, 0x73, 0x50, 0x69, 0x24, 0x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, 0xef, 0x2c, 0xa2, 0x05, 0x7c, 0x8c, 0x62, 0xc8, 0xe8, 0xc8, 0xe9, 0xbb, - 0xbb, 0xbe, 0xd3, 0x7a, 0x8f, 0x30, 0x17, 0x11, 0xb7, 0x07, 0x09, 0xf6, 0x57, 0x25, 0xdb, 0x68, - 0x62, 0x53, 0x3e, 0x1f, 0x7d, 0xb9, 0x62, 0xbd, 0xeb, 0x2b, 0x86, 0x02, 0xe7, 0xf7, 0x4f, 0x1b, - 0x5d, 0x57, 0x36, 0xfa, 0x5e, 0xd9, 0x68, 0x59, 0xd9, 0xe8, 0xa6, 0xb2, 0xd1, 0x8f, 0xca, 0x46, - 0x5f, 0x7f, 0xd9, 0xbd, 0xb7, 0x56, 0xe1, 0x4f, 0x87, 0xfa, 0xae, 0xe3, 0x3f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xec, 0x33, 0x11, 0xb5, 0x11, 0x03, 0x00, 0x00, + // 471 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x6e, 0xd3, 0x40, + 0x14, 0xc7, 0x33, 0xce, 0x47, 0x93, 0x69, 0xbb, 0x60, 0x54, 0x22, 0x53, 0x21, 0x8f, 0xc5, 0x97, + 0xbc, 0xb2, 0xa9, 0x83, 0x58, 0xb0, 0x42, 0xa6, 0x5d, 0x54, 0x28, 0x02, 0x0d, 0x3b, 0x36, 0x95, + 0x3d, 0x7d, 0x49, 0x4d, 0x13, 0x3b, 0xd8, 0x63, 0x4b, 0xdc, 0x80, 0x0b, 0x20, 0xb1, 0xec, 0xb2, + 0x47, 0xe0, 0x08, 0x59, 0xf6, 0x04, 0x16, 0x98, 0x5d, 0x4e, 0xc0, 0x12, 0x79, 0x3c, 0x49, 0x20, + 0x22, 0xa8, 0xbb, 0xd1, 0xfb, 0xff, 0x7e, 0xcf, 0xf3, 0xde, 0x18, 0x3f, 0x1a, 0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f0, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xad, + 0x77, 0xd2, 0xe2, 0x7a, 0x03, 0x00, 0x00, } func (this *Event) Equal(that interface{}) bool { @@ -174,6 +178,14 @@ func (this *Event) Equal(that interface{}) bool { return false } } + if len(this.FallbackPipelines) != len(that1.FallbackPipelines) { + return false + } + for i := range this.FallbackPipelines { + if !this.FallbackPipelines[i].Equal(that1.FallbackPipelines[i]) { + return false + } + } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } @@ -190,6 +202,7 @@ type EventFace interface { GetID() []byte GetSequence() int64 GetPipelines() []*ResourceReference + GetFallbackPipelines() []*ResourceReference } func (this *Event) Proto() github_com_golang_protobuf_proto.Message { @@ -232,6 +245,10 @@ func (this *Event) GetPipelines() []*ResourceReference { return this.Pipelines } +func (this *Event) GetFallbackPipelines() []*ResourceReference { + return this.FallbackPipelines +} + func NewEventFromFace(that EventFace) *Event { this := &Event{} this.Timestamp = that.GetTimestamp() @@ -242,6 +259,7 @@ func NewEventFromFace(that EventFace) *Event { this.ID = that.GetID() this.Sequence = that.GetSequence() this.Pipelines = that.GetPipelines() + this.FallbackPipelines = that.GetFallbackPipelines() return this } @@ -269,6 +287,20 @@ func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.FallbackPipelines) > 0 { + for iNdEx := len(m.FallbackPipelines) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FallbackPipelines[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } if len(m.Pipelines) > 0 { for iNdEx := len(m.Pipelines) - 1; iNdEx >= 0; iNdEx-- { { @@ -393,8 +425,15 @@ func NewPopulatedEvent(r randyEvent, easy bool) *Event { this.Pipelines[i] = NewPopulatedResourceReference(r, easy) } } + if r.Intn(5) != 0 { + v4 := r.Intn(5) + this.FallbackPipelines = make([]*ResourceReference, v4) + for i := 0; i < v4; i++ { + this.FallbackPipelines[i] = NewPopulatedResourceReference(r, easy) + } + } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedEvent(r, 9) + this.XXX_unrecognized = randUnrecognizedEvent(r, 10) } return this } @@ -418,9 +457,9 @@ func randUTF8RuneEvent(r randyEvent) rune { return rune(ru + 61) } func randStringEvent(r randyEvent) string { - v4 := r.Intn(100) - tmps := make([]rune, v4) - for i := 0; i < v4; i++ { + v5 := r.Intn(100) + tmps := make([]rune, v5) + for i := 0; i < v5; i++ { tmps[i] = randUTF8RuneEvent(r) } return string(tmps) @@ -442,11 +481,11 @@ func randFieldEvent(dAtA []byte, r randyEvent, fieldNumber int, wire int) []byte switch wire { case 0: dAtA = encodeVarintPopulateEvent(dAtA, uint64(key)) - v5 := r.Int63() + v6 := r.Int63() if r.Intn(2) == 0 { - v5 *= -1 + v6 *= -1 } - dAtA = encodeVarintPopulateEvent(dAtA, uint64(v5)) + dAtA = encodeVarintPopulateEvent(dAtA, uint64(v6)) case 1: dAtA = encodeVarintPopulateEvent(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -507,6 +546,12 @@ func (m *Event) Size() (n int) { n += 1 + l + sovEvent(uint64(l)) } } + if len(m.FallbackPipelines) > 0 { + for _, e := range m.FallbackPipelines { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -795,6 +840,40 @@ func (m *Event) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FallbackPipelines", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FallbackPipelines = append(m.FallbackPipelines, &ResourceReference{}) + if err := m.FallbackPipelines[len(m.FallbackPipelines)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) diff --git a/v2/event.proto b/v2/event.proto index 9ae7d67..8fffe45 100644 --- a/v2/event.proto +++ b/v2/event.proto @@ -50,4 +50,6 @@ message Event { // APIVersion should default to "core/v2" and Type should default to // "Pipeline". repeated ResourceReference pipelines = 8 [ (gogoproto.jsontag) = "pipelines" ]; + //fallback pipelines + repeated ResourceReference fallback_pipelines = 9 [ (gogoproto.jsontag) = "fallback_pipelines" ]; } diff --git a/v2/fallback_pipeline.go b/v2/fallback_pipeline.go new file mode 100644 index 0000000..1a0eb96 --- /dev/null +++ b/v2/fallback_pipeline.go @@ -0,0 +1,93 @@ +package v2 + +import ( + "errors" + "net/url" + "path" + + stringsutil "github.com/sensu/core/v2/internal/stringutil" +) + +const ( + // FallbackPipelinesResource is the name of this resource type + FallbackPipelineResource = "fallbackPipeline" +) + +// GetObjectMeta returns the object metadata for the resource. +func (f *FallbackPipeline) GetObjectMeta() ObjectMeta { + return f.ObjectMeta +} + +// SetObjectMeta sets the object metadata for the resource. +func (f *FallbackPipeline) SetObjectMeta(meta ObjectMeta) { + f.ObjectMeta = meta +} + +// SetNamespace sets the namespace of the resource. +func (f *FallbackPipeline) SetNamespace(namespace string) { + f.Namespace = namespace +} + +// StorePrefix returns the path prefix to this resource in the store. +func (f *FallbackPipeline) StorePrefix() string { + return FallbackPipelineResource +} + +// RBACName describes the name of the resource for RBAC purposes. +func (f *FallbackPipeline) RBACName() string { + return FallbackPipelineResource +} + +// URIPath gives the path component of a pipeline URI. +func (f *FallbackPipeline) URIPath() string { + if f.Namespace == "" { + return path.Join(URLPrefix, FallbackPipelineResource, url.PathEscape(f.Name)) + } + return path.Join(URLPrefix, "namespaces", url.PathEscape(f.Namespace), FallbackPipelineResource, url.PathEscape(f.Name)) +} + +// // Validate checks if a pipeline resource passes validation rules. +func (f *FallbackPipeline) Validate() error { + if err := ValidateName(f.ObjectMeta.Name); err != nil { + return errors.New("name " + err.Error()) + } + + if f.ObjectMeta.Namespace == "" { + return errors.New("namespace must be set") + } + return nil +} + +// FallbackPipelineFields returns a set of fields that represent that resource. +func FallbackPipelineFields(r Resource) map[string]string { + resource := r.(*FallbackPipeline) + fields := map[string]string{ + "fallbackPipeline.name": resource.ObjectMeta.Name, + "fallbackPipeline.namespace": resource.ObjectMeta.Namespace, + } + stringsutil.MergeMapWithPrefix(fields, resource.ObjectMeta.Labels, "fallbackPipeline.labels.") + return fields +} + +// Fields returns a set of fields that represent that resource. +func (f *FallbackPipeline) Fields() map[string]string { + return FallbackPipelineFields(f) +} + +// // FixturePipeline returns a testing fixture for a Pipeline object. +func FixtureFallbackPipeline(name, namespace string) *FallbackPipeline { + return &FallbackPipeline{ + ObjectMeta: NewObjectMeta(name, namespace), + PipelineList: []*ResourceReference{}, + } +} + +// // FixturePipelineReference returns a testing fixture for a ResourceReference +// // object referencing a corev2.Pipeline. +func FixtureFallbackPipelineReference(name string) *ResourceReference { + return &ResourceReference{ + APIVersion: "core/v2", + Type: "FallbackPipeline", + Name: name, + } +} diff --git a/v2/go.mod b/v2/go.mod index 4597fed..82b890e 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -1,6 +1,6 @@ module github.com/sensu/core/v2 -go 1.18 +go 1.22 require ( github.com/echlebek/crock v1.0.1 diff --git a/v2/pipeline.pb.go b/v2/pipeline.pb.go index 7623ca9..0eca5e4 100644 --- a/v2/pipeline.pb.go +++ b/v2/pipeline.pb.go @@ -76,8 +76,60 @@ func (m *Pipeline) GetWorkflows() []*PipelineWorkflow { return nil } +// FallbackPipeline represents a named collection of fallback pipeline spec details. +type FallbackPipeline struct { + // Metadata contains the name, namespace, labels and annotations of the + ObjectMeta `protobuf:"bytes,1,opt,name=Metadata,proto3,embedded=Metadata" json:"metadata,omitempty"` + // FallbackpipelineList contains one or more pipeline list. + PipelineList []*ResourceReference `protobuf:"bytes,2,rep,name=pipelineList,proto3" json:"pipelinelist" yaml: "pipelinelist"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FallbackPipeline) Reset() { *m = FallbackPipeline{} } +func (m *FallbackPipeline) String() string { return proto.CompactTextString(m) } +func (*FallbackPipeline) ProtoMessage() {} +func (*FallbackPipeline) Descriptor() ([]byte, []int) { + return fileDescriptor_70464c4bd162b56d, []int{1} +} +func (m *FallbackPipeline) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FallbackPipeline) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FallbackPipeline.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FallbackPipeline) XXX_Merge(src proto.Message) { + xxx_messageInfo_FallbackPipeline.Merge(m, src) +} +func (m *FallbackPipeline) XXX_Size() int { + return m.Size() +} +func (m *FallbackPipeline) XXX_DiscardUnknown() { + xxx_messageInfo_FallbackPipeline.DiscardUnknown(m) +} + +var xxx_messageInfo_FallbackPipeline proto.InternalMessageInfo + +func (m *FallbackPipeline) GetPipelineList() []*ResourceReference { + if m != nil { + return m.PipelineList + } + return nil +} + func init() { proto.RegisterType((*Pipeline)(nil), "sensu.core.v2.Pipeline") + proto.RegisterType((*FallbackPipeline)(nil), "sensu.core.v2.FallbackPipeline") } func init() { @@ -85,26 +137,31 @@ func init() { } var fileDescriptor_70464c4bd162b56d = []byte{ - // 290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x2f, 0x4e, 0xcd, 0x2b, 0x2e, 0xd5, 0x4f, 0xce, 0x2f, - 0x4a, 0xd5, 0x2f, 0x33, 0xd2, 0x2f, 0xc8, 0x2c, 0x48, 0xcd, 0xc9, 0xcc, 0x4b, 0xd5, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0xcb, 0xea, 0x81, 0x64, 0xf5, 0xca, 0x8c, 0xa4, 0x4c, 0x90, - 0xf4, 0xa5, 0xe7, 0xa7, 0xe7, 0xeb, 0x83, 0x55, 0x25, 0x95, 0xa6, 0x39, 0x94, 0x19, 0xea, 0x19, - 0xeb, 0x19, 0x81, 0x05, 0xc1, 0x62, 0x60, 0x16, 0xc4, 0x10, 0x29, 0x65, 0x9c, 0xb6, 0xe5, 0xa6, - 0x96, 0x24, 0x42, 0x15, 0x19, 0x10, 0x74, 0x52, 0x7c, 0x79, 0x7e, 0x51, 0x76, 0x5a, 0x4e, 0x7e, - 0x39, 0x44, 0x87, 0xd2, 0x11, 0x46, 0x2e, 0x8e, 0x00, 0xa8, 0x9c, 0x50, 0x28, 0x17, 0x87, 0x6f, - 0x6a, 0x49, 0x62, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa4, 0x1e, - 0x8a, 0xdb, 0xf5, 0xfc, 0x93, 0xb2, 0x52, 0x93, 0x4b, 0x40, 0x8a, 0x9c, 0xe4, 0x4e, 0xdc, 0x93, - 0x67, 0xb8, 0x70, 0x4f, 0x9e, 0xf1, 0xd5, 0x3d, 0x79, 0xa1, 0x5c, 0xa8, 0x36, 0x9d, 0xfc, 0xdc, - 0xcc, 0x92, 0xd4, 0xdc, 0x82, 0x92, 0xca, 0x20, 0xb8, 0x51, 0x42, 0x89, 0x5c, 0x9c, 0xe1, 0x50, - 0x5b, 0x8b, 0x25, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xe4, 0xd1, 0xcc, 0x85, 0x39, 0x01, 0xa6, - 0xce, 0x49, 0xe9, 0xd5, 0x3d, 0x79, 0x4e, 0x98, 0x5b, 0x8b, 0x3f, 0xdd, 0x93, 0x17, 0xac, 0x4c, - 0xcc, 0xcd, 0xb1, 0x52, 0x50, 0x82, 0x8b, 0x29, 0x05, 0x21, 0x4c, 0x75, 0x52, 0xf8, 0xf1, 0x50, - 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x1d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, - 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19, 0x8f, 0xe5, 0x18, 0xa2, 0x98, 0xca, 0x8c, 0x92, - 0xd8, 0xc0, 0xfe, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xb2, 0x9e, 0xd4, 0xb6, 0x01, - 0x00, 0x00, + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x91, 0xb1, 0x4e, 0xc2, 0x40, + 0x1c, 0xc6, 0x39, 0x4c, 0x0c, 0x14, 0x4d, 0xb4, 0x71, 0x40, 0x86, 0xbb, 0xa6, 0x0e, 0x32, 0x98, + 0xab, 0x14, 0x27, 0x27, 0xd3, 0xc1, 0x49, 0xa3, 0x69, 0x62, 0x4c, 0x5c, 0xc8, 0xb5, 0x1e, 0x58, + 0x69, 0x7b, 0x4d, 0x7b, 0x2d, 0xe1, 0x4d, 0x7c, 0x04, 0x1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xf5, 0x56, 0x0c, 0x1a, 0xd5, 0xcb, 0xca, 0x46, 0xb3, 0xa6, 0xa3, 0x15, 0x6e, 0x31, 0x42, + 0xe1, 0x33, 0xd4, 0x49, 0x8a, 0xaa, 0x45, 0xbd, 0x68, 0x9a, 0xa2, 0xdd, 0x21, 0xf1, 0xdc, 0x53, + 0x45, 0x9d, 0x6b, 0xaa, 0xf9, 0x4b, 0x55, 0xdf, 0x80, 0xb4, 0x73, 0x4e, 0x5c, 0xd7, 0x22, 0x76, + 0xff, 0xbf, 0xeb, 0xf8, 0xd2, 0x56, 0x71, 0x80, 0x0b, 0x27, 0xe2, 0xa2, 0x91, 0xb2, 0x82, 0x36, + 0xc5, 0xc6, 0xcd, 0x62, 0xe1, 0x46, 0x73, 0x92, 0xa2, 0x79, 0xd2, 0x75, 0x22, 0x3e, 0x4d, 0xd1, + 0x9e, 0x68, 0xb5, 0x28, 0xab, 0xe6, 0x12, 0xdf, 0x50, 0xbe, 0x3e, 0x20, 0x78, 0xce, 0x20, 0x78, + 0xc9, 0x20, 0x18, 0x65, 0x10, 0x8c, 0x33, 0x08, 0xde, 0x33, 0x08, 0x9e, 0x3e, 0x61, 0xe9, 0xae, + 0x9c, 0xe8, 0xd6, 0x66, 0x7e, 0xcb, 0xf6, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x94, 0x8f, + 0xfe, 0xc5, 0x02, 0x00, 0x00, } func (this *Pipeline) Equal(that interface{}) bool { @@ -142,6 +199,41 @@ func (this *Pipeline) Equal(that interface{}) bool { } return true } +func (this *FallbackPipeline) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FallbackPipeline) + if !ok { + that2, ok := that.(FallbackPipeline) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ObjectMeta.Equal(&that1.ObjectMeta) { + return false + } + if len(this.PipelineList) != len(that1.PipelineList) { + return false + } + for i := range this.PipelineList { + if !this.PipelineList[i].Equal(that1.PipelineList[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} func (m *Pipeline) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -193,6 +285,57 @@ func (m *Pipeline) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *FallbackPipeline) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FallbackPipeline) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FallbackPipeline) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PipelineList) > 0 { + for iNdEx := len(m.PipelineList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PipelineList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPipeline(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPipeline(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintPipeline(dAtA []byte, offset int, v uint64) int { offset -= sovPipeline(v) base := offset @@ -221,6 +364,23 @@ func NewPopulatedPipeline(r randyPipeline, easy bool) *Pipeline { return this } +func NewPopulatedFallbackPipeline(r randyPipeline, easy bool) *FallbackPipeline { + this := &FallbackPipeline{} + v3 := NewPopulatedObjectMeta(r, easy) + this.ObjectMeta = *v3 + if r.Intn(5) != 0 { + v4 := r.Intn(5) + this.PipelineList = make([]*ResourceReference, v4) + for i := 0; i < v4; i++ { + this.PipelineList[i] = NewPopulatedResourceReference(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedPipeline(r, 3) + } + return this +} + type randyPipeline interface { Float32() float32 Float64() float64 @@ -240,9 +400,9 @@ func randUTF8RunePipeline(r randyPipeline) rune { return rune(ru + 61) } func randStringPipeline(r randyPipeline) string { - v3 := r.Intn(100) - tmps := make([]rune, v3) - for i := 0; i < v3; i++ { + v5 := r.Intn(100) + tmps := make([]rune, v5) + for i := 0; i < v5; i++ { tmps[i] = randUTF8RunePipeline(r) } return string(tmps) @@ -264,11 +424,11 @@ func randFieldPipeline(dAtA []byte, r randyPipeline, fieldNumber int, wire int) switch wire { case 0: dAtA = encodeVarintPopulatePipeline(dAtA, uint64(key)) - v4 := r.Int63() + v6 := r.Int63() if r.Intn(2) == 0 { - v4 *= -1 + v6 *= -1 } - dAtA = encodeVarintPopulatePipeline(dAtA, uint64(v4)) + dAtA = encodeVarintPopulatePipeline(dAtA, uint64(v6)) case 1: dAtA = encodeVarintPopulatePipeline(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -313,6 +473,26 @@ func (m *Pipeline) Size() (n int) { return n } +func (m *FallbackPipeline) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovPipeline(uint64(l)) + if len(m.PipelineList) > 0 { + for _, e := range m.PipelineList { + l = e.Size() + n += 1 + l + sovPipeline(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovPipeline(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -437,6 +617,124 @@ func (m *Pipeline) Unmarshal(dAtA []byte) error { } return nil } +func (m *FallbackPipeline) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPipeline + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FallbackPipeline: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FallbackPipeline: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPipeline + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPipeline + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPipeline + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PipelineList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPipeline + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPipeline + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPipeline + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PipelineList = append(m.PipelineList, &ResourceReference{}) + if err := m.PipelineList[len(m.PipelineList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPipeline(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPipeline + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipPipeline(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/v2/pipeline.proto b/v2/pipeline.proto index a0467f2..2625d42 100644 --- a/v2/pipeline.proto +++ b/v2/pipeline.proto @@ -3,6 +3,7 @@ syntax = "proto3"; import "github.com/gogo/protobuf@v1.3.2/gogoproto/gogo.proto"; import "github.com/sensu/core/v2/meta.proto"; import "github.com/sensu/core/v2/pipeline_workflow.proto"; +import "github.com/sensu/core/v2/resource_reference.proto"; package sensu.core.v2; @@ -23,3 +24,11 @@ message Pipeline { // Workflows contains one or more pipeline workflows. repeated PipelineWorkflow Workflows = 2 [ (gogoproto.jsontag) = "workflows", (gogoproto.moretags) = "yaml: \"workflows\"" ]; } + +// FallbackPipeline represents a named collection of fallback pipeline spec details. +message FallbackPipeline { + // Metadata contains the name, namespace, labels and annotations of the + ObjectMeta Metadata = 1 [ (gogoproto.jsontag) = "metadata,omitempty", (gogoproto.embed) = true, (gogoproto.nullable) = false ]; + // FallbackpipelineList contains one or more pipeline list. + repeated ResourceReference pipelineList =2 [ (gogoproto.jsontag) = "pipelinelist", (gogoproto.moretags) = "yaml: \"pipelinelist\"" ]; +} \ No newline at end of file diff --git a/v2/pipeline_workflow.pb.go b/v2/pipeline_workflow.pb.go index 39c4a04..5b38edb 100644 --- a/v2/pipeline_workflow.pb.go +++ b/v2/pipeline_workflow.pb.go @@ -112,30 +112,30 @@ func init() { } var fileDescriptor_10fe3e5d2693196a = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x31, 0x4b, 0xfb, 0x40, - 0x18, 0xc6, 0xff, 0xd7, 0x96, 0x7f, 0x31, 0x45, 0xa8, 0x59, 0x8c, 0x1d, 0x92, 0x10, 0x97, 0x82, - 0x72, 0xb1, 0xa9, 0x93, 0x93, 0x74, 0x10, 0x17, 0x45, 0xb2, 0x08, 0x8a, 0x94, 0x34, 0xbe, 0x69, - 0x83, 0xb9, 0x5c, 0xb8, 0x5c, 0x52, 0xfa, 0x4d, 0xfc, 0x08, 0x7e, 0x04, 0x3f, 0x82, 0xa3, 0x9f, - 0x20, 0x68, 0xdc, 0x3a, 0x76, 0x72, 0x70, 0x90, 0x26, 0x17, 0x50, 0x6a, 0xa1, 0xdb, 0xdd, 0xf3, - 0x3e, 0xcf, 0xf3, 0x7b, 0x8f, 0x93, 0x8e, 0xc6, 0x3e, 0x9f, 0x24, 0x23, 0xec, 0x52, 0x62, 0xc6, - 0x10, 0xc6, 0x89, 0xe9, 0x52, 0x06, 0x66, 0x6a, 0x99, 0x91, 0x1f, 0x41, 0xe0, 0x87, 0x30, 0x9c, - 0x52, 0xf6, 0xe0, 0x05, 0x74, 0x8a, 0x23, 0x46, 0x39, 0x95, 0xb7, 0x0b, 0x1b, 0x5e, 0xda, 0x70, - 0x6a, 0x75, 0x8e, 0x7f, 0x14, 0x8c, 0xe9, 0x98, 0x9a, 0x85, 0x6b, 0x94, 0x78, 0xa7, 0x69, 0x0f, - 0xf7, 0xb1, 0x55, 0x88, 0x85, 0x56, 0x9c, 0xca, 0x92, 0xce, 0xfe, 0x5a, 0x2c, 0x01, 0xee, 0x08, - 0x53, 0x6f, 0xad, 0x89, 0x41, 0x4c, 0x13, 0xe6, 0xc2, 0x90, 0x81, 0x07, 0x0c, 0x42, 0x17, 0xca, - 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 0x78, 0x02, 0x00, 0x00, + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x2f, 0x4e, 0xcd, 0x2b, 0x2e, 0xd5, 0x4f, 0xce, 0x2f, + 0x4a, 0xd5, 0x2f, 0x33, 0xd2, 0x2f, 0xc8, 0x2c, 0x48, 0xcd, 0xc9, 0xcc, 0x4b, 0x8d, 0x2f, 0xcf, + 0x2f, 0xca, 0x4e, 0xcb, 0xc9, 0x2f, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0x2b, + 0xd3, 0x03, 0x29, 0xd3, 0x2b, 0x33, 0x92, 0x32, 0x41, 0x32, 0x20, 0x3d, 0x3f, 0x3d, 0x5f, 0x1f, + 0xac, 0x2a, 0xa9, 0x34, 0xcd, 0xa1, 0xcc, 0x50, 0xcf, 0x58, 0xcf, 0x08, 0x2c, 0x08, 0x16, 0x03, + 0xb3, 0x20, 0x86, 0x48, 0x19, 0xe2, 0xb4, 0xb6, 0x28, 0xb5, 0x38, 0xbf, 0xb4, 0x28, 0x39, 0x35, + 0xbe, 0x28, 0x35, 0x2d, 0xb5, 0x28, 0x35, 0x2f, 0x39, 0x15, 0xa2, 0x45, 0xe9, 0x0f, 0x13, 0x97, + 0x40, 0x00, 0xd4, 0x4d, 0xe1, 0x50, 0x27, 0x09, 0x69, 0x73, 0xb1, 0xf8, 0x25, 0xe6, 0xa6, 0x4a, + 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x89, 0xbf, 0xba, 0x27, 0xcf, 0x92, 0x97, 0x98, 0x9b, 0xfa, + 0xe9, 0x9e, 0x3c, 0x77, 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x82, 0x12, 0x88, 0x1b, 0x04, 0x56, 0x24, + 0x94, 0xc7, 0xc5, 0xee, 0x96, 0x99, 0x53, 0x92, 0x5a, 0x54, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, + 0x6d, 0xa4, 0xa0, 0x87, 0xe2, 0x17, 0xbd, 0x20, 0xa8, 0xdd, 0x41, 0x30, 0xab, 0x9d, 0x8c, 0x5e, + 0xdd, 0x93, 0x17, 0x4c, 0x83, 0x68, 0xd2, 0xc9, 0xcf, 0xcd, 0x2c, 0x49, 0xcd, 0x2d, 0x28, 0xa9, + 0xfc, 0x74, 0x4f, 0x5e, 0x12, 0x6a, 0x3c, 0x86, 0x9c, 0x52, 0x10, 0xcc, 0x12, 0x90, 0x7d, 0xbe, + 0xa5, 0x25, 0x89, 0x25, 0xf9, 0x45, 0x12, 0xcc, 0x0a, 0x8c, 0xc4, 0xdb, 0x97, 0x0b, 0xd1, 0x84, + 0xd5, 0x3e, 0x0c, 0x39, 0xa5, 0x20, 0x98, 0x25, 0x42, 0xd1, 0x5c, 0xec, 0x1e, 0x89, 0x79, 0x29, + 0x39, 0xa9, 0x45, 0x12, 0x2c, 0x44, 0xda, 0x27, 0xff, 0xea, 0x9e, 0x3c, 0x7b, 0x06, 0x44, 0xd3, + 0xa7, 0x7b, 0xf2, 0x02, 0x50, 0x5b, 0xa0, 0x22, 0xb1, 0x4a, 0x41, 0x30, 0x13, 0x9d, 0x14, 0x7e, + 0x3c, 0x94, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0x71, 0xc7, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, + 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa6, 0x32, + 0xa3, 0x24, 0x36, 0x70, 0x3c, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xec, 0xb5, 0x94, 0xf5, + 0x53, 0x02, 0x00, 0x00, } func (this *PipelineWorkflow) Equal(that interface{}) bool { diff --git a/v2/pipeline_workflow.proto b/v2/pipeline_workflow.proto index be59aed..116771e 100644 --- a/v2/pipeline_workflow.proto +++ b/v2/pipeline_workflow.proto @@ -1,7 +1,6 @@ syntax = "proto3"; import "github.com/gogo/protobuf@v1.3.2/gogoproto/gogo.proto"; -import "github.com/sensu/core/v2/meta.proto"; import "github.com/sensu/core/v2/resource_reference.proto"; package sensu.core.v2; @@ -30,4 +29,4 @@ message PipelineWorkflow { // Handler contains a reference to a resource to use as an event handler. ResourceReference Handler = 4 [ (gogoproto.jsontag) = "handler", (gogoproto.moretags) = "yaml: \"handler]\"" ]; -} +} \ No newline at end of file diff --git a/v2/pipelinepb_test.go b/v2/pipelinepb_test.go index 334fde7..9ff6a5a 100644 --- a/v2/pipelinepb_test.go +++ b/v2/pipelinepb_test.go @@ -76,6 +76,62 @@ func TestPipelineMarshalTo(t *testing.T) { } } +func TestFallbackPipelineProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, false) + dAtA, err := github_com_golang_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FallbackPipeline{} + if err := github_com_golang_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(dAtA)) + copy(littlefuzz, dAtA) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_golang_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestFallbackPipelineMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, false) + size := p.Size() + dAtA := make([]byte, size) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(dAtA) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FallbackPipeline{} + if err := github_com_golang_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + func TestPipelineJSON(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -94,6 +150,24 @@ func TestPipelineJSON(t *testing.T) { t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } +func TestFallbackPipelineJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FallbackPipeline{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) + } +} func TestPipelineProtoText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -122,6 +196,34 @@ func TestPipelineProtoCompactText(t *testing.T) { } } +func TestFallbackPipelineProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, true) + dAtA := github_com_golang_protobuf_proto.MarshalTextString(p) + msg := &FallbackPipeline{} + if err := github_com_golang_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestFallbackPipelineProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, true) + dAtA := github_com_golang_protobuf_proto.CompactTextString(p) + msg := &FallbackPipeline{} + if err := github_com_golang_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + func TestPipelineSize(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -144,4 +246,26 @@ func TestPipelineSize(t *testing.T) { } } +func TestFallbackPipelineSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFallbackPipeline(popr, true) + size2 := github_com_golang_protobuf_proto.Size(p) + dAtA, err := github_com_golang_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(dAtA) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_golang_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + //These tests are generated by github.com/gogo/protobuf/plugin/testgen diff --git a/v2/secret.pb.go b/v2/secret.pb.go index e2dc1f6..cb9f933 100644 --- a/v2/secret.pb.go +++ b/v2/secret.pb.go @@ -78,20 +78,19 @@ func init() { } var fileDescriptor_d2ceacd7de622ffa = []byte{ - // 199 bytes of a gzipped FileDescriptorProto + // 188 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 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00, 0x00, 0xff, 0xff, 0x1a, - 0xce, 0x41, 0xdb, 0xfb, 0x00, 0x00, 0x00, + 0x81, 0x05, 0xc1, 0x62, 0x60, 0x16, 0xc4, 0x10, 0x25, 0x3b, 0x2e, 0xb6, 0x60, 0xb0, 0xa1, 0x42, + 0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, + 0x90, 0x18, 0x17, 0x1b, 0xc4, 0x4a, 0x09, 0x26, 0xb0, 0x28, 0x94, 0x67, 0xc5, 0xd1, 0xb1, 0x40, + 0x9e, 0x61, 0xc5, 0x02, 0x79, 0x46, 0x27, 0x85, 0x1f, 0x0f, 0xe5, 0x18, 0x57, 0x3c, 0x92, 0x63, + 0xdc, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, + 0x63, 0x9c, 0xf1, 0x58, 0x8e, 0x21, 0x8a, 0xa9, 0xcc, 0x28, 0x89, 0x0d, 0x6c, 0x91, 0x31, 0x20, + 0x00, 0x00, 0xff, 0xff, 0x1c, 0xd1, 0x8b, 0x81, 0xd6, 0x00, 0x00, 0x00, } func (this *Secret) Equal(that interface{}) bool { diff --git a/v2/secret.proto b/v2/secret.proto index 7caad6b..25f1f53 100644 --- a/v2/secret.proto +++ b/v2/secret.proto @@ -1,7 +1,6 @@ syntax = "proto3"; import "github.com/gogo/protobuf@v1.3.2/gogoproto/gogo.proto"; -import "github.com/sensu/core/v2/meta.proto"; package sensu.core.v2; diff --git a/v2/typemap.go b/v2/typemap.go index 89ca62b..8e539de 100644 --- a/v2/typemap.go +++ b/v2/typemap.go @@ -30,6 +30,7 @@ var typeMap = map[string]interface{}{ "event": &Event{}, "event_filter": &EventFilter{}, "extension": &Extension{}, + "fallback_pipelines": &FallbackPipeline{}, "handler": &Handler{}, "handler_socket": &HandlerSocket{}, "health_response": &HealthResponse{}, diff --git a/v2/typemap_test.go b/v2/typemap_test.go index d16f349..c90923c 100644 --- a/v2/typemap_test.go +++ b/v2/typemap_test.go @@ -344,6 +344,22 @@ func TestResolveExtension(t *testing.T) { } } +func TestResolveFallbackPipeline(t *testing.T) { + var value interface{} = new(FallbackPipeline) + if _, ok := value.(Resource); ok { + if actual, err := apitools.Resolve("core/v2", "FallbackPipeline"); err != nil { + t.Fatal(err) + } else if _, ok := actual.(*FallbackPipeline); !ok { + t.Fatal("expected to resolve to type ") + } + return + } + _, err := apitools.Resolve("core/v2", "FallbackPipeline") + if err == nil { + t.Fatalf("expected non-nil error") + } +} + func TestResolveHandler(t *testing.T) { var value interface{} = new(Handler) if _, ok := value.(Resource); ok { diff --git a/v3/go.mod b/v3/go.mod index 57d067d..a0e6e8b 100644 --- a/v3/go.mod +++ b/v3/go.mod @@ -1,6 +1,6 @@ module github.com/sensu/core/v3 -go 1.18 +go 1.22 require ( github.com/gogo/protobuf v1.3.2