mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Use devstate.PID.json * odo describe component gets forwarded ports from devstate.json * Pass pid in context * Add platform to state * Overwrite devstate.json if PId not exists * odo describe component displays forwarded ports from podman/cluster * Start only one session on platform * Fix integration test * Review * Fix * Update pkg/state/errors.go Co-authored-by: Armel Soro <armel@rm3l.org> * Integration tests * Fix integration test --------- Co-authored-by: Armel Soro <armel@rm3l.org>
18 lines
239 B
Go
18 lines
239 B
Go
package state
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func pidExists(pid int) (bool, error) {
|
|
if pid <= 0 {
|
|
return false, fmt.Errorf("invalid pid %v", pid)
|
|
}
|
|
_, err := os.FindProcess(pid)
|
|
if err != nil {
|
|
return false, nil
|
|
}
|
|
return true, nil
|
|
}
|