Giter Site home page Giter Site logo

fluxcd / source-watcher Goto Github PK

View Code? Open in Web Editor NEW
36.0 6.0 23.0 437 KB

Example consumer of the GitOps Toolkit Source APIs

Home Page: https://toolkit.fluxcd.io

License: Apache License 2.0

Dockerfile 6.64% Makefile 30.93% Go 62.43%
gitops-toolkit kubernetes controller-runtime

source-watcher's Introduction

source-watcher's People

Contributors

aryan9600 avatar dependabot[bot] avatar hiddeco avatar makkes avatar muki avatar nordes avatar pjbgf avatar scottrigby avatar snebel29 avatar stefanprodan avatar techiscool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

source-watcher's Issues

Sample crash while running under WSL-2 + Brew

I wanted to try building a new components, but first I tried the demo (source-watcher). I did what was in the requirements:

  • flux (latest already installed)
  • docker (latest already installed)
  • brew install go (go version go1.16.2 linux/amd64)
  • brew install kind
  • brew install kustomize
  • brew install kubectl
  • brew install kubebuilder

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.

code incomplete

the source code is incomplete few missing definitions --

  1. api/v1 directotory which is supposed to have gitrepository_types.go which has definition of GitRepository structure.
  2.  artifact := repository.Status.Artifact  found in gitrepository_controller.go:63  cannot be resolved
    
  3. src, ok := e.Object.(sourcev1.Source) found in gitrepository_predicate.go:33 cannot be reolved.

probably more definitions are missing, for now to highlight i have noted down these.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.