Skip to content

Commit

Permalink
resolve PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Morrison committed Jul 24, 2023
1 parent c8cb715 commit 4b412b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pkg/app_watcher/appwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app_watcher

import (
"context"

appclientset "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned"
"github.com/rs/zerolog/log"
"github.com/zapier/kubechecks/pkg/config"
Expand All @@ -10,7 +11,7 @@ import (
"strings"
"time"

appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
appv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
applisters "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiruntime "k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -78,7 +79,7 @@ func (ctrl *ApplicationWatcher) onApplicationAdded(obj interface{}) {
log.Error().Err(err).Msg("appwatcher: could not get key for added application")
}
log.Trace().Str("key", key).Msg("appwatcher: onApplicationAdded")
ctrl.cfg.VcsToArgoMap.AddApp(obj.(*appv1.Application))
ctrl.cfg.VcsToArgoMap.AddApp(obj.(*appv1alpha1.Application))
}

func (ctrl *ApplicationWatcher) onApplicationUpdated(old, new interface{}) {
Expand Down Expand Up @@ -119,7 +120,7 @@ func (ctrl *ApplicationWatcher) newApplicationInformerAndLister() (cache.SharedI
return ctrl.applicationClientset.ArgoprojV1alpha1().Applications(ctrl.cfg.ArgoCdNamespace).Watch(context.TODO(), options)
},
},
&appv1.Application{},
&appv1alpha1.Application{},
refreshTimeout,
cache.Indexers{
cache.NamespaceIndex: func(obj interface{}) ([]string, error) {
Expand All @@ -139,7 +140,7 @@ func (ctrl *ApplicationWatcher) newApplicationInformerAndLister() (cache.SharedI
}

func canProcessApp(obj interface{}) bool {
app, ok := obj.(*appv1.Application)
app, ok := obj.(*appv1alpha1.Application)
if !ok {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/hook_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package server
import (
"context"
"fmt"
"github.com/zapier/kubechecks/pkg/config"
"net/http"
"strings"
"sync"

"github.com/labstack/echo/v4"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"github.com/zapier/kubechecks/pkg/config"
"github.com/zapier/kubechecks/pkg/events"
"github.com/zapier/kubechecks/pkg/github_client"
"github.com/zapier/kubechecks/pkg/gitlab_client"
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package server

import (
"context"
"github.com/zapier/kubechecks/pkg/app_watcher"
"github.com/zapier/kubechecks/pkg/config"
"net/url"
"strings"

Expand All @@ -14,7 +12,9 @@ import (
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"github.com/zapier/kubechecks/pkg/app_watcher"
"github.com/zapier/kubechecks/pkg/argo_client"
"github.com/zapier/kubechecks/pkg/config"
"github.com/zapier/kubechecks/pkg/vcs_clients"
"github.com/ziflex/lecho/v3"
)
Expand Down

0 comments on commit 4b412b3

Please sign in to comment.