mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
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:

committed by
Tonis Tiigi

parent
ff6754eb04
commit
60c9cf74ce
3
vendor/github.com/moby/buildkit/sourcepolicy/pb/generate.go
generated
vendored
Normal file
3
vendor/github.com/moby/buildkit/sourcepolicy/pb/generate.go
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
package moby_buildkit_v1_sourcepolicy //nolint:revive
|
||||
|
||||
//go:generate protoc -I=. --gogofaster_out=plugins=grpc:. policy.proto
|
62
vendor/github.com/moby/buildkit/sourcepolicy/pb/json.go
generated
vendored
Normal file
62
vendor/github.com/moby/buildkit/sourcepolicy/pb/json.go
generated
vendored
Normal 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
|
||||
}
|
1615
vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go
generated
vendored
Normal file
1615
vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
64
vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.proto
generated
vendored
Normal file
64
vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.proto
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package moby.buildkit.v1.sourcepolicy;
|
||||
|
||||
// Rule defines the action(s) to take when a source is matched
|
||||
message Rule {
|
||||
PolicyAction action = 1;
|
||||
Selector selector = 2;
|
||||
Update updates = 3;
|
||||
}
|
||||
|
||||
// Update contains updates to the matched build step after rule is applied
|
||||
message Update {
|
||||
string identifier = 1;
|
||||
map<string, string> attrs = 2;
|
||||
}
|
||||
|
||||
// Selector identifies a source to match a policy to
|
||||
message Selector {
|
||||
string identifier = 1;
|
||||
// MatchType is the type of match to perform on the source identifier
|
||||
MatchType match_type = 2;
|
||||
repeated AttrConstraint constraints = 3;
|
||||
}
|
||||
|
||||
// PolicyAction defines the action to take when a source is matched
|
||||
enum PolicyAction {
|
||||
ALLOW = 0;
|
||||
DENY = 1;
|
||||
CONVERT = 2;
|
||||
}
|
||||
|
||||
// AttrConstraint defines a constraint on a source attribute
|
||||
message AttrConstraint {
|
||||
string key = 1;
|
||||
string value = 2;
|
||||
AttrMatch condition = 3;
|
||||
}
|
||||
|
||||
// AttrMatch defines the condition to match a source attribute
|
||||
enum AttrMatch {
|
||||
EQUAL = 0;
|
||||
NOTEQUAL = 1;
|
||||
MATCHES = 2;
|
||||
}
|
||||
|
||||
// Policy is the list of rules the policy engine will perform
|
||||
message Policy {
|
||||
int64 version = 1; // Currently 1
|
||||
repeated Rule rules = 2;
|
||||
}
|
||||
|
||||
// Match type is used to determine how a rule source is matched
|
||||
enum MatchType {
|
||||
// WILDCARD is the default matching type.
|
||||
// It may first attempt to due an exact match but will follow up with a wildcard match
|
||||
// For something more powerful, use REGEX
|
||||
WILDCARD = 0;
|
||||
// EXACT treats the source identifier as a litteral string match
|
||||
EXACT = 1;
|
||||
// REGEX treats the source identifier as a regular expression
|
||||
// With regex matching you can also use match groups to replace values in the destination identifier
|
||||
REGEX = 2;
|
||||
}
|
Reference in New Issue
Block a user