temporarily disable the platform field.

Need some more time to figure out the correct API.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2022-04-05 12:10:54 -07:00
parent 1428c94679
commit 8d7d808024
3 changed files with 26 additions and 23 deletions

View File

@@ -82,9 +82,10 @@ func Load(ctx context.Context, cfg Config) (*Plan, error) {
p.fillAction()
if err := p.configPlatform(); err != nil {
return nil, err
}
// FIXME: `platform` field temporarily disabled
// if err := p.configPlatform(); err != nil {
// return nil, err
// }
if err := p.prepare(ctx); err != nil {
return nil, err
@@ -108,27 +109,28 @@ func (p *Plan) Action() *Action {
// configPlatform load the platform specified in the context
// Buildkit will then run every operation using that platform
// If platform is not define, context keep default platform
func (p *Plan) configPlatform() error {
platformField := p.source.Lookup("platform")
// FIXME: `platform` field temporarily disabled
// func (p *Plan) configPlatform() error {
// platformField := p.source.Lookup("platform")
// Ignore if platform is not set in `#Plan`
if !platformField.Exists() {
return nil
}
// // Ignore if platform is not set in `#Plan`
// if !platformField.Exists() {
// return nil
// }
// Convert platform to string
platform, err := platformField.String()
if err != nil {
return err
}
// // Convert platform to string
// platform, err := platformField.String()
// if err != nil {
// return err
// }
// Set platform to context
err = p.context.Platform.SetString(platform)
if err != nil {
return err
}
return nil
}
// // Set platform to context
// err = p.context.Platform.SetString(platform)
// if err != nil {
// return err
// }
// return nil
// }
// prepare executes the pre-run hooks of tasks
func (p *Plan) prepare(ctx context.Context) error {