Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Scherba <[email protected]>
  • Loading branch information
miklezzzz committed Oct 17, 2024
1 parent cd8345d commit 8cca014
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pkg/helm/helm3/helm3.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ func (h *Helm3Client) ListReleasesNames() ([]string, error) {

// Render renders helm templates for chart
func (h *Helm3Client) Render(releaseName string, chart string, valuesPaths []string, setValues []string, namespace string, debug bool) (string, error) {
args := []string{"template", releaseName, chart,
args := []string{
"template", releaseName, chart,
"--post-renderer", "./post-renderer",
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/helm/version_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

const (
DefaultHelmBinPath = "helm"
DefaultHelmBinPath = "helm"
DefaultHelmPostRendererPath = "./post-renderer"
)

Expand Down
7 changes: 3 additions & 4 deletions pkg/helm_resources_manager/helm_resources_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import (
"fmt"

log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/labels"
cr_cache "sigs.k8s.io/controller-runtime/pkg/cache"

"github.com/flant/addon-operator/pkg/app"
. "github.com/flant/addon-operator/pkg/helm_resources_manager/types"
klient "github.com/flant/kube-client/client"
"github.com/flant/kube-client/manifest"

"k8s.io/apimachinery/pkg/labels"
cr_cache "sigs.k8s.io/controller-runtime/pkg/cache"
)

type HelmResourcesManager interface {
Expand Down Expand Up @@ -50,7 +49,6 @@ type helmResourcesManager struct {
var _ HelmResourcesManager = &helmResourcesManager{}

func NewHelmResourcesManager(ctx context.Context, kclient *klient.Client) (HelmResourcesManager, error) {
cctx, cancel := context.WithCancel(ctx)
if kclient == nil {
return nil, fmt.Errorf("kube client not set")
}
Expand All @@ -67,6 +65,7 @@ func NewHelmResourcesManager(ctx context.Context, kclient *klient.Client) (HelmR
return nil, err
}

cctx, cancel := context.WithCancel(ctx)

Check failure on line 68 in pkg/helm_resources_manager/helm_resources_manager.go

View workflow job for this annotation

GitHub Actions / Run Go linters

lostcancel: the cancel function is not used on all paths (possible context leak) (govet)
go cache.Start(cctx)
log.Debug("Helm resource manager: cache's been started")
if synced := cache.WaitForCacheSync(cctx); !synced {
Expand Down
4 changes: 2 additions & 2 deletions pkg/helm_resources_manager/resources_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
log "github.com/sirupsen/logrus"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
cr_cache "sigs.k8s.io/controller-runtime/pkg/cache"
cr_client "sigs.k8s.io/controller-runtime/pkg/client"

"github.com/flant/addon-operator/pkg/utils"
klient "github.com/flant/kube-client/client"
"github.com/flant/kube-client/manifest"
cr_cache "sigs.k8s.io/controller-runtime/pkg/cache"
cr_client "sigs.k8s.io/controller-runtime/pkg/client"
)

const monitorDelayBase = time.Minute*4 + time.Second*30
Expand Down

0 comments on commit 8cca014

Please sign in to comment.