Files
odo/vendor/github.com/feloy/devfile-lifecycle/pkg/dftools/dftools.go
Philippe Martin 649181c1dc Implement devfile state in odo api (#6941)
* POST /devstate/container

* Implement POST /devstate/container

* Generate DELETE /devstate/container/{containerName}

* Implement DELETE /devstate/container/{containerName}

* Serve /devstate/image

* Implement /devstate/image

* Serve /devstate/resource

* Implement /devstate/resource

* Move Components specific code to components.go

* Serve /devstate/*command

* Implement /devstate/*command

* Serve /devstate/metadata

* Implement /devstate/metadata

* Serve devstate/chart

* Implement /devstate/chart

* Create a DevfileContent schema reference

* Use `DELETE /command/{name}` instead of `DELETE /*Command/{name}`

* Serve /devstate/command/move

* Implement /devstate/command/move

* Serve /devstate/command/{name}/[un]setDefault

* Implement /devstate/command/{name}/[un]setDefault

* serve /devstate/events

* Implement /devstate/events

* Serve /devstate/quantityValid

* Implement /devstate/quantityValid

* Add json tag to API result value

* Sets a proxy for the API

* Move calls from wasm to api (first part)

* Implement PUT /devsatte/devfile

* Move calls from wasm to api (end)

* Implement GET /devstate/devfile

* Implement DELETE /devstate/devfile

* At startup, get devfile from api, not from localStorage

* Rename service wasmGo -> devstate

* Remove wasm module

* Update to latest devfile-lifecycle version, license compatible

* Apply suggestions from code review

Co-authored-by: Armel Soro <armel@rm3l.org>

* Remove wasm from ui/{Makefile/devfile.yaml}

* Define DevfileContent into apispec

* Define required fields

* Generate API models from front

* Regenerate API server after spec changes

* Fix examples case

* Fix github action e2e tests not running

* Make target for all generated api code

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-07-05 05:19:29 -04:00

26 lines
622 B
Go
Generated

package dftools
import (
"strings"
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
)
func GetCommandGroup(command v1alpha2.Command) v1alpha2.CommandGroup {
if command.Exec != nil && command.Exec.Group != nil {
return *command.Exec.Group
}
if command.Apply != nil && command.Apply.Group != nil {
return *command.Apply.Group
}
if command.Composite != nil && command.Composite.Group != nil {
return *command.Composite.Group
}
return v1alpha2.CommandGroup{}
}
func IsDebugPort(endpoint v1alpha2.Endpoint) bool {
name := endpoint.Name
return name == "debug" || strings.HasPrefix(name, "debug-")
}