1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-07 20:23:03 +03:00

chore: kubernetes - create service for detached steps (#4892)

Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
This commit is contained in:
hhomar
2025-02-25 06:16:43 +00:00
committed by pat-s
parent 817987dd92
commit d4508074a8
4 changed files with 61 additions and 4 deletions

View File

@@ -24,6 +24,8 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
client_cmd "k8s.io/client-go/tools/clientcmd"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/types"
)
var (
@@ -103,6 +105,10 @@ func getClientInsideOfCluster() (kubernetes.Interface, error) {
return kubernetes.NewForConfig(config)
}
func isService(step *types.Step) bool {
return step.Type == types.StepTypeService || (step.Detached && dnsPattern.FindStringIndex(step.Name) != nil)
}
func newBool(val bool) *bool {
ptr := new(bool)
*ptr = val