Update dagger engine to uses a given architecture instead of default one.
Check #1071 for more details Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/rs/zerolog/log"
|
||||
"go.dagger.io/dagger/keychain"
|
||||
"go.dagger.io/dagger/stdlib"
|
||||
@@ -182,6 +183,10 @@ func (w *Project) Get(ctx context.Context, name string) (*State, error) {
|
||||
}
|
||||
st.Project = w.Path
|
||||
|
||||
if st.Architecture == "" {
|
||||
st.Architecture = platforms.DefaultString()
|
||||
}
|
||||
|
||||
computed, err := os.ReadFile(path.Join(envPath, stateDir, computedFile))
|
||||
if err == nil {
|
||||
st.Computed = string(computed)
|
||||
@@ -263,7 +268,8 @@ func (w *Project) Create(ctx context.Context, name string, plan Plan) (*State, e
|
||||
Plan: Plan{
|
||||
Package: pkg,
|
||||
},
|
||||
Name: name,
|
||||
Name: name,
|
||||
Architecture: platforms.DefaultString(),
|
||||
}
|
||||
|
||||
data, err := yaml.Marshal(st)
|
||||
|
@@ -24,6 +24,9 @@ type State struct {
|
||||
// FIXME: store multiple names?
|
||||
Name string `yaml:"name,omitempty"`
|
||||
|
||||
// Architecture execution
|
||||
Architecture string `yaml:"architecture,omitempty"`
|
||||
|
||||
// User Inputs
|
||||
Inputs map[string]Input `yaml:"inputs,omitempty"`
|
||||
|
||||
|
Reference in New Issue
Block a user