From 045ca0033b35a275870a027133528011f69025dc Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Fri, 20 Sep 2024 19:22:54 +0530 Subject: [PATCH 1/3] remove unsafestring usage in LabelAdapter Unmarshal --- pkg/push/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/push/types.go b/pkg/push/types.go index d0fc6d6cb8358..83fb01e668cc0 100644 --- a/pkg/push/types.go +++ b/pkg/push/types.go @@ -632,7 +632,7 @@ func (m *LabelAdapter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = yoloString(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -664,7 +664,7 @@ func (m *LabelAdapter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = yoloString(dAtA[iNdEx:postIndex]) + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex From b1205f5904129bb604088ee68177602959b79ae5 Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Mon, 23 Sep 2024 15:13:01 +0530 Subject: [PATCH 2/3] update comment --- pkg/push/types.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/push/types.go b/pkg/push/types.go index 83fb01e668cc0..7ab5ab2aeb5b8 100644 --- a/pkg/push/types.go +++ b/pkg/push/types.go @@ -571,8 +571,6 @@ func (m *Entry) Unmarshal(dAtA []byte) error { } // Unmarshal a LabelAdapter, implements proto.Unmarshaller. -// NB this is a copy of the autogenerated code to unmarshal a LabelPair, -// with the byte copying replaced with a yoloString. func (m *LabelAdapter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From ed75a93a9d43ff8b7ca0f4094118ec0b381cd64c Mon Sep 17 00:00:00 2001 From: Ashwanth Goli Date: Mon, 23 Sep 2024 15:16:18 +0530 Subject: [PATCH 3/3] vendor push pkg changes --- go.mod | 2 +- vendor/github.com/grafana/loki/pkg/push/types.go | 6 ++---- vendor/modules.txt | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9ebf69afe05f7..d17bd8e1ace81 100644 --- a/go.mod +++ b/go.mod @@ -124,7 +124,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 github.com/gogo/googleapis v1.4.1 github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 - github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 + github.com/grafana/loki/pkg/push v0.0.0-20240923094301-8ebb2b5300f0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/hashicorp/raft v1.7.1 github.com/hashicorp/raft-wal v0.4.1 diff --git a/vendor/github.com/grafana/loki/pkg/push/types.go b/vendor/github.com/grafana/loki/pkg/push/types.go index d0fc6d6cb8358..7ab5ab2aeb5b8 100644 --- a/vendor/github.com/grafana/loki/pkg/push/types.go +++ b/vendor/github.com/grafana/loki/pkg/push/types.go @@ -571,8 +571,6 @@ func (m *Entry) Unmarshal(dAtA []byte) error { } // Unmarshal a LabelAdapter, implements proto.Unmarshaller. -// NB this is a copy of the autogenerated code to unmarshal a LabelPair, -// with the byte copying replaced with a yoloString. func (m *LabelAdapter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -632,7 +630,7 @@ func (m *LabelAdapter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = yoloString(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -664,7 +662,7 @@ func (m *LabelAdapter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = yoloString(dAtA[iNdEx:postIndex]) + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/vendor/modules.txt b/vendor/modules.txt index 9705d54b3fb34..1c75c23800a42 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1034,7 +1034,7 @@ github.com/grafana/gomemcache/memcache # github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 ## explicit; go 1.13 github.com/grafana/jsonparser -# github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 => ./pkg/push +# github.com/grafana/loki/pkg/push v0.0.0-20240923094301-8ebb2b5300f0 => ./pkg/push ## explicit; go 1.19 github.com/grafana/loki/pkg/push # github.com/grafana/pyroscope-go/godeltaprof v0.1.8