Skip to content

Commit

Permalink
Merge "git-server - use service with pod-name selector"
Browse files Browse the repository at this point in the history
  • Loading branch information
Microzuul CI authored and Gerrit Code Review committed Nov 27, 2023
2 parents 810a60b + 9833d76 commit 33aff79
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions controllers/git_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/softwarefactory-project/sf-operator/controllers/libs/utils"
appsv1 "k8s.io/api/apps/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const gsIdent = "git-server"
Expand Down Expand Up @@ -136,26 +135,8 @@ func (r *SFController) DeployGitServer() bool {
}

// Create services exposed
gitService := apiv1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: gsIdent,
Namespace: r.ns,
},
Spec: apiv1.ServiceSpec{
Ports: []apiv1.ServicePort{
{
Name: gsGitPortName,
Protocol: apiv1.ProtocolTCP,
Port: gsGitPort,
},
},
Type: apiv1.ServiceTypeNodePort,
Selector: map[string]string{
"app": "sf",
"run": gsIdent,
},
}}
r.GetOrCreate(&gitService)
svc := base.MkServicePod(gsIdent, r.ns, gsIdent+"-0", []int32{gsGitPort}, gsGitPortName)
r.EnsureService(&svc)

isStatefulset := r.IsStatefulSetReady(&current)
conds.UpdateConditions(&r.cr.Status.Conditions, gsIdent, isStatefulset)
Expand Down

0 comments on commit 33aff79

Please sign in to comment.