Files
buildkit/solver/pb/ops.go
Jonathan A. Sternberg 9f65f8c1fa gateway: ensure llb digests are deterministic when sent by frontends
This ensures different valid protobuf serializations that are sent by
frontends will be rewritten into digests that are normalized for the
buildkit solver.

The most recent example of this is that older frontends would generate
protobuf with gogo and the newer buildkit is using the google protobuf
library. These produce different serializations and cause the solver to
think that identical operations are actually different.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-11-14 16:12:28 -06:00

24 lines
474 B
Go

package pb
import proto "google.golang.org/protobuf/proto"
func (m *Definition) IsNil() bool {
return m == nil || m.Metadata == nil
}
func (m *Definition) Marshal() ([]byte, error) {
return m.MarshalVT()
}
func (m *Definition) Unmarshal(dAtA []byte) error {
return m.UnmarshalVT(dAtA)
}
func (m *Op) Marshal() ([]byte, error) {
return proto.MarshalOptions{Deterministic: true}.Marshal(m)
}
func (m *Op) Unmarshal(dAtA []byte) error {
return m.UnmarshalVT(dAtA)
}