Example consumer of the GitOps Toolkit Source APIs.
fluxcd / source-watcher Goto Github PK
View Code? Open in Web Editor NEWExample consumer of the GitOps Toolkit Source APIs
Home Page: https://toolkit.fluxcd.io
License: Apache License 2.0
Example consumer of the GitOps Toolkit Source APIs
Home Page: https://toolkit.fluxcd.io
License: Apache License 2.0
Example consumer of the GitOps Toolkit Source APIs.
I wanted to try building a new components, but first I tried the demo (source-watcher). I did what was in the requirements:
Issue hit #1
When running the make
:
~/git/github/flux/source-watcher 09:58:33 north-pole
❯ make
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.3.0
/home/nordes/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
/home/linuxbrew/.linuxbrew/Cellar/go/1.16.2_1/libexec/src/net/cgo_linux.go:12:8: no such package located
Error: not all generators ran successfully
run `controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -w` to see all available markers, or `controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -h` for usage
make: *** [Makefile:55: generate] Error 1
To fix, I did : CGO_ENABLED=0 make
and it passed
Then I ran CGO_ENABLED=0 make run
so that it starts. First logs seems fine but when I create the GitRepository I have the following:
E0320 10:09:14.243913 33083 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 292 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x15538c0, 0x22103b0)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x95
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x86
panic(0x15538c0, 0x22103b0)
/home/linuxbrew/.linuxbrew/Cellar/go/1.16.2_1/libexec/src/runtime/panic.go:965 +0x1b9
github.com/fluxcd/source-watcher/controllers.(*GitRepositoryWatcher).Reconcile(0xc000892750, 0x18dcca8, 0xc000b43890, 0xc000041ae0, 0xb, 0xc000041ad0, 0x4, 0xc000b43800, 0x0, 0x0, ...)
/home/nordes/git/github/flux/source-watcher/controllers/gitrepository_watcher.go:55 +0x25c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002bda40, 0x18dcc00, 0xc0005acb80, 0x159dbc0, 0xc0007933a0)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:298 +0x30d
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002bda40, 0x18dcc00, 0xc0005acb80, 0x0)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2(0x18dcc00, 0xc0005acb80)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:216 +0x4a
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0x37
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc000b07750)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc000b37f50, 0x18ae280, 0xc000892a50, 0xc0005acb01, 0xc000045860)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0x9b
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000b07750, 0x3b9aca00, 0x0, 0x1, 0xc000045860)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext(0x18dcc00, 0xc0005acb80, 0xc00037fd10, 0x3b9aca00, 0x0, 0x1)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0xa6
k8s.io/apimachinery/pkg/util/wait.UntilWithContext(0x18dcc00, 0xc0005acb80, 0xc00037fd10, 0x3b9aca00)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99 +0x57
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:213 +0x40d
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x144ba7c]
goroutine 292 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:55 +0x109
panic(0x15538c0, 0x22103b0)
/home/linuxbrew/.linuxbrew/Cellar/go/1.16.2_1/libexec/src/runtime/panic.go:965 +0x1b9
github.com/fluxcd/source-watcher/controllers.(*GitRepositoryWatcher).Reconcile(0xc000892750, 0x18dcca8, 0xc000b43890, 0xc000041ae0, 0xb, 0xc000041ad0, 0x4, 0xc000b43800, 0x0, 0x0, ...)
/home/nordes/git/github/flux/source-watcher/controllers/gitrepository_watcher.go:55 +0x25c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002bda40, 0x18dcc00, 0xc0005acb80, 0x159dbc0, 0xc0007933a0)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:298 +0x30d
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002bda40, 0x18dcc00, 0xc0005acb80, 0x0)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2(0x18dcc00, 0xc0005acb80)
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:216 +0x4a
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0x37
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc000b07750)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc000b37f50, 0x18ae280, 0xc000892a50, 0xc0005acb01, 0xc000045860)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0x9b
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000b07750, 0x3b9aca00, 0x0, 0x1, 0xc000045860)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext(0x18dcc00, 0xc0005acb80, 0xc00037fd10, 0x3b9aca00, 0x0, 0x1)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185 +0xa6
k8s.io/apimachinery/pkg/util/wait.UntilWithContext(0x18dcc00, 0xc0005acb80, 0xc00037fd10, 0x3b9aca00)
/home/nordes/git/github/flux/source-watcher/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99 +0x57
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
/home/nordes/git/github/flux/source-watcher/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:213 +0x40d
exit status 2
make: *** [Makefile:26: run] Error 1
Any ideas what's happening? I remember not having any issues in WSL-2 with go in the past.
the source code is incomplete few missing definitions --
artifact := repository.Status.Artifact found in gitrepository_controller.go:63 cannot be resolved
probably more definitions are missing, for now to highlight i have noted down these.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.