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:
@@ -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
|
||||
|
Reference in New Issue
Block a user