Documentation ¶
Index ¶
- Variables
- func GetNativePlatform(gwClient gwclient.Client) (specs.Platform, error)
- func GetNativePlatformViaBkClient(ctx context.Context, bkClient *client.Client) (specs.Platform, error)
- func GetUserPlatform() specs.Platform
- func IsPlatformDefined(p Platform) bool
- type Platform
- type Resolver
- func (r *Resolver) Current() Platform
- func (r *Resolver) Default() Platform
- func (r *Resolver) LLBNative() specs.Platform
- func (r *Resolver) LLBUser() specs.Platform
- func (r *Resolver) Materialize(in Platform) Platform
- func (r *Resolver) Parse(str string) (Platform, error)
- func (r *Resolver) ParseAllowNativeAndUser(str string) (Platform, error)
- func (r *Resolver) PlatformEquals(p1, p2 Platform) bool
- func (r *Resolver) Scratch() pllb.State
- func (r *Resolver) SubPlatform(in Platform) Platform
- func (r *Resolver) SubResolver(newPlatform Platform) *Resolver
- func (r *Resolver) ToLLBPlatform(in Platform) specs.Platform
- func (r *Resolver) UpdatePlatform(newPlatform Platform) Platform
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultPlatform returns the default platform object. DefaultPlatform = Platform{} // NativePlatform returns the native platform. NativePlatform = Platform{/* contains filtered or unexported fields */} // UserPlatform returns the user platform. UserPlatform = Platform{/* contains filtered or unexported fields */} )
Functions ¶
func GetNativePlatform ¶
GetNativePlatform returns the native platform for a given gwClient.
func GetNativePlatformViaBkClient ¶
func GetNativePlatformViaBkClient(ctx context.Context, bkClient *client.Client) (specs.Platform, error)
GetNativePlatformViaBkClient returns the native platform for a given buildkit client.
func GetUserPlatform ¶
GetUserPlatform returns the user platform.
func IsPlatformDefined ¶
IsPlatformDefined returns true when the platform was explicitly set
Types ¶
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform is a platform set to either the user's platform, the native platform where the build executes, or another specific platform.
func FromLLBPlatform ¶
FromLLBPlatform returns a platform from a containerd platform.
type Resolver ¶
type Resolver struct { AllowNativeAndUser bool // this will be set via feature flag. // contains filtered or unexported fields }
Resolver is a platform resolver.
func NewResolver ¶
NewResolver returns a new platform resolver.
func (*Resolver) Materialize ¶
Materialize turns a platform into a concrete platform (resolves "user" / "native" / "") to an actual value.
func (*Resolver) Parse ¶
Parse parses a given platform string. Empty string is a valid selection: it means "the default platform".
func (*Resolver) ParseAllowNativeAndUser ¶
ParseAllowNativeAndUser parses a given platform string. Empty string is a valid selection: it means "the default platform". This variant forces allowing "native" and "user".
func (*Resolver) PlatformEquals ¶
PlatformEquals compares two platforms if the equate to the same platform. A "native" platform can still equate to a "user" platform, if they materialize to the same platform.
func (*Resolver) SubPlatform ¶
SubPlatform returns a platform that defaults to the current platform of the resolver (as opposed to the default platform of the resolver).
func (*Resolver) SubResolver ¶
SubResolver returns a copy of this resolver, but with the current and default platform overriden.
func (*Resolver) ToLLBPlatform ¶
ToLLBPlatform returns the containerd platform.
func (*Resolver) UpdatePlatform ¶
UpdatePlatform set the current platform of this resolver and returns the effective platform set, resolving the default accordingly.