Skip to content

Commit

Permalink
Merge pull request #17 from Nordes/Fix_create_binding
Browse files Browse the repository at this point in the history
Fix Create predicate when no Artifact
  • Loading branch information
stefanprodan authored Mar 23, 2021
2 parents b6e8c85 + 608a8c7 commit 0a88ff3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions controllers/gitrepository_predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ type GitRepositoryRevisionChangePredicate struct {
predicate.Funcs
}

func (GitRepositoryRevisionChangePredicate) Create(e event.CreateEvent) bool {
src, ok := e.Object.(sourcev1.Source)

if !ok || src.GetArtifact() == nil {
return false
}

return true
}

func (GitRepositoryRevisionChangePredicate) Update(e event.UpdateEvent) bool {
if e.ObjectOld == nil || e.ObjectNew == nil {
return false
Expand Down

0 comments on commit 0a88ff3

Please sign in to comment.