Skip to content

Commit e073ce2

Browse files
savitaashtureShivam Mukhade
authored andcommitted
Added some prints to check pac watcher issue and removed extra param
1 parent 04bdb6b commit e073ce2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/pipelines-as-code-controller/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func main() {
3232
go func() {
3333
log.Println("started goroutine to watch configmap changes for controller")
3434
c <- struct{}{}
35-
if err := run.WatchConfigMapChanges(ctx, run); err != nil {
35+
if err := run.WatchConfigMapChanges(ctx); err != nil {
3636
log.Fatal("error from WatchConfigMapChanges for controller : ", err)
3737
}
3838
}()

pkg/params/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func StringToBool(s string) bool {
3838
}
3939

4040
// WatchConfigMapChanges watches for provide configmap
41-
func (r *Run) WatchConfigMapChanges(ctx context.Context, run *Run) error {
41+
func (r *Run) WatchConfigMapChanges(ctx context.Context) error {
4242
r.Clients.Log.Info("Inside WatchConfigMapChanges function")
4343
ns := os.Getenv("SYSTEM_NAMESPACE")
4444
if ns == "" {
@@ -51,7 +51,7 @@ func (r *Run) WatchConfigMapChanges(ctx context.Context, run *Run) error {
5151
if err != nil {
5252
return fmt.Errorf("unable to create watcher : %w", err)
5353
}
54-
if err := run.getConfigFromConfigMapWatcher(ctx, watcher.ResultChan()); err != nil {
54+
if err := r.getConfigFromConfigMapWatcher(ctx, watcher.ResultChan()); err != nil {
5555
return fmt.Errorf("failed to get defaults : %w", err)
5656
}
5757
return nil

pkg/reconciler/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func NewController() func(context.Context, configmap.Watcher) *controller.Impl {
3838
go func() {
3939
log.Println("started goroutine to watch configmap changes inside controller reconciler")
4040
c <- struct{}{}
41-
if err := run.WatchConfigMapChanges(ctx, run); err != nil {
41+
if err := run.WatchConfigMapChanges(ctx); err != nil {
4242
log.Fatal("error from WatchConfigMapChanges from controller reconciler : ", err)
4343
}
4444
}()

0 commit comments

Comments
 (0)