vendor: github.com/moby/buildkit v0.25.1
full diff: https://github.com/moby/buildkit/compare/v0.25.0...v0.25.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -29,7 +29,7 @@ require (
|
||||
github.com/hashicorp/hcl/v2 v2.24.0
|
||||
github.com/in-toto/in-toto-golang v0.9.0
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
github.com/moby/buildkit v0.25.0
|
||||
github.com/moby/buildkit v0.25.1
|
||||
github.com/moby/go-archive v0.1.0
|
||||
github.com/moby/sys/atomicwriter v0.1.0
|
||||
github.com/moby/sys/mountinfo v0.7.2
|
||||
|
||||
@@ -255,8 +255,8 @@ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTS
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
|
||||
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/moby/buildkit v0.25.0 h1:cRgh74ymzyHxS5a/lsYT4OCyVU8iC3UgkwasIEUi0og=
|
||||
github.com/moby/buildkit v0.25.0/go.mod h1:phM8sdqnvgK2y1dPDnbwI6veUCXHOZ6KFSl6E164tkc=
|
||||
github.com/moby/buildkit v0.25.1 h1:j7IlVkeNbEo+ZLoxdudYCHpmTsbwKvhgc/6UJ/mY/o8=
|
||||
github.com/moby/buildkit v0.25.1/go.mod h1:phM8sdqnvgK2y1dPDnbwI6veUCXHOZ6KFSl6E164tkc=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
|
||||
|
||||
+94
@@ -1,6 +1,8 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"maps"
|
||||
"slices"
|
||||
|
||||
slsa "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common"
|
||||
@@ -311,3 +313,95 @@ func (p *ProvenancePredicateSLSA02) ConvertToSLSA1() *ProvenancePredicateSLSA1 {
|
||||
RunDetails: runDetails,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalJSON flattens ProvenanceCustomEnv into top level.
|
||||
func (p ProvenanceInternalParametersSLSA1) MarshalJSON() ([]byte, error) {
|
||||
type Alias ProvenanceInternalParametersSLSA1
|
||||
base, err := json.Marshal(Alias(p))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var m map[string]any
|
||||
if err := json.Unmarshal(base, &m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
maps.Copy(m, p.ProvenanceCustomEnv)
|
||||
delete(m, "ProvenanceCustomEnv")
|
||||
return json.Marshal(m)
|
||||
}
|
||||
|
||||
// UnmarshalJSON fills both struct fields and flattened custom env.
|
||||
func (p *ProvenanceInternalParametersSLSA1) UnmarshalJSON(data []byte) error {
|
||||
var m map[string]any
|
||||
if err := json.Unmarshal(data, &m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
type Alias ProvenanceInternalParametersSLSA1
|
||||
var a Alias
|
||||
if err := json.Unmarshal(data, &a); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Unmarshal known struct again to identify its keys
|
||||
structBytes, err := json.Marshal(a)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var known map[string]any
|
||||
if err := json.Unmarshal(structBytes, &known); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for k := range known {
|
||||
delete(m, k)
|
||||
}
|
||||
|
||||
*p = ProvenanceInternalParametersSLSA1(a)
|
||||
p.ProvenanceCustomEnv = m
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p Environment) MarshalJSON() ([]byte, error) {
|
||||
type Alias Environment
|
||||
base, err := json.Marshal(Alias(p))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var m map[string]any
|
||||
if err := json.Unmarshal(base, &m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
maps.Copy(m, p.ProvenanceCustomEnv)
|
||||
delete(m, "ProvenanceCustomEnv")
|
||||
return json.Marshal(m)
|
||||
}
|
||||
|
||||
func (p *Environment) UnmarshalJSON(data []byte) error {
|
||||
var m map[string]any
|
||||
if err := json.Unmarshal(data, &m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
type Alias Environment
|
||||
var a Alias
|
||||
if err := json.Unmarshal(data, &a); err != nil {
|
||||
return err
|
||||
}
|
||||
// Unmarshal known struct again to identify its keys
|
||||
structBytes, err := json.Marshal(a)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var known map[string]any
|
||||
if err := json.Unmarshal(structBytes, &known); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for k := range known {
|
||||
delete(m, k)
|
||||
}
|
||||
*p = Environment(a)
|
||||
p.ProvenanceCustomEnv = m
|
||||
return nil
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -448,7 +448,7 @@ github.com/mitchellh/go-wordwrap
|
||||
# github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
## explicit; go 1.14
|
||||
github.com/mitchellh/hashstructure/v2
|
||||
# github.com/moby/buildkit v0.25.0
|
||||
# github.com/moby/buildkit v0.25.1
|
||||
## explicit; go 1.24.0
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
|
||||
Reference in New Issue
Block a user