fix some go issues

This commit is contained in:
Kjeld Schouten
2024-10-17 12:56:40 +02:00
parent 54e019763c
commit 8b691218f1
57 changed files with 103 additions and 103 deletions
+4 -4
View File
@@ -2,16 +2,16 @@
<img align="center" width="100" height="100" src="docs/docs/img/logo.svg">
<h3 align="center">clustertool</h3>
[![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/truecharts/clustertool?include_prereleases)](https://github.com/truecharts/private/clustertool/releases)
[![GitHub issues](https://img.shields.io/github/issues/truecharts/clustertool)](https://github.com/truecharts/private/clustertool/issues)
[![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/truecharts/clustertool?include_prereleases)](https://github.com/truecharts/public/clustertool/releases)
[![GitHub issues](https://img.shields.io/github/issues/truecharts/clustertool)](https://github.com/truecharts/public/clustertool/issues)
<p align="center">
A helper tool to help building <a href="https://truecharts.org">TrueCharts</a> helm charts
<br />
·
<a href="https://github.com/truecharts/private/clustertool/issues">Report Bug</a>
<a href="https://github.com/truecharts/public/clustertool/issues">Report Bug</a>
·
<a href="https://github.com/truecharts/private/clustertool/issues">Request Feature</a>
<a href="https://github.com/truecharts/public/clustertool/issues">Request Feature</a>
</p>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@ package cmd
import (
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/gencmd"
)
var bootstrap = &cobra.Command{
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
)
var fluxbootstrap = &cobra.Command{
+3 -3
View File
@@ -3,9 +3,9 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var health = &cobra.Command{
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var precommit = &cobra.Command{
+2 -2
View File
@@ -3,8 +3,8 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var reset = &cobra.Command{
+1 -1
View File
@@ -2,7 +2,7 @@ package cmd
import (
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/scale"
"github.com/truecharts/public/clustertool/pkg/scale"
)
var scaleexport = &cobra.Command{
+1 -1
View File
@@ -3,7 +3,7 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/scale"
"github.com/truecharts/public/clustertool/pkg/scale"
)
var scalemigrate = &cobra.Command{
+2 -2
View File
@@ -3,8 +3,8 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
var testcmd = &cobra.Command{
+4 -4
View File
@@ -3,10 +3,10 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/nodestatus"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var apply = &cobra.Command{
+1 -1
View File
@@ -3,7 +3,7 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/version"
"github.com/truecharts/public/clustertool/pkg/charts/version"
)
var bumper = &cobra.Command{
+2 -2
View File
@@ -3,8 +3,8 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/deps"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/charts/deps"
"github.com/truecharts/public/clustertool/pkg/helper"
)
var depsCmd = &cobra.Command{
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/changelog"
"github.com/truecharts/public/clustertool/pkg/charts/changelog"
)
var genChangelogCmd = &cobra.Command{
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/website"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/charts/website"
"github.com/truecharts/public/clustertool/pkg/helper"
)
var genChartListCmd = &cobra.Command{
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"slices"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/chartFile"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/charts/chartFile"
"github.com/truecharts/public/clustertool/pkg/helper"
)
var genMetaCmd = &cobra.Command{
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/charts/image"
"github.com/truecharts/public/clustertool/pkg/charts/image"
)
var tagCleaner = &cobra.Command{
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var checkcrypt = &cobra.Command{
+1 -1
View File
@@ -3,7 +3,7 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var decrypt = &cobra.Command{
+1 -1
View File
@@ -3,7 +3,7 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var encrypt = &cobra.Command{
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/nodestatus"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var genConfigLongHelp = strings.TrimSpace(`
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"path/filepath"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
var hrinstall = &cobra.Command{
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"path/filepath"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
var hrupgrade = &cobra.Command{
+1 -1
View File
@@ -2,7 +2,7 @@ package cmd
import (
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/info"
"github.com/truecharts/public/clustertool/pkg/info"
)
var infoCmd = &cobra.Command{
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"strings"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var initLongHelp = strings.TrimSpace(`
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
var thisversion string
+3 -3
View File
@@ -3,9 +3,9 @@ package cmd
import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/private/clustertool/pkg/gencmd"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var upgrade = &cobra.Command{
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/leaanthony/debme"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
//go:embed generic/*
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/truecharts/private/clustertool
module github.com/truecharts/public/clustertool
go 1.23.0
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/cmd"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/cmd"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"os"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/pkg/sops"
)
func main() {
@@ -9,7 +9,7 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/go-git/go-git/v5"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
type ChangelogOptions struct {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"time"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func (o *ChangelogOptions) Render() error {
@@ -6,7 +6,7 @@ import (
"os"
"github.com/go-playground/validator/v10"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/file"
+4 -4
View File
@@ -8,10 +8,10 @@ import (
"strings"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/charts/helmignore"
"github.com/truecharts/private/clustertool/pkg/charts/image"
"github.com/truecharts/private/clustertool/pkg/charts/readme"
"github.com/truecharts/private/clustertool/pkg/charts/version"
"github.com/truecharts/public/clustertool/pkg/charts/helmignore"
"github.com/truecharts/public/clustertool/pkg/charts/image"
"github.com/truecharts/public/clustertool/pkg/charts/readme"
"github.com/truecharts/public/clustertool/pkg/charts/version"
)
// UpdateChartFile updates the specified Chart.yaml file with an optional bump parameter.
@@ -4,7 +4,7 @@ import (
"reflect"
"testing"
"github.com/truecharts/private/clustertool/pkg/charts/image"
"github.com/truecharts/public/clustertool/pkg/charts/image"
)
func TestSetAppVersionFromImage(t *testing.T) {
+3 -3
View File
@@ -11,9 +11,9 @@ import (
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/charts/chartFile"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/charts/chartFile"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func LoadGPGKey() error {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/kubectlcmds"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/kubectlcmds"
)
func init() {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"time"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/cli"
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"golang.org/x/crypto/ssh"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/yaml"
+3 -3
View File
@@ -9,9 +9,9 @@ import (
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
"github.com/budimanjojo/talhelper/v3/pkg/generate"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
func GenApply(node string, extraFlags []string) []string {
+6 -6
View File
@@ -12,12 +12,12 @@ import (
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
"github.com/budimanjojo/talhelper/v3/pkg/generate"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/kubectlcmds"
"github.com/truecharts/private/clustertool/pkg/nodestatus"
"github.com/truecharts/private/clustertool/pkg/sops"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/kubectlcmds"
"github.com/truecharts/public/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/sops"
)
var HelmRepos map[string]*fluxhandler.HelmRepo
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"time"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/nodestatus"
)
func ExecCmd(cmd string) {
+3 -3
View File
@@ -17,9 +17,9 @@ import (
"github.com/fatih/color"
sideroConfig "github.com/siderolabs/talos/pkg/machinery/config"
"github.com/siderolabs/talos/pkg/machinery/config/generate/secrets"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/initfiles"
"gopkg.in/yaml.v3"
)
+2 -2
View File
@@ -1,8 +1,8 @@
package gencmd
import (
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func GenHealth(node string) string {
+2 -2
View File
@@ -1,8 +1,8 @@
package gencmd
import (
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func GenKubeConfig(node string) string {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
"github.com/budimanjojo/talhelper/v3/pkg/generate"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func GenReset(node string, extraFlags []string) []string {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
"github.com/budimanjojo/talhelper/v3/pkg/generate"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func GenUpgrade(node string, extraFlags []string) []string {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strings"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func LoadTalEnv() error {
+2 -2
View File
@@ -18,8 +18,8 @@ import (
age "filippo.io/age"
talhelperCfg "github.com/budimanjojo/talhelper/v3/pkg/config"
"github.com/invopop/jsonschema"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func InitFiles() error {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/go-logr/logr"
"github.com/go-logr/zapr"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"strings"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/embed"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
)
func baseStatusCMD(node string) []string {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"strings"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/fluxhandler"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/helper"
"gopkg.in/yaml.v3"
)
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"regexp"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"sigs.k8s.io/yaml"
)
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"github.com/getsops/sops/v3/decrypt"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
// Custom error type for MAC failures
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"regexp"
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
// EncryptAllFiles encrypts all unencrypted files as specified in the .sops.yaml configuration.
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/getsops/sops/v3/keys"
"github.com/getsops/sops/v3/keyservice"
"github.com/getsops/sops/v3/version"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
)
var encrConfig *EncryptionConfig
@@ -5,7 +5,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/truecharts/private/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/helper"
"gopkg.in/yaml.v3"
)