Skip to content

Commit

Permalink
Merge "nodepool-builer - user Service with a 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 33aff79 + 8839058 commit e73b1f2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
launcherPortName = "nlwebapp"
launcherPort = 8006
buildLogsHttpdPort = 8080
buildLogsHttpdPortName = "buildlogs-http"
BuildLogsHttpdPortName = "buildlogs-http"
NodepoolProvidersSecretsName = "nodepool-providers-secrets"
builderIdent = nodepoolIdent + "-builder"
)
Expand Down Expand Up @@ -511,7 +511,7 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume,
},
}
buildLogsContainer.Ports = []apiv1.ContainerPort{
base.MkContainerPort(buildLogsHttpdPort, buildLogsHttpdPortName),
base.MkContainerPort(buildLogsHttpdPort, BuildLogsHttpdPortName),
}
buildLogsContainer.ReadinessProbe = base.MkReadinessHTTPProbe("/builds", buildLogsHttpdPort)
buildLogsContainer.StartupProbe = base.MkStartupHTTPProbe("/builds", buildLogsHttpdPort)
Expand All @@ -520,9 +520,9 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume,
buildLogsContainer,
)

httpdService := base.MkService(
buildLogsHttpdPortName, r.ns, builderIdent, []int32{buildLogsHttpdPort}, buildLogsHttpdPortName)
r.GetOrCreate(&httpdService)
svc := base.MkServicePod(
builderIdent, r.ns, builderIdent+"-0", []int32{buildLogsHttpdPort}, builderIdent)
r.EnsureService(&svc)

current := appsv1.StatefulSet{}
if r.GetM(builderIdent, &current) {
Expand All @@ -539,7 +539,7 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume,

pvcReadiness := r.reconcileExpandPVC(builderIdent+"-"+builderIdent+"-0", r.cr.Spec.Nodepool.Builder.Storage)

routeReady := r.ensureHTTPSRoute(r.cr.Name+"-nodepool-builder", "nodepool", buildLogsHttpdPortName, "/builds",
routeReady := r.ensureHTTPSRoute(r.cr.Name+"-nodepool-builder", "nodepool", builderIdent, "/builds",
buildLogsHttpdPort, map[string]string{}, r.cr.Spec.FQDN, r.cr.Spec.LetsEncrypt)

var isReady = r.IsStatefulSetReady(&current) && routeReady && pvcReadiness
Expand Down
13 changes: 13 additions & 0 deletions controllers/softwarefactory_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,20 @@ func (r *SFController) DeployLogserverResource() bool {
return logserverController.DeployLogserver().Ready
}

// cleanup ensures removal of legacy resources
func (r *SFController) cleanup() {
r.DeleteR(&corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Namespace: r.ns,
Name: BuildLogsHttpdPortName,
},
})
}

func (r *SFController) Step() sfv1.SoftwareFactoryStatus {

r.cleanup()

services := map[string]bool{}
services["Zuul"] = false

Expand Down

0 comments on commit e73b1f2

Please sign in to comment.