vendor: update buildkit to v0.11.0-rc4

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2023-01-06 11:22:18 +00:00
committed by Tonis Tiigi
parent ff6754eb04
commit 60c9cf74ce
30 changed files with 2648 additions and 542 deletions

View File

@ -0,0 +1,62 @@
package moby_buildkit_v1_sourcepolicy //nolint:revive
import (
"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
)
// MarshalJSON implements json.Marshaler with custom marshaling for PolicyAction.
// It gives the string form of the enum value.
func (a PolicyAction) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(PolicyAction_name, int32(a))
}
func (a *PolicyAction) UnmarshalJSON(data []byte) error {
val, err := proto.UnmarshalJSONEnum(PolicyAction_value, data, a.String())
if err != nil {
return err
}
_, ok := PolicyAction_name[val]
if !ok {
return errors.Errorf("invalid PolicyAction value: %d", val)
}
*a = PolicyAction(val)
return nil
}
func (a AttrMatch) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(AttrMatch_name, int32(a))
}
func (a *AttrMatch) UnmarshalJSON(data []byte) error {
val, err := proto.UnmarshalJSONEnum(AttrMatch_value, data, a.String())
if err != nil {
return err
}
_, ok := AttrMatch_name[val]
if !ok {
return errors.Errorf("invalid AttrMatch value: %d", val)
}
*a = AttrMatch(val)
return nil
}
func (a MatchType) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(MatchType_name, int32(a))
}
func (a *MatchType) UnmarshalJSON(data []byte) error {
val, err := proto.UnmarshalJSONEnum(MatchType_value, data, a.String())
if err != nil {
return err
}
_, ok := AttrMatch_name[val]
if !ok {
return errors.Errorf("invalid MatchType value: %d", val)
}
*a = MatchType(val)
return nil
}