Skip to content

Commit

Permalink
Merge pull request #2282 from rnc/VOLUME
Browse files Browse the repository at this point in the history
Pass MAVEN_PASSWORD as env var via taskspec
  • Loading branch information
rnc authored Nov 22, 2024
2 parents 1d3b6be + acfe8dc commit fa3f5bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 0 additions & 5 deletions deploy/tasks/maven-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ spec:
name: trusted-ca
readOnly: true
env:
- name: MAVEN_PASSWORD
valueFrom:
secretKeyRef:
name: $(params.MVN_PASSWORD)
key: mavenpassword
- name: ACCESS_TOKEN
value: $(params.ACCESS_TOKEN)
args:
Expand Down
17 changes: 15 additions & 2 deletions pkg/reconciler/dependencybuild/dependencybuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,18 +624,31 @@ func (r *ReconcileDependencyBuild) handleStateBuilding(ctx context.Context, db *
}
}

trueBool := true
pr.Spec.TaskRunSpecs = []tektonpipeline.PipelineTaskRunSpec{{
PipelineTaskName: DeployTaskName,
PodTemplate: &pod.Template{
Env: []v1.EnvVar{
{
Name: "MAVEN_PASSWORD",
ValueFrom: &v1.EnvVarSource{SecretKeyRef: &v1.SecretKeySelector{LocalObjectReference: v1.LocalObjectReference{Name: v1alpha1.MavenSecretName}, Key: v1alpha1.MavenSecretKey, Optional: &trueBool}},
},
},
},
}}

if jbsConfig.Annotations != nil && jbsConfig.Annotations[jbsconfig.CITests] == "true" {
log.Info(fmt.Sprintf("Configuring resources for %#v", BuildTaskName))
podMemR, _ := resource.ParseQuantity("1792Mi")
podMemL, _ := resource.ParseQuantity("3584Mi")
podCPU, _ := resource.ParseQuantity("500m")
pr.Spec.TaskRunSpecs = []tektonpipeline.PipelineTaskRunSpec{{
pr.Spec.TaskRunSpecs = append(pr.Spec.TaskRunSpecs, tektonpipeline.PipelineTaskRunSpec{
PipelineTaskName: BuildTaskName,
ComputeResources: &v1.ResourceRequirements{
Requests: v1.ResourceList{"memory": podMemR, "cpu": podCPU},
Limits: v1.ResourceList{"memory": podMemL, "cpu": podCPU},
},
}}
})
}
// TODO: DisableTLS defaults to true. Further the tls workspace has been removed from the build pipeline so an alternate method would be needed.
//if !jbsConfig.Spec.CacheSettings.DisableTLS {
Expand Down

0 comments on commit fa3f5bb

Please sign in to comment.