Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Renovate command and set ownership #136

Open
wants to merge 1 commit into
base: refactoring-pipelinerun
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions internal/controller/dependencyupdatecheck_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,43 @@ func (r *DependencyUpdateCheckReconciler) createPipelineRun(comp component.GitCo
return nil, err
}

if err := controllerutil.SetOwnerReference(pipelineRun, registry_secret, r.Scheme); err != nil {
// Set ownership so all resources get deleted once the job is deleted
// ownership for renovateSecret
if err := controllerutil.SetOwnerReference(pipelineRun, renovateSecret, r.Scheme); err != nil {
return nil, err
}
if err := r.Client.Update(ctx, registry_secret); err != nil {
if err := r.Client.Update(ctx, renovateSecret); err != nil {
return nil, err
}

// TODO: set ownerReferences for renovateConfigMap and renovateSecret
// ownership for registry_secret
if registry_secret != nil {
if err := controllerutil.SetOwnerReference(pipelineRun, registry_secret, r.Scheme); err != nil {
return nil, err
}
if err := r.Client.Update(ctx, registry_secret); err != nil {
return nil, err
}
}

// ownership for the renovateConfigMap
if err := controllerutil.SetOwnerReference(pipelineRun, renovateConfigMap, r.Scheme); err != nil {
return nil, err
}
if err := r.Client.Update(ctx, renovateConfigMap); err != nil {
return nil, err
}

// ownership for the caConfigMap
if caConfigMap != nil {
if err := controllerutil.SetOwnerReference(pipelineRun, caConfigMap, r.Scheme); err != nil {
return nil, err
}
if err := r.Client.Update(ctx, caConfigMap); err != nil {
return nil, err
}
}

return pipelineRun, nil
}

Expand Down
5 changes: 2 additions & 3 deletions internal/pkg/tekton/pipeline_run_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ func NewPipelineRunBuilder(name, namespace string) *PipelineRunBuilder {
TaskSpec: tektonv1.TaskSpec{
Steps: []tektonv1.Step{
{
Name: "renovate",
// TODO: use default, or get from ENV
Name: "renovate",
Image: "quay.io/konflux-ci/mintmaker-renovate-image:latest",
Script: `echo "Running Renovate"; sleep 10`,
Script: `renovate`,
},
},
},
Expand Down