Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flux2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
fluxcd
flux2
Commits
d1357dff
Unverified
Commit
d1357dff
authored
4 years ago
by
Stefan Prodan
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #664 from fluxcd/source-watcher
Update dev guide to point to fluxcd/source-watcher
parents
f3389826
10255242
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/dev-guides/source-watcher.md
+12
-12
12 additions, 12 deletions
docs/dev-guides/source-watcher.md
with
12 additions
and
12 deletions
docs/dev-guides/source-watcher.md
+
12
−
12
View file @
d1357dff
...
...
@@ -17,7 +17,7 @@ On your dev machine install the following tools:
*
kustomize >= 3.5
*
docker >= 19.03
## Install
the GitOps Toolkit
## Install
Flux
Create a cluster for testing:
...
...
@@ -25,7 +25,7 @@ Create a cluster for testing:
kind create cluster
--name
dev
```
Install the
toolkit
CLI:
Install the
Flux
CLI:
```
sh
curl
-s
https://toolkit.fluxcd.io/install.sh |
sudo
bash
...
...
@@ -37,7 +37,7 @@ Verify that your dev machine satisfies the prerequisites with:
flux check
--pre
```
Install
the toolkit
controller
s
on the dev cluster:
Install
source-
controller on the dev cluster:
```
sh
flux
install
...
...
@@ -45,13 +45,13 @@ flux install
## Clone the sample controller
You'll be using
[
stefanprodan
/source-watcher
](
https://github.com/
stefanprodan
/source-watcher
)
as
You'll be using
[
fluxcd
/source-watcher
](
https://github.com/
fluxcd
/source-watcher
)
as
a template for developing your own controller. The source-watcher was scaffolded with
`kubebuilder init`
.
Clone the source-watcher repo:
Clone the source-watcher repo
sitory
:
```
sh
git clone https://github.com/
stefanprodan
/source-watcher
git clone https://github.com/
fluxcd
/source-watcher
cd
source-watcher
```
...
...
@@ -115,7 +115,7 @@ The source-controller reports the revision under `GitRepository.Status.Artifact.
## How it works
The
[
GitRepositoryWatcher
](
https://github.com/
stefanprodan
/source-watcher/blob/ma
ster
/controllers/gitrepository_watcher.go
)
The
[
GitRepositoryWatcher
](
https://github.com/
fluxcd
/source-watcher/blob/ma
in
/controllers/gitrepository_watcher.go
)
controller does the following:
*
subscribes to
`GitRepository`
events
...
...
@@ -186,8 +186,8 @@ func (r *GitRepositoryWatcher) SetupWithManager(mgr ctrl.Manager) error {
To add the watcher to an existing project, copy the controller and the revision change predicate to your
`controllers`
dir:
*
[
gitrepository_watcher.go
](
https://github.com/
stefanprodan
/source-watcher/blob/ma
ster
/controllers/gitrepository_watcher.go
)
*
[
gitrepository_predicate.go
](
https://github.com/
stefanprodan
/source-watcher/blob/ma
ster
/controllers/gitrepository_predicate.go
)
*
[
gitrepository_watcher.go
](
https://github.com/
fluxcd
/source-watcher/blob/ma
in
/controllers/gitrepository_watcher.go
)
*
[
gitrepository_predicate.go
](
https://github.com/
fluxcd
/source-watcher/blob/ma
in
/controllers/gitrepository_predicate.go
)
In your
`main.go`
init function, register the Source API schema:
...
...
@@ -224,9 +224,9 @@ Your `go.mod` should require controller-runtime v0.6 or newer:
```
go
require
(
k8s
.
io
/
apimachinery
v0
.1
8
.4
k8s
.
io
/
client
-
go
v0
.1
8
.4
sigs
.
k8s
.
io
/
controller
-
runtime
v0
.6.
0
k8s
.
io
/
apimachinery
v0
.1
9
.4
k8s
.
io
/
client
-
go
v0
.1
9
.4
sigs
.
k8s
.
io
/
controller
-
runtime
v0
.6.
4
)
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment