Skip to content

Chore upgrade tekton pipelines #1621

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cff088f
chore: upgrade tekton pipeline to 0.65.3 with dependencies upgrades
JordanGoasdoue Dec 4, 2024
7271f69
chore: use pipelinev1beta1 everywhere
JordanGoasdoue Dec 5, 2024
5920f2a
chore: use tektoncd/pipeline/pkg/apis/pipeline/v1
JordanGoasdoue Dec 5, 2024
23698d7
chore: regenerate crds with make crd-manifests
JordanGoasdoue Dec 5, 2024
a8e39e1
chore: manually edit zz_generated because controller-gen fails
JordanGoasdoue Dec 5, 2024
ec3cebd
chore: use Timeouts.Pipeline instead of Timeout
JordanGoasdoue Dec 5, 2024
4299813
chore: replace ArrayOrString with ParamValue
JordanGoasdoue Dec 5, 2024
d52a0bb
chore: get taskruns from clients instead of pr.Status.TaskRuns
JordanGoasdoue Dec 5, 2024
fe8b57c
chore: remove deprecated PipelineResources
JordanGoasdoue Dec 5, 2024
3ab1215
chore: add scheme on Manager config
JordanGoasdoue Dec 5, 2024
12a90f5
chore: add taskruns get permission
JordanGoasdoue Dec 6, 2024
461cda0
chore: pass tektonClient from param in ConvertPipelineRun
JordanGoasdoue Dec 6, 2024
a97dc56
chore: use lighthousev1alpha1
JordanGoasdoue Dec 9, 2024
df01046
chore: support v1 and v1beta1
JordanGoasdoue Mar 13, 2025
680f2bf
chore: convert from v1beta1 to v1 pipeline/task loaded from ref
JordanGoasdoue Mar 18, 2025
ed5edcc
chore: normalize actual and expected data to avoid diff when indent
JordanGoasdoue Mar 18, 2025
435aa09
chore(load_pipelinerun): show how to validate one uses test
JordanGoasdoue Mar 17, 2025
e1396d2
chore(load_pipelinerun): convert the expected to v1
JordanGoasdoue Mar 18, 2025
17972ce
chore(breakpoint): make test pass with updated struct
JordanGoasdoue Mar 18, 2025
e65d04d
chore(periodic): make test pass with new taskruntemplate
JordanGoasdoue Mar 18, 2025
57c78e8
test: make tests pass about activityRecord
JordanGoasdoue Mar 18, 2025
a5cd485
chore(tests): fix remaining tests
JordanGoasdoue Mar 19, 2025
4ee5d59
chore: upgrade tektoncd to latest 0.69.1
JordanGoasdoue Mar 19, 2025
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ importfmt: get-fmt-deps ## Checks the import format of the Go source files
fmt: importfmt
@echo "FORMATTING SOURCE"
FORMATTED=`$(GO) fmt ./...`
@([[ ! -z "$(FORMATTED)" ]] && printf "Fixed un-formatted files:\n$(FORMATTED)") || true
@([ ! -z "$(FORMATTED)" ] && printf "Fixed un-formatted files:\n$(FORMATTED)") || true

GOLINT := $(GOPATH)/bin/golint
$(GOLINT):
Expand Down Expand Up @@ -179,7 +179,7 @@ verify-code-unchanged:

CONTROLLER_GEN := $(GOPATH)/bin/controller-gen
$(CONTROLLER_GEN):
$(GO) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0
$(GO) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5

crd-manifests: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) crd:maxDescLen=0 paths="./pkg/apis/lighthouse/v1alpha1/..." output:crd:artifacts:config=crds
Expand Down
1 change: 1 addition & 0 deletions charts/lighthouse/templates/tekton-controller-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rules:
- tekton.dev
resources:
- pipelines
- taskruns
verbs:
- get
- apiGroups:
Expand Down
17 changes: 15 additions & 2 deletions cmd/foghorn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import (
"github.com/jenkins-x/lighthouse/pkg/foghorn"
"github.com/jenkins-x/lighthouse/pkg/logrusutil"
"github.com/sirupsen/logrus"
pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/manager"
)

type options struct {
Expand Down Expand Up @@ -38,7 +41,10 @@ func main() {

scheme := runtime.NewScheme()
if err := lighthousev1alpha1.AddToScheme(scheme); err != nil {
logrus.WithError(err).Fatal("Failed to register scheme")
logrus.WithError(err).Fatal("Failed to register lighthousev1alpha1 scheme")
}
if err := pipelinev1.AddToScheme(scheme); err != nil {
logrus.WithError(err).Fatal("Failed to register tektoncd-pipelinev1 scheme")
}

o := gatherOptions(flag.NewFlagSet(os.Args[0], flag.ExitOnError), os.Args[1:]...)
Expand All @@ -51,7 +57,14 @@ func main() {
logrus.WithError(err).Fatal("Could not create kubeconfig")
}

mgr, err := ctrl.NewManager(cfg, ctrl.Options{Scheme: scheme, Namespace: o.namespace})
mgr, err := ctrl.NewManager(cfg, manager.Options{
Cache: cache.Options{
DefaultNamespaces: map[string]cache.Config{
o.namespace: {},
},
},
Scheme: scheme,
})
if err != nil {
logrus.WithError(err).Fatal("Unable to start manager")
}
Expand Down
26 changes: 20 additions & 6 deletions cmd/tektoncontroller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"github.com/jenkins-x/lighthouse/pkg/interrupts"
"github.com/jenkins-x/lighthouse/pkg/logrusutil"
"github.com/sirupsen/logrus"
pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/manager"
)

type options struct {
Expand Down Expand Up @@ -45,10 +47,10 @@ func main() {

scheme := runtime.NewScheme()
if err := lighthousev1alpha1.AddToScheme(scheme); err != nil {
logrus.WithError(err).Fatal("Failed to register scheme")
logrus.WithError(err).Fatal("Failed to register lighthousev1alpha1 scheme")
}
if err := pipelinev1beta1.AddToScheme(scheme); err != nil {
logrus.WithError(err).Fatal("Failed to register scheme")
if err := pipelinev1.AddToScheme(scheme); err != nil {
logrus.WithError(err).Fatal("Failed to register tektoncd-pipelinev1 scheme")
}

o := gatherOptions(flag.NewFlagSet(os.Args[0], flag.ExitOnError), os.Args[1:]...)
Expand All @@ -61,12 +63,24 @@ func main() {
logrus.WithError(err).Fatal("Could not create kubeconfig")
}

mgr, err := ctrl.NewManager(cfg, ctrl.Options{Scheme: scheme, Namespace: o.namespace})
mgr, err := ctrl.NewManager(cfg, manager.Options{
Cache: cache.Options{
DefaultNamespaces: map[string]cache.Config{
o.namespace: {},
},
},
Scheme: scheme,
})
if err != nil {
logrus.WithError(err).Fatal("Unable to start manager")
}

lhJobReconciler := tektonengine.NewLighthouseJobReconciler(mgr.GetClient(), mgr.GetAPIReader(), mgr.GetScheme(), o.dashboardURL, o.dashboardTemplate, o.namespace)
tektonclient, _, _, _, err := clients.GetAPIClients()
if err != nil {
logrus.WithError(err).Fatal(err, "failed to get api clients")
}

lhJobReconciler := tektonengine.NewLighthouseJobReconciler(mgr.GetClient(), mgr.GetAPIReader(), mgr.GetScheme(), tektonclient, o.dashboardURL, o.dashboardTemplate, o.namespace)
if err = lhJobReconciler.SetupWithManager(mgr); err != nil {
logrus.WithError(err).Fatal("Unable to create controller")
}
Expand Down
24 changes: 11 additions & 13 deletions crds/lighthouse.jenkins.io_lighthousebreakpoints.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.16.5
name: lighthousebreakpoints.lighthouse.jenkins.io
spec:
group: lighthouse.jenkins.io
Expand All @@ -32,10 +30,16 @@ spec:
properties:
debug:
properties:
breakpoint:
items:
type: string
type: array
breakpoints:
properties:
beforeSteps:
items:
type: string
type: array
x-kubernetes-list-type: atomic
onFailure:
type: string
type: object
type: object
filter:
properties:
Expand All @@ -56,9 +60,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading
Loading