mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 20:17:04 +00:00
remove image constraint
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
This commit is contained in:
@@ -81,11 +81,12 @@ func (app *AppFile) buildOAM(ns string, io cmdutil.IOStreams, buildImage bool, t
|
||||
v, ok := svc["image"]
|
||||
if ok {
|
||||
image = v.(string)
|
||||
} else {
|
||||
return nil, nil, ErrImageNotDefined
|
||||
}
|
||||
|
||||
if b := svc.GetBuild(); b != nil {
|
||||
if image == "" {
|
||||
return nil, nil, ErrImageNotDefined
|
||||
}
|
||||
if buildImage {
|
||||
io.Infof("\nBuilding service (%s)...\n", sname)
|
||||
if err := b.BuildImage(io, image); err != nil {
|
||||
@@ -94,8 +95,8 @@ func (app *AppFile) buildOAM(ns string, io cmdutil.IOStreams, buildImage bool, t
|
||||
}
|
||||
}
|
||||
|
||||
io.Infof("\nRendering component configs for service (%s)...\n", sname)
|
||||
acComp, comp, err := svc.RenderService(tm, sname, ns, image)
|
||||
io.Infof("\nRendering configs for service (%s)...\n", sname)
|
||||
acComp, comp, err := svc.RenderService(tm, sname, ns)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ services:
|
||||
yamlNoImage := `name: myapp
|
||||
services:
|
||||
bad-server:
|
||||
build:
|
||||
docker:
|
||||
file: Dockerfile
|
||||
cmd: ["node", "server.js"]
|
||||
`
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ func (s Service) GetBuild() *Build {
|
||||
|
||||
// RenderService render all capabilities of a service to CUE values of a Component.
|
||||
// It outputs a Component which will be marshaled as standalone Component and also returned AppConfig Component section.
|
||||
func (s Service) RenderService(tm template.Manager, name, ns, image string) (
|
||||
func (s Service) RenderService(tm template.Manager, name, ns string) (
|
||||
*v1alpha2.ApplicationConfigurationComponent, *v1alpha2.Component, error) {
|
||||
|
||||
// sort out configs by workload/trait
|
||||
@@ -89,8 +89,7 @@ func (s Service) RenderService(tm template.Manager, name, ns, image string) (
|
||||
|
||||
// only render webservice workload for now.
|
||||
ctxData := map[string]string{
|
||||
"name": name,
|
||||
"image": image,
|
||||
"name": name,
|
||||
}
|
||||
u, err := evalComponent(tm.LoadTemplate(wtype), ctxData, intifyValues(workloadKeys))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user