From 30a1884b9ed8742e01c90eb65c16ef7f11b92220 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Date: Tue, 18 Jun 2024 15:18:38 +0300 Subject: [PATCH 1/7] Fall back to `$XDG_CONFIG_PATH/minder/config.yaml` when reading configuration (#3645) This allows us to have a predictable configuration file when reading the client minder configuration. The idea is that we could set up `$XDG_CONFIG_PATH/minder/config.yaml` and that would serve as an entrypoint. In the future, we could modify this if we want to dynamically change the current working project. Signed-off-by: Juan Antonio Osorio --- cmd/cli/app/root.go | 48 ++++++++++----- cmd/reminder/app/root.go | 31 +++++----- cmd/server/app/root.go | 33 ++++++----- internal/config/utils.go | 42 ++++++-------- internal/config/utils_test.go | 106 ++++++++++++++++++++++++++++++++++ internal/util/helpers.go | 15 ++++- 6 files changed, 204 insertions(+), 71 deletions(-) diff --git a/cmd/cli/app/root.go b/cmd/cli/app/root.go index 570010e6f2..102698be8e 100644 --- a/cmd/cli/app/root.go +++ b/cmd/cli/app/root.go @@ -28,6 +28,7 @@ import ( "github.com/stacklok/minder/internal/config" clientconfig "github.com/stacklok/minder/internal/config/client" "github.com/stacklok/minder/internal/constants" + "github.com/stacklok/minder/internal/util" "github.com/stacklok/minder/internal/util/cli" ) @@ -73,7 +74,7 @@ Configuration options include: - identity.cli.issuer_url - identity.cli.client_id -By default, we look for the file as $PWD/config.yaml. You can specify a custom path via the --config flag, or by setting the MINDER_CONFIG environment variable.`, +By default, we look for the file as $PWD/config.yaml and $XDG_CONFIG_PATH/minder/config.yaml. You can specify a custom path via the --config flag, or by setting the MINDER_CONFIG environment variable.`, } ) @@ -116,33 +117,48 @@ func initConfig() { viper.SetEnvPrefix("minder") viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) - cfgFile := viper.GetString("config") - cfgFileData, err := config.GetConfigFileData(cfgFile, filepath.Join(".", "config.yaml")) - if err != nil { - RootCmd.PrintErrln(err) - os.Exit(1) + //nolint:errcheck // ignore error as we are just checking if the file exists + cfgDirPath, _ := util.GetConfigDirPath() + + var xdgConfigPath string + if cfgDirPath != "" { + xdgConfigPath = filepath.Join(cfgDirPath, "config.yaml") } - keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") - if len(keysWithNullValue) > 0 { - RootCmd.PrintErrln("Error: The following configuration keys are missing values:") - for _, key := range keysWithNullValue { - RootCmd.PrintErrln("Null Value at: " + key) + cfgFile := viper.GetString("config") + cfgFilePath := config.GetRelevantCfgPath(append([]string{cfgFile}, + filepath.Join(".", "config.yaml"), + xdgConfigPath, + )) + if cfgFilePath != "" { + cfgFileData, err := config.GetConfigFileData(cfgFilePath) + if err != nil { + RootCmd.PrintErrln(err) + os.Exit(1) } - os.Exit(1) - } - if cfgFile != "" { - viper.SetConfigFile(cfgFile) + keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") + if len(keysWithNullValue) > 0 { + RootCmd.PrintErrln("Error: The following configuration keys are missing values:") + for _, key := range keysWithNullValue { + RootCmd.PrintErrln("Null Value at: " + key) + } + os.Exit(1) + } + + viper.SetConfigFile(cfgFilePath) } else { // use defaults viper.SetConfigName("config") viper.AddConfigPath(".") + if cfgDirPath != "" { + viper.AddConfigPath(cfgDirPath) + } } viper.SetConfigType("yaml") viper.AutomaticEnv() - if err = viper.ReadInConfig(); err != nil { + if err := viper.ReadInConfig(); err != nil { if _, ok := err.(viper.ConfigFileNotFoundError); ok { // Config file not found; use default values RootCmd.PrintErrln("No config file present, using default values.") diff --git a/cmd/reminder/app/root.go b/cmd/reminder/app/root.go index 2873ace91d..5a399189c3 100644 --- a/cmd/reminder/app/root.go +++ b/cmd/reminder/app/root.go @@ -67,22 +67,25 @@ func init() { func initConfig() { cfgFile := viper.GetString("config") - cfgFileData, err := config.GetConfigFileData(cfgFile, filepath.Join(".", configFileName)) - if err != nil { - log.Fatal().Err(err).Msg("Error reading config file") - } + cfgFilePath := config.GetRelevantCfgPath(append([]string{cfgFile}, + filepath.Join(".", configFileName), + )) + if cfgFilePath != "" { + cfgFileData, err := config.GetConfigFileData(cfgFilePath) + if err != nil { + log.Fatal().Err(err).Msg("Error reading config file") + } - keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") - if len(keysWithNullValue) > 0 { - RootCmd.PrintErrln("Error: The following configuration keys are missing values:") - for _, key := range keysWithNullValue { - RootCmd.PrintErrln("Null Value at: " + key) + keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") + if len(keysWithNullValue) > 0 { + RootCmd.PrintErrln("Error: The following configuration keys are missing values:") + for _, key := range keysWithNullValue { + RootCmd.PrintErrln("Null Value at: " + key) + } + os.Exit(1) } - os.Exit(1) - } - if cfgFile != "" { - viper.SetConfigFile(cfgFile) + viper.SetConfigFile(cfgFilePath) } else { // use defaults viper.SetConfigName(strings.TrimSuffix(configFileName, filepath.Ext(configFileName))) @@ -91,7 +94,7 @@ func initConfig() { viper.SetConfigType("yaml") viper.AutomaticEnv() - if err = viper.ReadInConfig(); err != nil { + if err := viper.ReadInConfig(); err != nil { fmt.Println("Error reading config file:", err) } } diff --git a/cmd/server/app/root.go b/cmd/server/app/root.go index 490314d54f..b8c9ddb08d 100644 --- a/cmd/server/app/root.go +++ b/cmd/server/app/root.go @@ -67,23 +67,26 @@ func initConfig() { serverconfig.SetViperDefaults(viper.GetViper()) cfgFile := viper.GetString("config") - cfgFileData, err := config.GetConfigFileData(cfgFile, filepath.Join(".", "server-config.yaml")) - if err != nil { - RootCmd.PrintErrln(err) - os.Exit(1) - } + cfgFilePath := config.GetRelevantCfgPath(append([]string{cfgFile}, + filepath.Join(".", "server-config.yaml"), + )) + if cfgFilePath != "" { + cfgFileData, err := config.GetConfigFileData(cfgFilePath) + if err != nil { + RootCmd.PrintErrln(err) + os.Exit(1) + } - keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") - if len(keysWithNullValue) > 0 { - RootCmd.PrintErrln("Error: The following configuration keys are missing values:") - for _, key := range keysWithNullValue { - RootCmd.PrintErrln("Null Value at: " + key) + keysWithNullValue := config.GetKeysWithNullValueFromYAML(cfgFileData, "") + if len(keysWithNullValue) > 0 { + RootCmd.PrintErrln("Error: The following configuration keys are missing values:") + for _, key := range keysWithNullValue { + RootCmd.PrintErrln("Null Value at: " + key) + } + os.Exit(1) } - os.Exit(1) - } - if cfgFile != "" { - viper.SetConfigFile(cfgFile) + viper.SetConfigFile(cfgFilePath) } else { // use defaults viper.SetConfigName("server-config") @@ -92,7 +95,7 @@ func initConfig() { viper.SetConfigType("yaml") viper.AutomaticEnv() - if err = viper.ReadInConfig(); err != nil { + if err := viper.ReadInConfig(); err != nil { fmt.Println("Error reading config file:", err) } } diff --git a/internal/config/utils.go b/internal/config/utils.go index 8ea9568cab..a14a1c1ff0 100644 --- a/internal/config/utils.go +++ b/internal/config/utils.go @@ -102,30 +102,8 @@ func doViperBind[V any]( } // GetConfigFileData returns the data from the given configuration file. -func GetConfigFileData(cfgFile, defaultCfgPath string) (interface{}, error) { - var cfgFilePath string - var err error - if cfgFile != "" { - cfgFilePath, err = filepath.Abs(cfgFile) - if err != nil { - return nil, err - } - } else { - cfgFilePath, err = filepath.Abs(defaultCfgPath) - if err != nil { - return nil, err - } - } - - cleanCfgFilePath := filepath.Clean(cfgFilePath) - - // If no local config file is present during mounting, Docker will create an empty directory in the container. - // If no config file is present, system will revert to default values. - if info, err := os.Stat(cleanCfgFilePath); err == nil && info.IsDir() || err != nil && os.IsNotExist(err) { - return nil, nil - } - - cfgFileBytes, err := os.ReadFile(cleanCfgFilePath) +func GetConfigFileData(cfgFilePath string) (interface{}, error) { + cfgFileBytes, err := os.ReadFile(filepath.Clean(cfgFilePath)) if err != nil { return nil, err } @@ -139,6 +117,22 @@ func GetConfigFileData(cfgFile, defaultCfgPath string) (interface{}, error) { return cfgFileData, nil } +// GetRelevantCfgPath returns the first path that exists (and is a config file). +func GetRelevantCfgPath(paths []string) string { + for _, path := range paths { + if path == "" { + continue + } + + cleanPath := filepath.Clean(path) + if info, err := os.Stat(cleanPath); err == nil && !info.IsDir() { + return cleanPath + } + } + + return "" +} + // GetKeysWithNullValueFromYAML returns a list of paths to null values in the given configuration data. func GetKeysWithNullValueFromYAML(data interface{}, currentPath string) []string { var keysWithNullValue []string diff --git a/internal/config/utils_test.go b/internal/config/utils_test.go index 38adec9ab4..6b3d2ee430 100644 --- a/internal/config/utils_test.go +++ b/internal/config/utils_test.go @@ -16,9 +16,13 @@ package config import ( + "os" + "path/filepath" + "regexp" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" ) @@ -148,3 +152,105 @@ key3: [value1, null, value2] }) } } + +func TestGetRelevantCfgPath(t *testing.T) { + t.Parallel() + + type args struct { + paths []string + } + tests := []struct { + name string + args args + want string + }{ + { + name: "Test with empty paths", + args: args{ + paths: []string{}, + }, + want: "", + }, + { + name: "Test with one empty path", + args: args{ + paths: []string{""}, + }, + want: "", + }, + { + name: "Test with one non-empty path", + args: args{ + paths: []string{"config.yaml"}, + }, + want: "config.yaml", + }, + { + name: "Test with multiple paths", + args: args{ + paths: []string{"", "config.yaml", "config.yml", "config.json"}, + }, + want: "config.yaml", + }, + { + name: "Test with multiple paths with empty path in the middle", + args: args{ + paths: []string{"config.yaml", "", "config.yml", "config.json"}, + }, + want: "config.yaml", + }, + { + name: "Test with multiple paths with empty path at the end", + args: args{ + paths: []string{"config.yaml", "config.yml", "config.json", ""}, + }, + want: "config.yaml", + }, + { + name: "Test with multiple paths with empty path at the beginning", + args: args{ + paths: []string{"", "config.yaml", "config.yml", "config.json"}, + }, + want: "config.yaml", + }, + { + name: "Test with multiple paths with all empty paths", + args: args{ + paths: []string{"", "", "", ""}, + }, + want: "", + }, + { + name: "Test with multiple paths with all non-empty paths", + args: args{ + paths: []string{"config.yaml", "config.yml", "config.json"}, + }, + want: "config.yaml", + }, + { + name: "Test with one non-empty path and all empty paths", + args: args{ + paths: []string{"", "", "", "config.yaml"}, + }, + want: "config.yaml", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + baseDir := t.TempDir() + createdpaths := []string{} + for _, path := range tt.args.paths { + if path != "" { + f, err := os.Create(filepath.Clean(filepath.Join(baseDir, path))) + require.NoError(t, err) + createdpaths = append(createdpaths, f.Name()) + } + } + + got := GetRelevantCfgPath(createdpaths) + assert.Regexp(t, regexp.MustCompile("^.*"+tt.want+"$"), got) + }) + } +} diff --git a/internal/util/helpers.go b/internal/util/helpers.go index 28d1c8d436..46d288df8e 100644 --- a/internal/util/helpers.go +++ b/internal/util/helpers.go @@ -64,7 +64,8 @@ type OpenIdCredentials struct { AccessTokenExpiresAt time.Time `json:"expiry"` } -func getCredentialsPath() (string, error) { +// GetConfigDirPath returns the path to the config directory +func GetConfigDirPath() (string, error) { // Get the XDG_CONFIG_HOME environment variable xdgConfigHome := os.Getenv("XDG_CONFIG_HOME") @@ -77,7 +78,17 @@ func getCredentialsPath() (string, error) { xdgConfigHome = filepath.Join(homeDir, ".config") } - filePath := filepath.Join(xdgConfigHome, "minder", "credentials.json") + filePath := filepath.Join(xdgConfigHome, "minder") + return filePath, nil +} + +func getCredentialsPath() (string, error) { + cfgPath, err := GetConfigDirPath() + if err != nil { + return "", fmt.Errorf("error getting config path: %v", err) + } + + filePath := filepath.Join(cfgPath, "credentials.json") return filePath, nil } From 54c62db9034e29bca022cb29c47493d2fefe761a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:01:37 +0100 Subject: [PATCH 2/7] Auto-generated cli documentation update - 2024-06-18 15:18:38 (#3648) Update documentation Co-authored-by: JAORMX --- docs/docs/ref/cli/minder_config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/ref/cli/minder_config.md b/docs/docs/ref/cli/minder_config.md index 649d81813c..bed6f84a10 100644 --- a/docs/docs/ref/cli/minder_config.md +++ b/docs/docs/ref/cli/minder_config.md @@ -19,7 +19,7 @@ Configuration options include: - identity.cli.issuer_url - identity.cli.client_id -By default, we look for the file as $PWD/config.yaml. You can specify a custom path via the --config flag, or by setting the MINDER_CONFIG environment variable. +By default, we look for the file as $PWD/config.yaml and $XDG_CONFIG_PATH/minder/config.yaml. You can specify a custom path via the --config flag, or by setting the MINDER_CONFIG environment variable. ### Options From 929a71aca7add19083964f1176ced4070030eeda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:19:42 +0200 Subject: [PATCH 3/7] build(deps): bump docker/build-push-action from 6.0.0 to 6.0.1 (#3652) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/c382f710d39a5bb4e430307530a720f50c2d3318...94f8f8c2eec4bc3f1d78c1755580779804cb87b2) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/image-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index d9db27a1b0..4fbd8da15e 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -50,7 +50,7 @@ jobs: uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 - name: Test build on x86 id: docker_build - uses: docker/build-push-action@c382f710d39a5bb4e430307530a720f50c2d3318 # v6.0.0 + uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1 with: context: . file: ./docker/minder/Dockerfile From cb390b5df0849af31175da96c2d033f6285b1dea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:31:33 +0200 Subject: [PATCH 4/7] build(deps): bump peter-evans/create-pull-request from 6.0.5 to 6.1.0 (#3653) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.5 to 6.1.0. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/6d6857d36972b65feb161a90e484f2984215f83e...c5a7806660adbe173f04e3e038b0ccdcd758773c) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-docs-cli.yml | 2 +- .github/workflows/update-docs-dbschema.yml | 2 +- .github/workflows/update-docs-helm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs-cli.yml b/.github/workflows/update-docs-cli.yml index 10dd7a81d8..918d9a5b89 100644 --- a/.github/workflows/update-docs-cli.yml +++ b/.github/workflows/update-docs-cli.yml @@ -31,7 +31,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 with: commit-message: Update documentation committer: GitHub diff --git a/.github/workflows/update-docs-dbschema.yml b/.github/workflows/update-docs-dbschema.yml index c98838b220..8d69fc8631 100644 --- a/.github/workflows/update-docs-dbschema.yml +++ b/.github/workflows/update-docs-dbschema.yml @@ -27,7 +27,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 with: commit-message: Update DB schema committer: GitHub diff --git a/.github/workflows/update-docs-helm.yml b/.github/workflows/update-docs-helm.yml index 758af0e1d3..4ac72a344a 100644 --- a/.github/workflows/update-docs-helm.yml +++ b/.github/workflows/update-docs-helm.yml @@ -39,7 +39,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 with: commit-message: Update helm documentation committer: GitHub From 663d163a0b64350dbb1e652c52488c1a0b8387e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:45:43 +0200 Subject: [PATCH 5/7] build(deps): bump github.com/stacklok/frizbee from 0.0.19 to 0.0.20 (#3655) Bumps [github.com/stacklok/frizbee](https://github.com/stacklok/frizbee) from 0.0.19 to 0.0.20. - [Release notes](https://github.com/stacklok/frizbee/releases) - [Changelog](https://github.com/stacklok/frizbee/blob/main/.goreleaser.yaml) - [Commits](https://github.com/stacklok/frizbee/compare/v0.0.19...v0.0.20) --- updated-dependencies: - dependency-name: github.com/stacklok/frizbee dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 13 ++++++++----- go.sum | 27 +++++++++++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index c8c933b09c..c8bd9ec6aa 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/sqlc-dev/pqtype v0.3.0 - github.com/stacklok/frizbee v0.0.19 + github.com/stacklok/frizbee v0.0.20 github.com/stacklok/trusty-sdk-go v0.1.0 github.com/stretchr/testify v1.9.0 github.com/styrainc/regal v0.23.1 @@ -99,12 +99,14 @@ require ( github.com/charmbracelet/x/input v0.1.0 // indirect github.com/charmbracelet/x/term v0.1.1 // indirect github.com/charmbracelet/x/windows v0.1.0 // indirect - github.com/containerd/containerd v1.7.17 // indirect + github.com/containerd/containerd v1.7.18 // indirect + github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect + github.com/containerd/typeurl/v2 v2.1.1 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/distribution/reference v0.5.0 // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect @@ -135,6 +137,7 @@ require ( github.com/mattn/go-localereader v0.0.1 // indirect github.com/mfridman/interpolate v0.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/buildkit v0.14.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect @@ -204,9 +207,9 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect - github.com/docker/cli v26.0.1+incompatible // indirect + github.com/docker/cli v26.1.4+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v26.0.2+incompatible // indirect + github.com/docker/docker v26.1.4+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect diff --git a/go.sum b/go.sum index 354a99c28d..19f5c8db83 100644 --- a/go.sum +++ b/go.sum @@ -213,12 +213,16 @@ github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBS github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= -github.com/containerd/containerd v1.7.17 h1:KjNnn0+tAVQHAoaWRjmdak9WlvnFR/8rU1CHHy8Rm2A= -github.com/containerd/containerd v1.7.17/go.mod h1:vK+hhT4TIv2uejlcDlbVIc8+h/BqtKLIyNrtCZol8lI= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= +github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= +github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= @@ -254,14 +258,14 @@ github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQM github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 h1:lxmTCgmHE1GUYL7P0MlNa00M67axePTq+9nBSGddR8I= github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7/go.mod h1:GvWntX9qiTlOud0WkQ6ewFm0LPy5JUR1Xo0Ngbd1w6Y= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v26.0.1+incompatible h1:eZDuplk2jYqgUkNLDYwTBxqmY9cM3yHnmN6OIUEjL3U= -github.com/docker/cli v26.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v26.1.4+incompatible h1:I8PHdc0MtxEADqYJZvhBrW9bo8gawKwwenxRM7/rLu8= +github.com/docker/cli v26.1.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v26.0.2+incompatible h1:yGVmKUFGgcxA6PXWAokO0sQL22BrQ67cgVjko8tGdXE= -github.com/docker/docker v26.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v26.1.4+incompatible h1:vuTpXDuoga+Z38m1OZHzl7NKisKWaWlhjQk7IDPSLsU= +github.com/docker/docker v26.1.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -658,6 +662,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/buildkit v0.14.0 h1:mHv2lFS8znLDRc4SMyM2B9tPjxWh2blMvr0H7ARquNM= +github.com/moby/buildkit v0.14.0/go.mod h1:1XssG7cAqv5Bz1xcGMxJL123iCv5TYN4Z/qf647gfuk= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= @@ -867,8 +873,8 @@ github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+ github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/sqlc-dev/pqtype v0.3.0 h1:b09TewZ3cSnO5+M1Kqq05y0+OjqIptxELaSayg7bmqk= github.com/sqlc-dev/pqtype v0.3.0/go.mod h1:oyUjp5981ctiL9UYvj1bVvCKi8OXkCa0u645hce7CAs= -github.com/stacklok/frizbee v0.0.19 h1:lD5O5e1lCYl6yGTtWW93m2w60TMeTJB5oLXMeaHnFHo= -github.com/stacklok/frizbee v0.0.19/go.mod h1:Hvi3/ryonTgeMBG4/EtBGjfK49W0rP0P3+0RAg3kqHI= +github.com/stacklok/frizbee v0.0.20 h1:CNEdupMNH8RWwUtnpVhQss+XVgK1tHIBxYtAFfO2pLg= +github.com/stacklok/frizbee v0.0.20/go.mod h1:+gf+U6lGsQguA8sjaEpqsHEtSD0uQ8TpzxRBe/AC7h8= github.com/stacklok/trusty-sdk-go v0.1.0 h1:b0m9HrAjJpyorev7vMbGf56UUMI1XyUBgd3SwnHCPh0= github.com/stacklok/trusty-sdk-go v0.1.0/go.mod h1:OWk/FxKjjFw+mQnCKaytoYL7vMWoj+8Ep2TYsp8QSaI= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= @@ -1347,6 +1353,7 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From b256788610f2742915af09efa6813fe39e873f73 Mon Sep 17 00:00:00 2001 From: Eleftheria Stein-Kousathana Date: Wed, 19 Jun 2024 10:09:20 +0200 Subject: [PATCH 6/7] Bump go to v1.22.4 (#3657) --- docker/minder/Dockerfile | 2 +- docker/reminder/Dockerfile | 2 +- go.mod | 2 +- tools/go.mod | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/minder/Dockerfile b/docker/minder/Dockerfile index 5696018465..8ed33080a3 100644 --- a/docker/minder/Dockerfile +++ b/docker/minder/Dockerfile @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.22.3@sha256:f43c6f049f04cbbaeb28f0aad3eea15274a7d0a7899a617d0037aec48d7ab010 AS builder +FROM golang:1.22.4@sha256:c2010b9c2342431a24a2e64e33d9eb2e484af49e72c820e200d332d214d5e61f AS builder ENV APP_ROOT=/opt/app-root ENV GOPATH=$APP_ROOT diff --git a/docker/reminder/Dockerfile b/docker/reminder/Dockerfile index a0fbf73ec7..4de7578c34 100644 --- a/docker/reminder/Dockerfile +++ b/docker/reminder/Dockerfile @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.22.3@sha256:f43c6f049f04cbbaeb28f0aad3eea15274a7d0a7899a617d0037aec48d7ab010 AS builder +FROM golang:1.22.4@sha256:c2010b9c2342431a24a2e64e33d9eb2e484af49e72c820e200d332d214d5e61f AS builder ENV APP_ROOT=/opt/app-root ENV GOPATH=$APP_ROOT diff --git a/go.mod b/go.mod index c8bd9ec6aa..8e5e7a02a4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/stacklok/minder -go 1.22.3 +go 1.22.4 require ( github.com/ThreeDotsLabs/watermill v1.3.5 diff --git a/tools/go.mod b/tools/go.mod index 8f6de3540a..ac6e9d97e1 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/stacklok/minder/tools -go 1.22.3 +go 1.22.4 require ( github.com/bufbuild/buf v1.33.0 From 7541461e1bdd1649489f0a79c605a1d1cb4e6796 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:18:56 +0200 Subject: [PATCH 7/7] build(deps): bump github.com/openfga/openfga from 1.5.4 to 1.5.5 (#3654) Bumps [github.com/openfga/openfga](https://github.com/openfga/openfga) from 1.5.4 to 1.5.5. - [Release notes](https://github.com/openfga/openfga/releases) - [Changelog](https://github.com/openfga/openfga/blob/main/CHANGELOG.md) - [Commits](https://github.com/openfga/openfga/compare/v1.5.4...v1.5.5) --- updated-dependencies: - dependency-name: github.com/openfga/openfga dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8e5e7a02a4..bc9508de29 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/open-feature/go-sdk-contrib/providers/go-feature-flag v0.1.37 github.com/open-policy-agent/opa v0.65.0 github.com/openfga/go-sdk v0.5.0 - github.com/openfga/openfga v1.5.4 + github.com/openfga/openfga v1.5.5 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/prometheus/client_golang v1.19.1 github.com/puzpuzpuz/xsync/v3 v3.1.0 @@ -151,7 +151,7 @@ require ( github.com/natefinch/wrap v0.2.0 // indirect github.com/nikunjy/rules v1.5.0 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect - github.com/openfga/api/proto v0.0.0-20240529184453-5b0b4941f3e0 // indirect + github.com/openfga/api/proto v0.0.0-20240612172407-db6f98774490 // indirect github.com/openfga/language/pkg/go v0.0.0-20240409225820-a53ea2892d6d // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pressly/goose/v3 v3.20.0 // indirect diff --git a/go.sum b/go.sum index 19f5c8db83..76f76de022 100644 --- a/go.sum +++ b/go.sum @@ -723,14 +723,14 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/openfga/api/proto v0.0.0-20240529184453-5b0b4941f3e0 h1:tSJl/atdqsDACjRQQPCbXe2GfEvcOkhdrUNmDToAjTA= -github.com/openfga/api/proto v0.0.0-20240529184453-5b0b4941f3e0/go.mod h1:XnvYrdU//9i70Aou6n4H5DJ0bdRPB3IlmE/Vx6qhnm8= +github.com/openfga/api/proto v0.0.0-20240612172407-db6f98774490 h1:Osd/j+jTWlZi/aXwKjzRPfsFKmdhB8nYMlidpKST8f8= +github.com/openfga/api/proto v0.0.0-20240612172407-db6f98774490/go.mod h1:gil5LBD8tSdFQbUkCQdnXsoeU9kDJdJgbGdHkgJfcd0= github.com/openfga/go-sdk v0.5.0 h1:1IuAu6Xf4eBxgc2AyMfosK7QzApxuZ5yi7jmFaftnl0= github.com/openfga/go-sdk v0.5.0/go.mod h1:AoMnFlPw65sU/7O4xOPpCb2vXA8ZD9K9xp2hZjcvt4g= github.com/openfga/language/pkg/go v0.0.0-20240409225820-a53ea2892d6d h1:n44DfITs+CLCYJIgsryJkG2ElwOZJ3huekPZKydPi7U= github.com/openfga/language/pkg/go v0.0.0-20240409225820-a53ea2892d6d/go.mod h1:wkI4GcY3yNNuFMU2ncHPWqBaF7XylQTkJYfBi2pIpK8= -github.com/openfga/openfga v1.5.4 h1:mVrp0uB9jNWX/5+OtZLM6YOx5Y9Y4r/D/O+LNBF/FGQ= -github.com/openfga/openfga v1.5.4/go.mod h1:+PoZg9BJeq+h3L0eR52tqNTwghSapCFtmaVKHsUK7QM= +github.com/openfga/openfga v1.5.5 h1:KPVX176JuHOCX9iARSacbS06VqxL5+jZ3WvIGws/xQw= +github.com/openfga/openfga v1.5.5/go.mod h1:9R4YjXJZZsd7x+oV2qCVFZNbEOck8DCnXwkaJ3zowwY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=