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 GitHub
parent 0428d01d6f
commit f47165ff9f
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