File tree Expand file tree Collapse file tree 5 files changed +16
-0
lines changed Expand file tree Collapse file tree 5 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,9 @@ func up(clicontext *cli.Context) error {
195
195
if err = buildutil .InterpretEnvdDef (builder ); err != nil {
196
196
return err
197
197
}
198
+ if ! builder .GetGraph ().IsDev () {
199
+ return errors .New ("`envd up` only works for dev images. If you're using v1, please enable dev with `base(dev=True)`." )
200
+ }
198
201
if err = buildutil .DetectEnvironment (clicontext , buildOpt ); err != nil {
199
202
return err
200
203
}
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ func (b generalBuilder) ShmSize() int {
125
125
return b .graph .GetShmSize ()
126
126
}
127
127
128
+ func (b generalBuilder ) IsDev () bool {
129
+ return b .graph .IsDev ()
130
+ }
131
+
128
132
func (b generalBuilder ) Build (ctx context.Context , force bool ) error {
129
133
if ! force && ! b .checkIfNeedBuild (ctx ) {
130
134
return nil
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ type graphVisitor interface {
44
44
GPUEnabled () bool
45
45
GetNumGPUs () int
46
46
GetShmSize () int
47
+ IsDev () bool
47
48
Labels () (map [string ]string , error )
48
49
ExposedPorts () (map [string ]struct {}, error )
49
50
GetEntrypoint (buildContextDir string ) ([]string , error )
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ func NewGraph() ir.Graph {
74
74
75
75
var DefaultGraph = NewGraph ()
76
76
77
+ func (g generalGraph ) IsDev () bool {
78
+ return g .Image == nil
79
+ }
80
+
77
81
func (g generalGraph ) GetShmSize () int {
78
82
return g .ShmSize
79
83
}
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ func (g *generalGraph) SetWriter(w compileui.Writer) {
71
71
g .Writer = w
72
72
}
73
73
74
+ func (g generalGraph ) IsDev () bool {
75
+ return g .Dev
76
+ }
77
+
74
78
func (g generalGraph ) GetHTTP () []ir.HTTPInfo {
75
79
return g .HTTP
76
80
}
You can’t perform that action at this time.
0 commit comments