From 4f6e38762efce30da0321dbf4023dec6059d5975 Mon Sep 17 00:00:00 2001 From: Rudro-25 Date: Mon, 8 Dec 2025 16:30:24 +0600 Subject: [PATCH 1/3] linter fix Signed-off-by: Rudro-25 --- .golangci.yml | 28 +++++++++++++++++++ Makefile | 4 +-- go.mod | 4 +-- hack/gendocs/main.go | 4 +-- pkg/cmds/root_token.go | 2 +- pkg/generate/aws/aws.go | 10 +++---- pkg/generate/azure/azure.go | 10 +++---- .../database/elasticsearch/elasticsearch.go | 10 +++---- pkg/generate/database/mariadb/mariadb.go | 10 +++---- pkg/generate/database/mongodb/mongodb.go | 10 +++---- pkg/generate/database/mysql/mysql.go | 10 +++---- pkg/generate/database/postgres/postgres.go | 10 +++---- pkg/generate/database/redis/redis.go | 10 +++---- pkg/generate/gcp/gcp.go | 10 +++---- .../azure-key-vault/azure_key_vault.go | 14 +++++----- .../google-kms-gcs/google_kms_gcs.go | 4 +-- 16 files changed, 88 insertions(+), 62 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..cdd2defce --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,28 @@ +version: "2" +linters: + default: standard + enable: + - unparam + +formatters: + enable: + - gofmt + - goimports + settings: + gofmt: + rewrite-rules: + - pattern: 'interface{}' + replacement: 'any' + +issues: + max-same-issues: 100 + + exclude-files: + - generated.*\\.go + + exclude-dirs: + - client + - vendor + +run: + timeout: 10m diff --git a/Makefile b/Makefile index 07deea314..364ec4fa0 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64 darwin/arm64 OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -GO_VERSION ?= 1.25 +GO_VERSION ?= 1.25.5 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(BIN)-$(OS)-$(ARCH) @@ -217,7 +217,7 @@ lint: $(BUILD_DIRS) --env GO111MODULE=on \ --env GOFLAGS="-mod=vendor" \ $(BUILD_IMAGE) \ - golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default + golangci-lint run $(BUILD_DIRS): @mkdir -p $@ diff --git a/go.mod b/go.mod index c98178acc..591a5fae8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module kubevault.dev/cli -go 1.24.0 - -toolchain go1.24.3 +go 1.25.5 require ( cloud.google.com/go/kms v1.15.8 diff --git a/hack/gendocs/main.go b/hack/gendocs/main.go index 967d49afc..2de4e8b79 100644 --- a/hack/gendocs/main.go +++ b/hack/gendocs/main.go @@ -98,8 +98,8 @@ func main() { Name string RootCmd bool }{ - strings.Replace(base, "_", "-", -1), - cases.Title(language.English).String(strings.Replace(base, "_", " ", -1)), + strings.ReplaceAll(base, "_", "-"), + cases.Title(language.English).String(strings.ReplaceAll(base, "_", " ")), !strings.ContainsRune(base, '_'), } var buf bytes.Buffer diff --git a/pkg/cmds/root_token.go b/pkg/cmds/root_token.go index 57e39bd69..f3ecf91e3 100644 --- a/pkg/cmds/root_token.go +++ b/pkg/cmds/root_token.go @@ -841,7 +841,7 @@ func rotateToken(vs *vaultapi.VaultServer, kubeClient kubernetes.Interface) erro } client.SetToken(oldToken) - payload := map[string]interface{}{ + payload := map[string]any{ "token": oldToken, } _, err = client.Logical().Write("auth/token/revoke", payload) diff --git a/pkg/generate/aws/aws.go b/pkg/generate/aws/aws.go index e73ea7a95..102b92c7d 100644 --- a/pkg/generate/aws/aws.go +++ b/pkg/generate/aws/aws.go @@ -41,11 +41,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type AWSGenerator struct { diff --git a/pkg/generate/azure/azure.go b/pkg/generate/azure/azure.go index 69390ea21..e0c7b1c3f 100644 --- a/pkg/generate/azure/azure.go +++ b/pkg/generate/azure/azure.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type AzureGenerator struct { diff --git a/pkg/generate/database/elasticsearch/elasticsearch.go b/pkg/generate/database/elasticsearch/elasticsearch.go index d00b910e4..318697718 100644 --- a/pkg/generate/database/elasticsearch/elasticsearch.go +++ b/pkg/generate/database/elasticsearch/elasticsearch.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type ElasticsearchGenerator struct { diff --git a/pkg/generate/database/mariadb/mariadb.go b/pkg/generate/database/mariadb/mariadb.go index 8da08d012..204ee6b52 100644 --- a/pkg/generate/database/mariadb/mariadb.go +++ b/pkg/generate/database/mariadb/mariadb.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type MariaDBGenerator struct { diff --git a/pkg/generate/database/mongodb/mongodb.go b/pkg/generate/database/mongodb/mongodb.go index deef25130..ddb463603 100644 --- a/pkg/generate/database/mongodb/mongodb.go +++ b/pkg/generate/database/mongodb/mongodb.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type MongoGenerator struct { diff --git a/pkg/generate/database/mysql/mysql.go b/pkg/generate/database/mysql/mysql.go index 14b56fa58..2f647f087 100644 --- a/pkg/generate/database/mysql/mysql.go +++ b/pkg/generate/database/mysql/mysql.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type MySQLGenerator struct { diff --git a/pkg/generate/database/postgres/postgres.go b/pkg/generate/database/postgres/postgres.go index a55439207..e67290d8a 100644 --- a/pkg/generate/database/postgres/postgres.go +++ b/pkg/generate/database/postgres/postgres.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type PostgresGenerator struct { diff --git a/pkg/generate/database/redis/redis.go b/pkg/generate/database/redis/redis.go index 96f413728..55bb00e61 100644 --- a/pkg/generate/database/redis/redis.go +++ b/pkg/generate/database/redis/redis.go @@ -40,11 +40,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type RedisGenerator struct { diff --git a/pkg/generate/gcp/gcp.go b/pkg/generate/gcp/gcp.go index e904d45ae..800f2fab1 100644 --- a/pkg/generate/gcp/gcp.go +++ b/pkg/generate/gcp/gcp.go @@ -42,11 +42,11 @@ var available = map[string]bool{ } type SecretObject struct { - ObjectName string `json:"objectName,omitempty"` - SecretPath string `json:"secretPath,omitempty"` - SecretKey string `json:"secretKey,omitempty"` - Method string `json:"method,omitempty"` - SecretArgs map[string]interface{} `json:"secretArgs,omitempty"` + ObjectName string `json:"objectName,omitempty"` + SecretPath string `json:"secretPath,omitempty"` + SecretKey string `json:"secretKey,omitempty"` + Method string `json:"method,omitempty"` + SecretArgs map[string]any `json:"secretArgs,omitempty"` } type GCPGenerator struct { diff --git a/pkg/token-keys-store/azure-key-vault/azure_key_vault.go b/pkg/token-keys-store/azure-key-vault/azure_key_vault.go index 0a6dacd24..57e0b77ae 100644 --- a/pkg/token-keys-store/azure-key-vault/azure_key_vault.go +++ b/pkg/token-keys-store/azure-key-vault/azure_key_vault.go @@ -121,13 +121,13 @@ func (ti *TokenKeyInfo) Get(key string) (string, error) { return "", errors.New("version id not found") } - resp, err := client.GetSecret(context.Background(), strings.Replace(key, ".", "-", -1), version[idx+1:], nil) + resp, err := client.GetSecret(context.Background(), strings.ReplaceAll(key, ".", "-"), version[idx+1:], nil) if err != nil { return "", err } - if *resp.SecretBundle.ContentType != ContentTypePassword { - return "", errors.Errorf("content type not matched with %v", *resp.SecretBundle.ContentType) + if *resp.ContentType != ContentTypePassword { + return "", errors.Errorf("content type not matched with %v", *resp.ContentType) } decoded, err := base64.StdEncoding.DecodeString(*resp.Value) @@ -139,7 +139,7 @@ func (ti *TokenKeyInfo) Get(key string) (string, error) { } func (ti *TokenKeyInfo) Delete(key string) error { - key = strings.Replace(key, ".", "-", -1) + key = strings.ReplaceAll(key, ".", "-") vaultBaseUrl := ti.vs.Spec.Unsealer.Mode.AzureKeyVault.VaultBaseURL client := azsecrets.NewClient(vaultBaseUrl, ti.cred, nil) @@ -161,7 +161,7 @@ func (ti *TokenKeyInfo) Delete(key string) error { } func (ti *TokenKeyInfo) Set(key, value string) error { - key = strings.Replace(key, ".", "-", -1) + key = strings.ReplaceAll(key, ".", "-") vaultBaseUrl := ti.vs.Spec.Unsealer.Mode.AzureKeyVault.VaultBaseURL client := azsecrets.NewClient(vaultBaseUrl, ti.cred, nil) @@ -178,7 +178,7 @@ func (ti *TokenKeyInfo) Set(key, value string) error { } func (ti *TokenKeyInfo) getLatestVersion(key string) (string, error) { - key = strings.Replace(key, ".", "-", -1) + key = strings.ReplaceAll(key, ".", "-") vaultBaseUrl := ti.vs.Spec.Unsealer.Mode.AzureKeyVault.VaultBaseURL client := azsecrets.NewClient(vaultBaseUrl, ti.cred, nil) @@ -190,7 +190,7 @@ func (ti *TokenKeyInfo) getLatestVersion(key string) (string, error) { if err != nil { return "", err } - for _, ver := range resp.SecretListResult.Value { + for _, ver := range resp.Value { cur := time.Since(*ver.Attributes.Created) if version == "" { version = *ver.ID diff --git a/pkg/token-keys-store/google-kms-gcs/google_kms_gcs.go b/pkg/token-keys-store/google-kms-gcs/google_kms_gcs.go index 67d5d5ffd..dba0a2b89 100644 --- a/pkg/token-keys-store/google-kms-gcs/google_kms_gcs.go +++ b/pkg/token-keys-store/google-kms-gcs/google_kms_gcs.go @@ -117,7 +117,7 @@ func (ti *TokenKeyInfo) Get(key string) (string, error) { if err != nil { return "", err } - defer rc.Close() + defer rc.Close() //nolint:errcheck body, err := io.ReadAll(rc) if err != nil { @@ -186,7 +186,7 @@ func decryptSymmetric(name string, ciphertext []byte) (string, error) { if err != nil { return "", errors.Errorf("failed to create kms client: %v", err) } - defer client.Close() + defer client.Close() //nolint:errcheck crc32c := func(data []byte) uint32 { t := crc32.MakeTable(crc32.Castagnoli) From 6799214b2bb037099b1829ad49148f97d3380a40 Mon Sep 17 00:00:00 2001 From: Rudro-25 Date: Mon, 8 Dec 2025 20:06:44 +0600 Subject: [PATCH 2/3] fix Signed-off-by: Rudro-25 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 364ec4fa0..bf3e4e161 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64 darwin/arm64 OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -GO_VERSION ?= 1.25.5 +GO_VERSION ?= 1.25 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(BIN)-$(OS)-$(ARCH) From f948ff4a1e85c2256cb068a8e60c0156f4ac0283 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 10 Dec 2025 14:10:55 +0600 Subject: [PATCH 3/3] Update deps Signed-off-by: Tamal Saha --- go.mod | 26 +- go.sum | 49 +- .../go-cmp/cmp/internal/function/func.go | 7 + .../github.com/google/go-cmp/cmp/options.go | 10 +- .../github.com/klauspost/compress/README.md | 140 +-- .../klauspost/compress/huff0/bitreader.go | 25 +- .../klauspost/compress/internal/le/le.go | 5 + .../compress/internal/le/unsafe_disabled.go | 42 + .../compress/internal/le/unsafe_enabled.go | 55 + vendor/github.com/klauspost/compress/s2sx.mod | 3 +- .../klauspost/compress/zstd/README.md | 2 +- .../klauspost/compress/zstd/bitreader.go | 37 +- .../klauspost/compress/zstd/blockdec.go | 19 - .../klauspost/compress/zstd/blockenc.go | 27 +- .../klauspost/compress/zstd/decoder.go | 3 +- .../klauspost/compress/zstd/enc_base.go | 2 +- .../compress/zstd/matchlen_generic.go | 11 +- .../klauspost/compress/zstd/seqdec.go | 2 +- .../klauspost/compress/zstd/seqdec_amd64.s | 64 +- .../klauspost/compress/zstd/seqdec_generic.go | 2 +- .../klauspost/compress/zstd/seqenc.go | 2 - .../klauspost/compress/zstd/snappy.go | 4 +- .../klauspost/compress/zstd/zstd.go | 7 +- vendor/github.com/spf13/cobra/README.md | 5 +- vendor/github.com/spf13/cobra/active_help.go | 2 +- .../spf13/cobra/bash_completionsV2.go | 152 ++- vendor/github.com/spf13/cobra/cobra.go | 16 +- vendor/github.com/spf13/cobra/command.go | 331 ++++-- vendor/github.com/spf13/cobra/completions.go | 126 +- .../spf13/cobra/powershell_completions.go | 35 +- vendor/k8s.io/api/resource/v1alpha3/types.go | 4 + vendor/k8s.io/api/resource/v1beta1/types.go | 4 + vendor/kmodules.xyz/client-go/.golangci.yml | 27 + vendor/kmodules.xyz/client-go/Makefile | 6 +- .../kmodules.xyz/client-go/api/v1/cluster.go | 116 +- .../client-go/api/v1/cluster_enum.go | 110 +- .../client-go/api/v1/clustermanager.go | 170 +++ .../client-go/api/v1/generated.pb.go | 1020 ++++++++++++++--- .../client-go/api/v1/generated.proto | 25 +- .../kmodules.xyz/client-go/api/v1/object.go | 4 +- .../client-go/api/v1/object_enum.go | 7 +- .../client-go/api/v1/timeofday.go | 8 +- .../client-go/cluster/host_detector.go | 4 +- vendor/kmodules.xyz/client-go/cluster/lib.go | 18 +- .../client-go/conditions/getter.go | 2 +- .../client-go/conditions/matcher.go | 14 +- .../client-go/conditions/matchers.go | 6 +- .../client-go/conditions/merge.go | 9 +- .../client-go/conditions/setter.go | 8 +- .../client-go/core/v1/kubernetes.go | 2 +- .../client-go/meta/annotations.go | 20 +- vendor/kmodules.xyz/client-go/meta/cmp.go | 8 +- .../kmodules.xyz/client-go/meta/dataformat.go | 9 +- .../kmodules.xyz/client-go/meta/encoding.go | 6 +- vendor/kmodules.xyz/client-go/meta/hash.go | 12 +- vendor/kmodules.xyz/client-go/meta/lib.go | 3 +- vendor/kmodules.xyz/client-go/meta/patch.go | 24 +- vendor/kmodules.xyz/client-go/meta/status.go | 10 +- .../catalog/v1alpha1/openapi_generated.go | 6 + .../v1alpha1/vaultserver_version_helpers.go | 2 +- .../apis/config/v1alpha1/openapi_generated.go | 6 + .../apis/engine/v1alpha1/aws_role_helpers.go | 2 +- .../engine/v1alpha1/azure_role_helpers.go | 2 +- .../engine/v1alpha1/elasticsearch_helpers.go | 2 +- .../apis/engine/v1alpha1/gcp_role_helpers.go | 2 +- .../apis/engine/v1alpha1/mariadb_helpers.go | 2 +- .../apis/engine/v1alpha1/mongo_helpers.go | 2 +- .../apis/engine/v1alpha1/mysql_helpers.go | 2 +- .../apis/engine/v1alpha1/openapi_generated.go | 6 + .../apis/engine/v1alpha1/pki_role_helpers.go | 2 +- .../apis/engine/v1alpha1/postgres_helpers.go | 2 +- .../apis/engine/v1alpha1/redis_helpers.go | 2 +- .../v1alpha1/secret_access_request_helpers.go | 2 +- .../engine/v1alpha1/secret_engine_helpers.go | 2 +- .../v1alpha1/secret_role_binding_helpers.go | 2 +- .../kubevault/v1alpha1/openapi_generated.go | 6 + .../kubevault/v1alpha1/vaultserver_helpers.go | 13 +- .../kubevault/v1alpha1/vaultserver_types.go | 2 +- .../kubevault/v1alpha2/openapi_generated.go | 6 + .../kubevault/v1alpha2/vaultserver_helpers.go | 10 +- .../kubevault/v1alpha2/vaultserver_types.go | 2 +- .../apis/ops/v1alpha1/openapi_generated.go | 6 + .../apis/ops/v1alpha1/vault_ops_helpers.go | 2 +- .../apis/policy/v1alpha1/openapi_generated.go | 6 + .../policy/v1alpha1/vaultpolicy_helpers.go | 2 +- .../v1alpha1/vaultpolicybinding_helpers.go | 58 +- vendor/kubevault.dev/apimachinery/crds/lib.go | 2 +- vendor/modules.txt | 35 +- 88 files changed, 2188 insertions(+), 875 deletions(-) create mode 100644 vendor/github.com/klauspost/compress/internal/le/le.go create mode 100644 vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go create mode 100644 vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go create mode 100644 vendor/kmodules.xyz/client-go/.golangci.yml create mode 100644 vendor/kmodules.xyz/client-go/api/v1/clustermanager.go diff --git a/go.mod b/go.mod index 591a5fae8..4d72a13eb 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/vault/api v1.13.0 github.com/hashicorp/vault/sdk v0.12.0 github.com/pkg/errors v0.9.1 - github.com/spf13/cobra v1.8.1 + github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 golang.org/x/text v0.31.0 gomodules.xyz/logs v0.0.7 @@ -22,14 +22,14 @@ require ( gomodules.xyz/x v0.0.17 google.golang.org/api v0.181.0 google.golang.org/protobuf v1.36.3 - k8s.io/apimachinery v0.32.2 + k8s.io/apimachinery v0.32.3 k8s.io/cli-runtime v0.32.2 - k8s.io/client-go v0.32.2 + k8s.io/client-go v0.32.3 k8s.io/klog/v2 v2.130.1 k8s.io/kubectl v0.30.2 - kmodules.xyz/client-go v0.32.4 + kmodules.xyz/client-go v0.32.11 kmodules.xyz/custom-resources v0.32.0 - kubevault.dev/apimachinery v0.23.0 + kubevault.dev/apimachinery v0.23.1-0.20251210060231-c3bdb5a16bf7 sigs.k8s.io/secrets-store-csi-driver v1.5.1 sigs.k8s.io/yaml v1.4.0 ) @@ -77,7 +77,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.6.9 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-containerregistry v0.20.3 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -101,7 +101,7 @@ require ( github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect @@ -165,15 +165,15 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.32.2 // indirect - k8s.io/apiextensions-apiserver v0.32.2 // indirect - k8s.io/apiserver v0.32.2 // indirect - k8s.io/component-base v0.32.2 // indirect - k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9 // indirect + k8s.io/api v0.32.3 // indirect + k8s.io/apiextensions-apiserver v0.32.3 // indirect + k8s.io/apiserver v0.32.3 // indirect + k8s.io/component-base v0.32.3 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect kmodules.xyz/apiversion v0.2.0 // indirect kmodules.xyz/monitoring-agent-api v0.32.0 // indirect - kmodules.xyz/offshoot-api v0.30.1 // indirect + kmodules.xyz/offshoot-api v0.32.0 // indirect sigs.k8s.io/controller-runtime v0.20.4 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kustomize/api v0.18.0 // indirect diff --git a/go.sum b/go.sum index d8a3456ea..91fa0ed30 100644 --- a/go.sum +++ b/go.sum @@ -82,7 +82,6 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -189,8 +188,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-containerregistry v0.20.3 h1:oNx7IdTI936V8CQRveCjaxOiegWwvM7kqkbXTpyiovI= github.com/google/go-containerregistry v0.20.3/go.mod h1:w00pIgBRDVUDFM6bq+Qx8lwNWK+cxgCuX1vd3PIBDNI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -292,8 +291,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kmodules/apiserver v0.32.3-0.20250221062720-35dc674c7dd6 h1:U6BBc6uBT3jTlmTBTyXaIfNnp1WzUaX6Xz7ReV8qcaw= @@ -430,8 +429,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -727,39 +726,39 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= -k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= -k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4= -k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA= -k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= -k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= +k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= +k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY= +k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss= +k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= +k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= k8s.io/cli-runtime v0.32.2 h1:aKQR4foh9qeyckKRkNXUccP9moxzffyndZAvr+IXMks= k8s.io/cli-runtime v0.32.2/go.mod h1:a/JpeMztz3xDa7GCyyShcwe55p8pbcCVQxvqZnIwXN8= -k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= -k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= -k8s.io/component-base v0.32.2 h1:1aUL5Vdmu7qNo4ZsE+569PV5zFatM9hl+lb3dEea2zU= -k8s.io/component-base v0.32.2/go.mod h1:PXJ61Vx9Lg+P5mS8TLd7bCIr+eMJRQTyXe8KvkrvJq0= +k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= +k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= +k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k= +k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9 h1:t0huyHnz6HsokckRxAF1bY0cqPFwzINKCL7yltEjZQc= -k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= k8s.io/kubectl v0.30.2 h1:cgKNIvsOiufgcs4yjvgkK0+aPCfa8pUwzXdJtkbhsH8= k8s.io/kubectl v0.30.2/go.mod h1:rz7GHXaxwnigrqob0lJsiA07Df8RE3n1TSaC2CTeuB4= k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= -kmodules.xyz/client-go v0.32.4 h1:eB5I18rLptkx0vsDcqIr62I23sX16K3BBs29RoOxrFk= -kmodules.xyz/client-go v0.32.4/go.mod h1:ZwLnc7UqEXUNSe43n/SnER6+7YAQCu38L2te6YefoHU= +kmodules.xyz/client-go v0.32.11 h1:AbvsutYyCfCGgreMOx5ghdZto0ltKfhS/6n98TkXTGc= +kmodules.xyz/client-go v0.32.11/go.mod h1:4k+da95l/Idg7k0+qc5qZCJJoAF6IQK5x0Fa+hBVD+Q= kmodules.xyz/custom-resources v0.32.0 h1:wzmJTtswO+OmvtqYc70pVoopZyt5UJHKTom4Jh6bfhM= kmodules.xyz/custom-resources v0.32.0/go.mod h1:aLFrfbUKS+AkKtxFYWpPGzuLNarRtGlkHwC07APHba8= kmodules.xyz/monitoring-agent-api v0.32.0 h1:cMQbWvbTc4JWeLI/zYE0HLefsdFYBzqvATLx16qCzxo= kmodules.xyz/monitoring-agent-api v0.32.0/go.mod h1:zgRKiJcuK7FOHy0Y1TsONRbJfgnPCs8t4Zh/6Afr+yU= -kmodules.xyz/offshoot-api v0.30.1 h1:TrulAYO+oBsXe9sZZGTmNWIuI8qD2izMpgcTSPvgAmI= -kmodules.xyz/offshoot-api v0.30.1/go.mod h1:T3mpjR6fui0QzOcmQvIuANytW48fe9ytmy/1cgx6D4g= -kubevault.dev/apimachinery v0.23.0 h1:/VuIJaehOBlRBmfutOTW8ok32P3HqysW8c0qKqGaI2I= -kubevault.dev/apimachinery v0.23.0/go.mod h1:6evipkCLIZMjcMU1GIOSTCYgoxw0jWCdyNtkWmr0jCc= +kmodules.xyz/offshoot-api v0.32.0 h1:gogc5scSZe2JoXtZof72UGRl3Tit0kFaFRMkLLT1D8o= +kmodules.xyz/offshoot-api v0.32.0/go.mod h1:tled7OxYZ3SkUJcrVFVVYyd+zXjsRSEm1R6Q3k4gcx0= +kubevault.dev/apimachinery v0.23.1-0.20251210060231-c3bdb5a16bf7 h1:HBImhwqV1/ohSPrmz7Xq0QMrpAfdW0UkNSzTtEaCnqc= +kubevault.dev/apimachinery v0.23.1-0.20251210060231-c3bdb5a16bf7/go.mod h1:S6x72MChaXBwSTkcB2XAMA5aKz22i0Y/7r3npHYVj7E= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= diff --git a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go index d127d4362..def01a6be 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go @@ -19,6 +19,7 @@ const ( tbFunc // func(T) bool ttbFunc // func(T, T) bool + ttiFunc // func(T, T) int trbFunc // func(T, R) bool tibFunc // func(T, I) bool trFunc // func(T) R @@ -28,11 +29,13 @@ const ( Transformer = trFunc // func(T) R ValueFilter = ttbFunc // func(T, T) bool Less = ttbFunc // func(T, T) bool + Compare = ttiFunc // func(T, T) int ValuePredicate = tbFunc // func(T) bool KeyValuePredicate = trbFunc // func(T, R) bool ) var boolType = reflect.TypeOf(true) +var intType = reflect.TypeOf(0) // IsType reports whether the reflect.Type is of the specified function type. func IsType(t reflect.Type, ft funcType) bool { @@ -49,6 +52,10 @@ func IsType(t reflect.Type, ft funcType) bool { if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == boolType { return true } + case ttiFunc: // func(T, T) int + if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == intType { + return true + } case trbFunc: // func(T, R) bool if ni == 2 && no == 1 && t.Out(0) == boolType { return true diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index 754496f3b..ba3fce81f 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -232,7 +232,15 @@ func (validator) apply(s *state, vx, vy reflect.Value) { if t := s.curPath.Index(-2).Type(); t.Name() != "" { // Named type with unexported fields. name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType - if _, ok := reflect.New(t).Interface().(error); ok { + isProtoMessage := func(t reflect.Type) bool { + m, ok := reflect.PointerTo(t).MethodByName("ProtoReflect") + return ok && m.Type.NumIn() == 1 && m.Type.NumOut() == 1 && + m.Type.Out(0).PkgPath() == "google.golang.org/protobuf/reflect/protoreflect" && + m.Type.Out(0).Name() == "Message" + } + if isProtoMessage(t) { + help = `consider using "google.golang.org/protobuf/testing/protocmp".Transform to compare proto.Message types` + } else if _, ok := reflect.New(t).Interface().(error); ok { help = "consider using cmpopts.EquateErrors to compare error values" } else if t.Comparable() { help = "consider using cmpopts.EquateComparable to compare comparable Go types" diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index de264c85a..244ee19c4 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -14,8 +14,34 @@ This package provides various compression algorithms. [![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml) [![Sourcegraph Badge](https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg)](https://sourcegraph.com/github.com/klauspost/compress?badge) +# package usage + +Use `go get github.com/klauspost/compress@latest` to add it to your project. + +This package will support the current Go version and 2 versions back. + +* Use the `nounsafe` tag to disable all use of the "unsafe" package. +* Use the `noasm` tag to disable all assembly across packages. + +Use the links above for more information on each. + # changelog +* Feb 19th, 2025 - [1.18.0](https://github.com/klauspost/compress/releases/tag/v1.18.0) + * Add unsafe little endian loaders https://github.com/klauspost/compress/pull/1036 + * fix: check `r.err != nil` but return a nil value error `err` by @alingse in https://github.com/klauspost/compress/pull/1028 + * flate: Simplify L4-6 loading https://github.com/klauspost/compress/pull/1043 + * flate: Simplify matchlen (remove asm) https://github.com/klauspost/compress/pull/1045 + * s2: Improve small block compression speed w/o asm https://github.com/klauspost/compress/pull/1048 + * flate: Fix matchlen L5+L6 https://github.com/klauspost/compress/pull/1049 + * flate: Cleanup & reduce casts https://github.com/klauspost/compress/pull/1050 + +* Oct 11th, 2024 - [1.17.11](https://github.com/klauspost/compress/releases/tag/v1.17.11) + * zstd: Fix extra CRC written with multiple Close calls https://github.com/klauspost/compress/pull/1017 + * s2: Don't use stack for index tables https://github.com/klauspost/compress/pull/1014 + * gzhttp: No content-type on no body response code by @juliens in https://github.com/klauspost/compress/pull/1011 + * gzhttp: Do not set the content-type when response has no body by @kevinpollet in https://github.com/klauspost/compress/pull/1013 + * Sep 23rd, 2024 - [1.17.10](https://github.com/klauspost/compress/releases/tag/v1.17.10) * gzhttp: Add TransportAlwaysDecompress option. https://github.com/klauspost/compress/pull/978 * gzhttp: Add supported decompress request body by @mirecl in https://github.com/klauspost/compress/pull/1002 @@ -65,9 +91,9 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 * Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1) - * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871 + * s2: Fix S2 "best" dictionary wrong encoding https://github.com/klauspost/compress/pull/871 * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869 - * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867 + * s2: Fix EstimateBlockSize on 6&7 length input https://github.com/klauspost/compress/pull/867 * Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0) * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853 @@ -124,7 +150,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp See changes to v1.15.x * Jan 21st, 2023 (v1.15.15) - * deflate: Improve level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/739 + * deflate: Improve level 7-9 https://github.com/klauspost/compress/pull/739 * zstd: Add delta encoding support by @greatroar in https://github.com/klauspost/compress/pull/728 * zstd: Various speed improvements by @greatroar https://github.com/klauspost/compress/pull/741 https://github.com/klauspost/compress/pull/734 https://github.com/klauspost/compress/pull/736 https://github.com/klauspost/compress/pull/744 https://github.com/klauspost/compress/pull/743 https://github.com/klauspost/compress/pull/745 * gzhttp: Add SuffixETag() and DropETag() options to prevent ETag collisions on compressed responses by @willbicks in https://github.com/klauspost/compress/pull/740 @@ -167,7 +193,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Fix decoder crash on amd64 (no BMI) on invalid input https://github.com/klauspost/compress/pull/645 * zstd: Disable decoder extended memory copies (amd64) due to possible crashes https://github.com/klauspost/compress/pull/644 - * zstd: Allow single segments up to "max decoded size" by @klauspost in https://github.com/klauspost/compress/pull/643 + * zstd: Allow single segments up to "max decoded size" https://github.com/klauspost/compress/pull/643 * July 13, 2022 (v1.15.8) @@ -209,7 +235,7 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599 * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593 * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586 - * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590 + * flate: Inplace hashing for level 7-9 https://github.com/klauspost/compress/pull/590 * May 11, 2022 (v1.15.4) @@ -236,12 +262,12 @@ https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/comp * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523) * Mar 3, 2022 (v1.15.0) - * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498) - * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505) + * zstd: Refactor decoder [#498](https://github.com/klauspost/compress/pull/498) + * zstd: Add stream encoding without goroutines [#505](https://github.com/klauspost/compress/pull/505) * huff0: Prevent single blocks exceeding 16 bits by @klauspost in[#507](https://github.com/klauspost/compress/pull/507) - * flate: Inline literal emission by @klauspost in [#509](https://github.com/klauspost/compress/pull/509) - * gzhttp: Add zstd to transport by @klauspost in [#400](https://github.com/klauspost/compress/pull/400) - * gzhttp: Make content-type optional by @klauspost in [#510](https://github.com/klauspost/compress/pull/510) + * flate: Inline literal emission [#509](https://github.com/klauspost/compress/pull/509) + * gzhttp: Add zstd to transport [#400](https://github.com/klauspost/compress/pull/400) + * gzhttp: Make content-type optional [#510](https://github.com/klauspost/compress/pull/510) Both compression and decompression now supports "synchronous" stream operations. This means that whenever "concurrency" is set to 1, they will operate without spawning goroutines. @@ -258,7 +284,7 @@ While the release has been extensively tested, it is recommended to testing when * flate: Fix rare huffman only (-2) corruption. [#503](https://github.com/klauspost/compress/pull/503) * zip: Update deprecated CreateHeaderRaw to correctly call CreateRaw by @saracen in [#502](https://github.com/klauspost/compress/pull/502) * zip: don't read data descriptor early by @saracen in [#501](https://github.com/klauspost/compress/pull/501) #501 - * huff0: Use static decompression buffer up to 30% faster by @klauspost in [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) + * huff0: Use static decompression buffer up to 30% faster [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) * Feb 17, 2022 (v1.14.3) * flate: Improve fastest levels compression speed ~10% more throughput. [#482](https://github.com/klauspost/compress/pull/482) [#489](https://github.com/klauspost/compress/pull/489) [#490](https://github.com/klauspost/compress/pull/490) [#491](https://github.com/klauspost/compress/pull/491) [#494](https://github.com/klauspost/compress/pull/494) [#478](https://github.com/klauspost/compress/pull/478) @@ -565,12 +591,14 @@ While the release has been extensively tested, it is recommended to testing when The packages are drop-in replacements for standard libraries. Simply replace the import path to use them: -| old import | new import | Documentation -|--------------------|-----------------------------------------|--------------------| -| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) -| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) -| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) -| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) +Typical speed is about 2x of the standard library packages. + +| old import | new import | Documentation | +|------------------|---------------------------------------|-------------------------------------------------------------------------| +| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) | +| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) | +| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) | +| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) | * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). @@ -625,84 +653,6 @@ This will only use up to 4KB in memory when the writer is idle. Compression is almost always worse than the fastest compression level and each write will allocate (a little) memory. -# Performance Update 2018 - -It has been a while since we have been looking at the speed of this package compared to the standard library, so I thought I would re-do my tests and give some overall recommendations based on the current state. All benchmarks have been performed with Go 1.10 on my Desktop Intel(R) Core(TM) i7-2600 CPU @3.40GHz. Since I last ran the tests, I have gotten more RAM, which means tests with big files are no longer limited by my SSD. - -The raw results are in my [updated spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). Due to cgo changes and upstream updates i could not get the cgo version of gzip to compile. Instead I included the [zstd](https://github.com/datadog/zstd) cgo implementation. If I get cgo gzip to work again, I might replace the results in the sheet. - -The columns to take note of are: *MB/s* - the throughput. *Reduction* - the data size reduction in percent of the original. *Rel Speed* relative speed compared to the standard library at the same level. *Smaller* - how many percent smaller is the compressed output compared to stdlib. Negative means the output was bigger. *Loss* means the loss (or gain) in compression as a percentage difference of the input. - -The `gzstd` (standard library gzip) and `gzkp` (this package gzip) only uses one CPU core. [`pgzip`](https://github.com/klauspost/pgzip), [`bgzf`](https://github.com/biogo/hts/tree/master/bgzf) uses all 4 cores. [`zstd`](https://github.com/DataDog/zstd) uses one core, and is a beast (but not Go, yet). - - -## Overall differences. - -There appears to be a roughly 5-10% speed advantage over the standard library when comparing at similar compression levels. - -The biggest difference you will see is the result of [re-balancing](https://blog.klauspost.com/rebalancing-deflate-compression-levels/) the compression levels. I wanted by library to give a smoother transition between the compression levels than the standard library. - -This package attempts to provide a more smooth transition, where "1" is taking a lot of shortcuts, "5" is the reasonable trade-off and "9" is the "give me the best compression", and the values in between gives something reasonable in between. The standard library has big differences in levels 1-4, but levels 5-9 having no significant gains - often spending a lot more time than can be justified by the achieved compression. - -There are links to all the test data in the [spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) in the top left field on each tab. - -## Web Content - -This test set aims to emulate typical use in a web server. The test-set is 4GB data in 53k files, and is a mixture of (mostly) HTML, JS, CSS. - -Since level 1 and 9 are close to being the same code, they are quite close. But looking at the levels in-between the differences are quite big. - -Looking at level 6, this package is 88% faster, but will output about 6% more data. For a web server, this means you can serve 88% more data, but have to pay for 6% more bandwidth. You can draw your own conclusions on what would be the most expensive for your case. - -## Object files - -This test is for typical data files stored on a server. In this case it is a collection of Go precompiled objects. They are very compressible. - -The picture is similar to the web content, but with small differences since this is very compressible. Levels 2-3 offer good speed, but is sacrificing quite a bit of compression. - -The standard library seems suboptimal on level 3 and 4 - offering both worse compression and speed than level 6 & 7 of this package respectively. - -## Highly Compressible File - -This is a JSON file with very high redundancy. The reduction starts at 95% on level 1, so in real life terms we are dealing with something like a highly redundant stream of data, etc. - -It is definitely visible that we are dealing with specialized content here, so the results are very scattered. This package does not do very well at levels 1-4, but picks up significantly at level 5 and levels 7 and 8 offering great speed for the achieved compression. - -So if you know you content is extremely compressible you might want to go slightly higher than the defaults. The standard library has a huge gap between levels 3 and 4 in terms of speed (2.75x slowdown), so it offers little "middle ground". - -## Medium-High Compressible - -This is a pretty common test corpus: [enwik9](http://mattmahoney.net/dc/textdata.html). It contains the first 10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. This is a very good test of typical text based compression and more data heavy streams. - -We see a similar picture here as in "Web Content". On equal levels some compression is sacrificed for more speed. Level 5 seems to be the best trade-off between speed and size, beating stdlib level 3 in both. - -## Medium Compressible - -I will combine two test sets, one [10GB file set](http://mattmahoney.net/dc/10gb.html) and a VM disk image (~8GB). Both contain different data types and represent a typical backup scenario. - -The most notable thing is how quickly the standard library drops to very low compression speeds around level 5-6 without any big gains in compression. Since this type of data is fairly common, this does not seem like good behavior. - - -## Un-compressible Content - -This is mainly a test of how good the algorithms are at detecting un-compressible input. The standard library only offers this feature with very conservative settings at level 1. Obviously there is no reason for the algorithms to try to compress input that cannot be compressed. The only downside is that it might skip some compressible data on false detections. - - -## Huffman only compression - -This compression library adds a special compression level, named `HuffmanOnly`, which allows near linear time compression. This is done by completely disabling matching of previous data, and only reduce the number of bits to represent each character. - -This means that often used characters, like 'e' and ' ' (space) in text use the fewest bits to represent, and rare characters like 'ยค' takes more bits to represent. For more information see [wikipedia](https://en.wikipedia.org/wiki/Huffman_coding) or this nice [video](https://youtu.be/ZdooBTdW5bM). - -Since this type of compression has much less variance, the compression speed is mostly unaffected by the input data, and is usually more than *180MB/s* for a single core. - -The downside is that the compression ratio is usually considerably worse than even the fastest conventional compression. The compression ratio can never be better than 8:1 (12.5%). - -The linear time compression can be used as a "better than nothing" mode, where you cannot risk the encoder to slow down on some content. For comparison, the size of the "Twain" text is *233460 bytes* (+29% vs. level 1) and encode speed is 144MB/s (4.5x level 1). So in this case you trade a 30% size increase for a 4 times speedup. - -For more information see my blog post on [Fast Linear Time Compression](http://blog.klauspost.com/constant-time-gzipzip-compression/). - -This is implemented on Go 1.7 as "Huffman Only" mode, though not exposed for gzip. # Other packages diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index e36d9742f..bfc7a523d 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -6,10 +6,11 @@ package huff0 import ( - "encoding/binary" "errors" "fmt" "io" + + "github.com/klauspost/compress/internal/le" ) // bitReader reads a bitstream in reverse. @@ -46,7 +47,7 @@ func (b *bitReaderBytes) init(in []byte) error { return nil } -// peekBitsFast requires that at least one bit is requested every time. +// peekByteFast requires that at least one byte is requested every time. // There are no checks if the buffer is filled. func (b *bitReaderBytes) peekByteFast() uint8 { got := uint8(b.value >> 56) @@ -66,8 +67,7 @@ func (b *bitReaderBytes) fillFast() { } // 2 bounds checks. - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << (b.bitsRead - 32) b.bitsRead -= 32 b.off -= 4 @@ -76,7 +76,7 @@ func (b *bitReaderBytes) fillFast() { // fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. func (b *bitReaderBytes) fillFastStart() { // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.value = le.Load64(b.in, b.off-8) b.bitsRead = 0 b.off -= 8 } @@ -86,9 +86,8 @@ func (b *bitReaderBytes) fill() { if b.bitsRead < 32 { return } - if b.off > 4 { - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + if b.off >= 4 { + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << (b.bitsRead - 32) b.bitsRead -= 32 b.off -= 4 @@ -175,9 +174,7 @@ func (b *bitReaderShifted) fillFast() { return } - // 2 bounds checks. - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << ((b.bitsRead - 32) & 63) b.bitsRead -= 32 b.off -= 4 @@ -185,8 +182,7 @@ func (b *bitReaderShifted) fillFast() { // fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. func (b *bitReaderShifted) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.value = le.Load64(b.in, b.off-8) b.bitsRead = 0 b.off -= 8 } @@ -197,8 +193,7 @@ func (b *bitReaderShifted) fill() { return } if b.off > 4 { - v := b.in[b.off-4 : b.off] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + low := le.Load32(b.in, b.off-4) b.value |= uint64(low) << ((b.bitsRead - 32) & 63) b.bitsRead -= 32 b.off -= 4 diff --git a/vendor/github.com/klauspost/compress/internal/le/le.go b/vendor/github.com/klauspost/compress/internal/le/le.go new file mode 100644 index 000000000..e54909e16 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/le.go @@ -0,0 +1,5 @@ +package le + +type Indexer interface { + int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 +} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go new file mode 100644 index 000000000..0cfb5c0e2 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go @@ -0,0 +1,42 @@ +//go:build !(amd64 || arm64 || ppc64le || riscv64) || nounsafe || purego || appengine + +package le + +import ( + "encoding/binary" +) + +// Load8 will load from b at index i. +func Load8[I Indexer](b []byte, i I) byte { + return b[i] +} + +// Load16 will load from b at index i. +func Load16[I Indexer](b []byte, i I) uint16 { + return binary.LittleEndian.Uint16(b[i:]) +} + +// Load32 will load from b at index i. +func Load32[I Indexer](b []byte, i I) uint32 { + return binary.LittleEndian.Uint32(b[i:]) +} + +// Load64 will load from b at index i. +func Load64[I Indexer](b []byte, i I) uint64 { + return binary.LittleEndian.Uint64(b[i:]) +} + +// Store16 will store v at b. +func Store16(b []byte, v uint16) { + binary.LittleEndian.PutUint16(b, v) +} + +// Store32 will store v at b. +func Store32(b []byte, v uint32) { + binary.LittleEndian.PutUint32(b, v) +} + +// Store64 will store v at b. +func Store64(b []byte, v uint64) { + binary.LittleEndian.PutUint64(b, v) +} diff --git a/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go new file mode 100644 index 000000000..ada45cd90 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go @@ -0,0 +1,55 @@ +// We enable 64 bit LE platforms: + +//go:build (amd64 || arm64 || ppc64le || riscv64) && !nounsafe && !purego && !appengine + +package le + +import ( + "unsafe" +) + +// Load8 will load from b at index i. +func Load8[I Indexer](b []byte, i I) byte { + //return binary.LittleEndian.Uint16(b[i:]) + //return *(*uint16)(unsafe.Pointer(&b[i])) + return *(*byte)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load16 will load from b at index i. +func Load16[I Indexer](b []byte, i I) uint16 { + //return binary.LittleEndian.Uint16(b[i:]) + //return *(*uint16)(unsafe.Pointer(&b[i])) + return *(*uint16)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load32 will load from b at index i. +func Load32[I Indexer](b []byte, i I) uint32 { + //return binary.LittleEndian.Uint32(b[i:]) + //return *(*uint32)(unsafe.Pointer(&b[i])) + return *(*uint32)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Load64 will load from b at index i. +func Load64[I Indexer](b []byte, i I) uint64 { + //return binary.LittleEndian.Uint64(b[i:]) + //return *(*uint64)(unsafe.Pointer(&b[i])) + return *(*uint64)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i)) +} + +// Store16 will store v at b. +func Store16(b []byte, v uint16) { + //binary.LittleEndian.PutUint16(b, v) + *(*uint16)(unsafe.Pointer(unsafe.SliceData(b))) = v +} + +// Store32 will store v at b. +func Store32(b []byte, v uint32) { + //binary.LittleEndian.PutUint32(b, v) + *(*uint32)(unsafe.Pointer(unsafe.SliceData(b))) = v +} + +// Store64 will store v at b. +func Store64(b []byte, v uint64) { + //binary.LittleEndian.PutUint64(b, v) + *(*uint64)(unsafe.Pointer(unsafe.SliceData(b))) = v +} diff --git a/vendor/github.com/klauspost/compress/s2sx.mod b/vendor/github.com/klauspost/compress/s2sx.mod index 5a4412f90..81bda5e29 100644 --- a/vendor/github.com/klauspost/compress/s2sx.mod +++ b/vendor/github.com/klauspost/compress/s2sx.mod @@ -1,4 +1,3 @@ module github.com/klauspost/compress -go 1.19 - +go 1.22 diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index 92e2347bb..c11d7fa28 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -6,7 +6,7 @@ A high performance compression algorithm is implemented. For now focused on spee This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. -This package is pure Go and without use of "unsafe". +This package is pure Go. Use `noasm` and `nounsafe` to disable relevant features. The `zstd` package is provided as open source software using a Go standard license. diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go index 25ca98394..d41e3e170 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitreader.go +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -5,11 +5,12 @@ package zstd import ( - "encoding/binary" "errors" "fmt" "io" "math/bits" + + "github.com/klauspost/compress/internal/le" ) // bitReader reads a bitstream in reverse. @@ -18,6 +19,7 @@ import ( type bitReader struct { in []byte value uint64 // Maybe use [16]byte, but shifting is awkward. + cursor int // offset where next read should end bitsRead uint8 } @@ -32,6 +34,7 @@ func (b *bitReader) init(in []byte) error { if v == 0 { return errors.New("corrupt stream, did not find end of stream") } + b.cursor = len(in) b.bitsRead = 64 b.value = 0 if len(in) >= 8 { @@ -67,18 +70,15 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - v := b.in[len(b.in)-4:] - b.in = b.in[:len(b.in)-4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value = (b.value << 32) | uint64(low) + b.cursor -= 4 + b.value = (b.value << 32) | uint64(le.Load32(b.in, b.cursor)) b.bitsRead -= 32 } // fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. func (b *bitReader) fillFastStart() { - v := b.in[len(b.in)-8:] - b.in = b.in[:len(b.in)-8] - b.value = binary.LittleEndian.Uint64(v) + b.cursor -= 8 + b.value = le.Load64(b.in, b.cursor) b.bitsRead = 0 } @@ -87,25 +87,23 @@ func (b *bitReader) fill() { if b.bitsRead < 32 { return } - if len(b.in) >= 4 { - v := b.in[len(b.in)-4:] - b.in = b.in[:len(b.in)-4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value = (b.value << 32) | uint64(low) + if b.cursor >= 4 { + b.cursor -= 4 + b.value = (b.value << 32) | uint64(le.Load32(b.in, b.cursor)) b.bitsRead -= 32 return } - b.bitsRead -= uint8(8 * len(b.in)) - for len(b.in) > 0 { - b.value = (b.value << 8) | uint64(b.in[len(b.in)-1]) - b.in = b.in[:len(b.in)-1] + b.bitsRead -= uint8(8 * b.cursor) + for b.cursor > 0 { + b.cursor -= 1 + b.value = (b.value << 8) | uint64(b.in[b.cursor]) } } // finished returns true if all bits have been read from the bit stream. func (b *bitReader) finished() bool { - return len(b.in) == 0 && b.bitsRead >= 64 + return b.cursor == 0 && b.bitsRead >= 64 } // overread returns true if more bits have been requested than is on the stream. @@ -115,13 +113,14 @@ func (b *bitReader) overread() bool { // remain returns the number of bits remaining. func (b *bitReader) remain() uint { - return 8*uint(len(b.in)) + 64 - uint(b.bitsRead) + return 8*uint(b.cursor) + 64 - uint(b.bitsRead) } // close the bitstream and returns an error if out-of-buffer reads occurred. func (b *bitReader) close() error { // Release reference. b.in = nil + b.cursor = 0 if !b.finished() { return fmt.Errorf("%d extra bits on block, should be 0", b.remain()) } diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 9c28840c3..0dd742fd2 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -5,14 +5,10 @@ package zstd import ( - "bytes" - "encoding/binary" "errors" "fmt" "hash/crc32" "io" - "os" - "path/filepath" "sync" "github.com/klauspost/compress/huff0" @@ -648,21 +644,6 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { println("initializing sequences:", err) return err } - // Extract blocks... - if false && hist.dict == nil { - fatalErr := func(err error) { - if err != nil { - panic(err) - } - } - fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize) - var buf bytes.Buffer - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse)) - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse)) - fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse)) - buf.Write(in) - os.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm) - } return nil } diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index 32a7f401d..fd35ea148 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -9,6 +9,7 @@ import ( "fmt" "math" "math/bits" + "slices" "github.com/klauspost/compress/huff0" ) @@ -457,16 +458,7 @@ func fuzzFseEncoder(data []byte) int { // All 0 return 0 } - maxCount := func(a []uint32) int { - var max uint32 - for _, v := range a { - if v > max { - max = v - } - } - return int(max) - } - cnt := maxCount(hist[:maxSym]) + cnt := int(slices.Max(hist[:maxSym])) if cnt == len(data) { // RLE return 0 @@ -884,15 +876,6 @@ func (b *blockEnc) genCodes() { } } } - maxCount := func(a []uint32) int { - var max uint32 - for _, v := range a { - if v > max { - max = v - } - } - return int(max) - } if debugAsserts && mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) } @@ -903,7 +886,7 @@ func (b *blockEnc) genCodes() { panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) } - b.coders.mlEnc.HistogramFinished(mlMax, maxCount(mlH[:mlMax+1])) - b.coders.ofEnc.HistogramFinished(ofMax, maxCount(ofH[:ofMax+1])) - b.coders.llEnc.HistogramFinished(llMax, maxCount(llH[:llMax+1])) + b.coders.mlEnc.HistogramFinished(mlMax, int(slices.Max(mlH[:mlMax+1]))) + b.coders.ofEnc.HistogramFinished(ofMax, int(slices.Max(ofH[:ofMax+1]))) + b.coders.llEnc.HistogramFinished(llMax, int(slices.Max(llH[:llMax+1]))) } diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index bbca17234..ea2a19376 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -123,7 +123,7 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { } // Read bytes from the decompressed stream into p. -// Returns the number of bytes written and any error that occurred. +// Returns the number of bytes read and any error that occurred. // When the stream is done, io.EOF will be returned. func (d *Decoder) Read(p []byte) (int, error) { var n int @@ -323,6 +323,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { frame.bBuf = nil if frame.history.decoders.br != nil { frame.history.decoders.br.in = nil + frame.history.decoders.br.cursor = 0 } d.decoders <- block }() diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index 5ca46038a..7d250c67f 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -116,7 +116,7 @@ func (e *fastBase) matchlen(s, t int32, src []byte) int32 { panic(err) } if t < 0 { - err := fmt.Sprintf("s (%d) < 0", s) + err := fmt.Sprintf("t (%d) < 0", t) panic(err) } if s-t > e.maxMatchOff { diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go index 57b9c31c0..bea1779e9 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -7,20 +7,25 @@ package zstd import ( - "encoding/binary" "math/bits" + + "github.com/klauspost/compress/internal/le" ) // matchLen returns the maximum common prefix length of a and b. // a must be the shortest of the two. func matchLen(a, b []byte) (n int) { - for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { - diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) + left := len(a) + for left >= 8 { + diff := le.Load64(a, n) ^ le.Load64(b, n) if diff != 0 { return n + bits.TrailingZeros64(diff)>>3 } n += 8 + left -= 8 } + a = a[n:] + b = b[n:] for i := range a { if a[i] != b[i] { diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index d7fe6d82d..9a7de82f9 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -245,7 +245,7 @@ func (s *sequenceDecs) decodeSync(hist []byte) error { return io.ErrUnexpectedEOF } var ll, mo, ml int - if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + if br.cursor > 4+((maxOffsetBits+16+16)>>3) { // inlined function: // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s index f5591fa1e..a708ca6d3 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -7,9 +7,9 @@ TEXT ยทsequenceDecs_decode_amd64(SB), $8-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -299,8 +299,8 @@ sequenceDecs_decode_amd64_match_len_ofs_ok: MOVQ R13, 160(AX) MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -335,9 +335,9 @@ error_overread: TEXT ยทsequenceDecs_decode_56_amd64(SB), $8-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -598,8 +598,8 @@ sequenceDecs_decode_56_amd64_match_len_ofs_ok: MOVQ R13, 160(AX) MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -634,9 +634,9 @@ error_overread: TEXT ยทsequenceDecs_decode_bmi2(SB), $8-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -884,8 +884,8 @@ sequenceDecs_decode_bmi2_match_len_ofs_ok: MOVQ R12, 160(CX) MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -920,9 +920,9 @@ error_overread: TEXT ยทsequenceDecs_decode_56_bmi2(SB), $8-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -1141,8 +1141,8 @@ sequenceDecs_decode_56_bmi2_match_len_ofs_ok: MOVQ R12, 160(CX) MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Return success MOVQ $0x00000000, ret+24(FP) @@ -1787,9 +1787,9 @@ empty_seqs: TEXT ยทsequenceDecs_decodeSync_amd64(SB), $64-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -2281,8 +2281,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Update the context MOVQ ctx+16(FP), AX @@ -2349,9 +2349,9 @@ error_not_enough_space: TEXT ยทsequenceDecs_decodeSync_bmi2(SB), $64-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -2801,8 +2801,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Update the context MOVQ ctx+16(FP), AX @@ -2869,9 +2869,9 @@ error_not_enough_space: TEXT ยทsequenceDecs_decodeSync_safe_amd64(SB), $64-32 MOVQ br+8(FP), CX MOVQ 24(CX), DX - MOVBQZX 32(CX), BX + MOVBQZX 40(CX), BX MOVQ (CX), AX - MOVQ 8(CX), SI + MOVQ 32(CX), SI ADDQ SI, AX MOVQ AX, (SP) MOVQ ctx+16(FP), AX @@ -3465,8 +3465,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), AX MOVQ DX, 24(AX) - MOVB BL, 32(AX) - MOVQ SI, 8(AX) + MOVB BL, 40(AX) + MOVQ SI, 32(AX) // Update the context MOVQ ctx+16(FP), AX @@ -3533,9 +3533,9 @@ error_not_enough_space: TEXT ยทsequenceDecs_decodeSync_safe_bmi2(SB), $64-32 MOVQ br+8(FP), BX MOVQ 24(BX), AX - MOVBQZX 32(BX), DX + MOVBQZX 40(BX), DX MOVQ (BX), CX - MOVQ 8(BX), BX + MOVQ 32(BX), BX ADDQ BX, CX MOVQ CX, (SP) MOVQ ctx+16(FP), CX @@ -4087,8 +4087,8 @@ handle_loop: loop_finished: MOVQ br+8(FP), CX MOVQ AX, 24(CX) - MOVB DL, 32(CX) - MOVQ BX, 8(CX) + MOVB DL, 40(CX) + MOVQ BX, 32(CX) // Update the context MOVQ ctx+16(FP), AX diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go index 2fb35b788..7cec2197c 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -29,7 +29,7 @@ func (s *sequenceDecs) decode(seqs []seqVals) error { } for i := range seqs { var ll, mo, ml int - if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + if br.cursor > 4+((maxOffsetBits+16+16)>>3) { // inlined function: // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) diff --git a/vendor/github.com/klauspost/compress/zstd/seqenc.go b/vendor/github.com/klauspost/compress/zstd/seqenc.go index 8014174a7..65045eabd 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqenc.go +++ b/vendor/github.com/klauspost/compress/zstd/seqenc.go @@ -69,7 +69,6 @@ var llBitsTable = [maxLLCode + 1]byte{ func llCode(litLength uint32) uint8 { const llDeltaCode = 19 if litLength <= 63 { - // Compiler insists on bounds check (Go 1.12) return llCodeTable[litLength&63] } return uint8(highBit(litLength)) + llDeltaCode @@ -102,7 +101,6 @@ var mlBitsTable = [maxMLCode + 1]byte{ func mlCode(mlBase uint32) uint8 { const mlDeltaCode = 36 if mlBase <= 127 { - // Compiler insists on bounds check (Go 1.12) return mlCodeTable[mlBase&127] } return uint8(highBit(mlBase)) + mlDeltaCode diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index ec13594e8..a17381b8f 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -197,7 +197,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { n, r.err = w.Write(r.block.output) if r.err != nil { - return written, err + return written, r.err } written += int64(n) continue @@ -239,7 +239,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { } n, r.err = w.Write(r.block.output) if r.err != nil { - return written, err + return written, r.err } written += int64(n) continue diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 066bef2a4..6252b46ae 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -5,10 +5,11 @@ package zstd import ( "bytes" - "encoding/binary" "errors" "log" "math" + + "github.com/klauspost/compress/internal/le" ) // enable debug printing @@ -110,11 +111,11 @@ func printf(format string, a ...interface{}) { } func load3232(b []byte, i int32) uint32 { - return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:]) + return le.Load32(b, i) } func load6432(b []byte, i int32) uint64 { - return binary.LittleEndian.Uint64(b[:len(b):len(b)][i:]) + return le.Load64(b, i) } type byter interface { diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index 6444f4b7f..71757151c 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -1,4 +1,5 @@ -![cobra logo](assets/CobraMain.png) + +![cobra logo](https://github.com/user-attachments/assets/cbc3adf8-0dff-46e9-a88d-5e2d971c169e) Cobra is a library for creating powerful modern CLI applications. @@ -105,7 +106,7 @@ go install github.com/spf13/cobra-cli@latest For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md) -For complete details on using the Cobra library, please read the [The Cobra User Guide](site/content/user_guide.md). +For complete details on using the Cobra library, please read [The Cobra User Guide](site/content/user_guide.md). # License diff --git a/vendor/github.com/spf13/cobra/active_help.go b/vendor/github.com/spf13/cobra/active_help.go index 25c30e3cc..b3e2dadfe 100644 --- a/vendor/github.com/spf13/cobra/active_help.go +++ b/vendor/github.com/spf13/cobra/active_help.go @@ -35,7 +35,7 @@ const ( // This function can be called multiple times before and/or after completions are added to // the array. Each time this function is called with the same array, the new // ActiveHelp line will be shown below the previous ones when completion is triggered. -func AppendActiveHelp(compArray []string, activeHelpStr string) []string { +func AppendActiveHelp(compArray []Completion, activeHelpStr string) []Completion { return append(compArray, fmt.Sprintf("%s%s", activeHelpMarker, activeHelpStr)) } diff --git a/vendor/github.com/spf13/cobra/bash_completionsV2.go b/vendor/github.com/spf13/cobra/bash_completionsV2.go index 1cce5c329..d2397aa36 100644 --- a/vendor/github.com/spf13/cobra/bash_completionsV2.go +++ b/vendor/github.com/spf13/cobra/bash_completionsV2.go @@ -146,7 +146,7 @@ __%[1]s_process_completion_results() { if (((directive & shellCompDirectiveFilterFileExt) != 0)); then # File extension filtering - local fullFilter filter filteringCmd + local fullFilter="" filter filteringCmd # Do not use quotes around the $completions variable or else newline # characters will be kept. @@ -177,20 +177,71 @@ __%[1]s_process_completion_results() { __%[1]s_handle_special_char "$cur" = # Print the activeHelp statements before we finish + __%[1]s_handle_activeHelp +} + +__%[1]s_handle_activeHelp() { + # Print the activeHelp statements if ((${#activeHelp[*]} != 0)); then - printf "\n"; - printf "%%s\n" "${activeHelp[@]}" - printf "\n" - - # The prompt format is only available from bash 4.4. - # We test if it is available before using it. - if (x=${PS1@P}) 2> /dev/null; then - printf "%%s" "${PS1@P}${COMP_LINE[@]}" - else - # Can't print the prompt. Just print the - # text the user had typed, it is workable enough. - printf "%%s" "${COMP_LINE[@]}" + if [ -z $COMP_TYPE ]; then + # Bash v3 does not set the COMP_TYPE variable. + printf "\n"; + printf "%%s\n" "${activeHelp[@]}" + printf "\n" + __%[1]s_reprint_commandLine + return fi + + # Only print ActiveHelp on the second TAB press + if [ $COMP_TYPE -eq 63 ]; then + printf "\n" + printf "%%s\n" "${activeHelp[@]}" + + if ((${#COMPREPLY[*]} == 0)); then + # When there are no completion choices from the program, file completion + # may kick in if the program has not disabled it; in such a case, we want + # to know if any files will match what the user typed, so that we know if + # there will be completions presented, so that we know how to handle ActiveHelp. + # To find out, we actually trigger the file completion ourselves; + # the call to _filedir will fill COMPREPLY if files match. + if (((directive & shellCompDirectiveNoFileComp) == 0)); then + __%[1]s_debug "Listing files" + _filedir + fi + fi + + if ((${#COMPREPLY[*]} != 0)); then + # If there are completion choices to be shown, print a delimiter. + # Re-printing the command-line will automatically be done + # by the shell when it prints the completion choices. + printf -- "--" + else + # When there are no completion choices at all, we need + # to re-print the command-line since the shell will + # not be doing it itself. + __%[1]s_reprint_commandLine + fi + elif [ $COMP_TYPE -eq 37 ] || [ $COMP_TYPE -eq 42 ]; then + # For completion type: menu-complete/menu-complete-backward and insert-completions + # the completions are immediately inserted into the command-line, so we first + # print the activeHelp message and reprint the command-line since the shell won't. + printf "\n" + printf "%%s\n" "${activeHelp[@]}" + + __%[1]s_reprint_commandLine + fi + fi +} + +__%[1]s_reprint_commandLine() { + # The prompt format is only available from bash 4.4. + # We test if it is available before using it. + if (x=${PS1@P}) 2> /dev/null; then + printf "%%s" "${PS1@P}${COMP_LINE[@]}" + else + # Can't print the prompt. Just print the + # text the user had typed, it is workable enough. + printf "%%s" "${COMP_LINE[@]}" fi } @@ -201,6 +252,8 @@ __%[1]s_extract_activeHelp() { local endIndex=${#activeHelpMarker} while IFS='' read -r comp; do + [[ -z $comp ]] && continue + if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then comp=${comp:endIndex} __%[1]s_debug "ActiveHelp found: $comp" @@ -223,16 +276,21 @@ __%[1]s_handle_completion_types() { # If the user requested inserting one completion at a time, or all # completions at once on the command-line we must remove the descriptions. # https://github.com/spf13/cobra/issues/1508 - local tab=$'\t' comp - while IFS='' read -r comp; do - [[ -z $comp ]] && continue - # Strip any description - comp=${comp%%%%$tab*} - # Only consider the completions that match - if [[ $comp == "$cur"* ]]; then - COMPREPLY+=("$comp") - fi - done < <(printf "%%s\n" "${completions[@]}") + + # If there are no completions, we don't need to do anything + (( ${#completions[@]} == 0 )) && return 0 + + local tab=$'\t' + + # Strip any description and escape the completion to handled special characters + IFS=$'\n' read -ra completions -d '' < <(printf "%%q\n" "${completions[@]%%%%$tab*}") + + # Only consider the completions that match + IFS=$'\n' read -ra COMPREPLY -d '' < <(IFS=$'\n'; compgen -W "${completions[*]}" -- "${cur}") + + # compgen looses the escaping so we need to escape all completions again since they will + # all be inserted on the command-line. + IFS=$'\n' read -ra COMPREPLY -d '' < <(printf "%%q\n" "${COMPREPLY[@]}") ;; *) @@ -243,11 +301,25 @@ __%[1]s_handle_completion_types() { } __%[1]s_handle_standard_completion_case() { - local tab=$'\t' comp + local tab=$'\t' + + # If there are no completions, we don't need to do anything + (( ${#completions[@]} == 0 )) && return 0 # Short circuit to optimize if we don't have descriptions if [[ "${completions[*]}" != *$tab* ]]; then - IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur") + # First, escape the completions to handle special characters + IFS=$'\n' read -ra completions -d '' < <(printf "%%q\n" "${completions[@]}") + # Only consider the completions that match what the user typed + IFS=$'\n' read -ra COMPREPLY -d '' < <(IFS=$'\n'; compgen -W "${completions[*]}" -- "${cur}") + + # compgen looses the escaping so, if there is only a single completion, we need to + # escape it again because it will be inserted on the command-line. If there are multiple + # completions, we don't want to escape them because they will be printed in a list + # and we don't want to show escape characters in that list. + if (( ${#COMPREPLY[@]} == 1 )); then + COMPREPLY[0]=$(printf "%%q" "${COMPREPLY[0]}") + fi return 0 fi @@ -256,23 +328,39 @@ __%[1]s_handle_standard_completion_case() { # Look for the longest completion so that we can format things nicely while IFS='' read -r compline; do [[ -z $compline ]] && continue - # Strip any description before checking the length - comp=${compline%%%%$tab*} + + # Before checking if the completion matches what the user typed, + # we need to strip any description and escape the completion to handle special + # characters because those escape characters are part of what the user typed. + # Don't call "printf" in a sub-shell because it will be much slower + # since we are in a loop. + printf -v comp "%%q" "${compline%%%%$tab*}" &>/dev/null || comp=$(printf "%%q" "${compline%%%%$tab*}") + # Only consider the completions that match [[ $comp == "$cur"* ]] || continue + + # The completions matches. Add it to the list of full completions including + # its description. We don't escape the completion because it may get printed + # in a list if there are more than one and we don't want show escape characters + # in that list. COMPREPLY+=("$compline") + + # Strip any description before checking the length, and again, don't escape + # the completion because this length is only used when printing the completions + # in a list and we don't want show escape characters in that list. + comp=${compline%%%%$tab*} if ((${#comp}>longest)); then longest=${#comp} fi done < <(printf "%%s\n" "${completions[@]}") - # If there is a single completion left, remove the description text + # If there is a single completion left, remove the description text and escape any special characters if ((${#COMPREPLY[*]} == 1)); then __%[1]s_debug "COMPREPLY[0]: ${COMPREPLY[0]}" - comp="${COMPREPLY[0]%%%%$tab*}" - __%[1]s_debug "Removed description from single completion, which is now: ${comp}" - COMPREPLY[0]=$comp - else # Format the descriptions + COMPREPLY[0]=$(printf "%%q" "${COMPREPLY[0]%%%%$tab*}") + __%[1]s_debug "Removed description from single completion, which is now: ${COMPREPLY[0]}" + else + # Format the descriptions __%[1]s_format_comp_descriptions $longest fi } diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index e0b0947b0..d9cd2414e 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -176,12 +176,16 @@ func rpad(s string, padding int) string { return fmt.Sprintf(formattedString, s) } -// tmpl executes the given template text on data, writing the result to w. -func tmpl(w io.Writer, text string, data interface{}) error { - t := template.New("top") - t.Funcs(templateFuncs) - template.Must(t.Parse(text)) - return t.Execute(w, data) +func tmpl(text string) *tmplFunc { + return &tmplFunc{ + tmpl: text, + fn: func(w io.Writer, data interface{}) error { + t := template.New("top") + t.Funcs(templateFuncs) + template.Must(t.Parse(text)) + return t.Execute(w, data) + }, + } } // ld compares two strings and returns the levenshtein distance between them. diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index 54748fc67..dbb2c298b 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -33,6 +33,9 @@ import ( const ( FlagSetByCobraAnnotation = "cobra_annotation_flag_set_by_cobra" CommandDisplayNameAnnotation = "cobra_annotation_command_display_name" + + helpFlagName = "help" + helpCommandName = "help" ) // FParseErrWhitelist configures Flag parse errors to be ignored @@ -80,11 +83,11 @@ type Command struct { Example string // ValidArgs is list of all valid non-flag arguments that are accepted in shell completions - ValidArgs []string + ValidArgs []Completion // ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. // It is a dynamic version of using ValidArgs. // Only one of ValidArgs and ValidArgsFunction can be used for a command. - ValidArgsFunction func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) + ValidArgsFunction CompletionFunc // Expected arguments Args PositionalArgs @@ -168,12 +171,12 @@ type Command struct { // usageFunc is usage func defined by user. usageFunc func(*Command) error // usageTemplate is usage template defined by user. - usageTemplate string + usageTemplate *tmplFunc // flagErrorFunc is func defined by user and it's called when the parsing of // flags returns an error. flagErrorFunc func(*Command, error) error // helpTemplate is help template defined by user. - helpTemplate string + helpTemplate *tmplFunc // helpFunc is help func defined by user. helpFunc func(*Command, []string) // helpCommand is command with usage 'help'. If it's not defined by user, @@ -186,7 +189,7 @@ type Command struct { completionCommandGroupID string // versionTemplate is the version template defined by user. - versionTemplate string + versionTemplate *tmplFunc // errPrefix is the error message prefix defined by user. errPrefix string @@ -281,6 +284,7 @@ func (c *Command) SetArgs(a []string) { // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. +// // Deprecated: Use SetOut and/or SetErr instead func (c *Command) SetOutput(output io.Writer) { c.outWriter = output @@ -312,7 +316,11 @@ func (c *Command) SetUsageFunc(f func(*Command) error) { // SetUsageTemplate sets usage template. Can be defined by Application. func (c *Command) SetUsageTemplate(s string) { - c.usageTemplate = s + if s == "" { + c.usageTemplate = nil + return + } + c.usageTemplate = tmpl(s) } // SetFlagErrorFunc sets a function to generate an error when flag parsing @@ -348,12 +356,20 @@ func (c *Command) SetCompletionCommandGroupID(groupID string) { // SetHelpTemplate sets help template to be used. Application can use it to set custom template. func (c *Command) SetHelpTemplate(s string) { - c.helpTemplate = s + if s == "" { + c.helpTemplate = nil + return + } + c.helpTemplate = tmpl(s) } // SetVersionTemplate sets version template to be used. Application can use it to set custom template. func (c *Command) SetVersionTemplate(s string) { - c.versionTemplate = s + if s == "" { + c.versionTemplate = nil + return + } + c.versionTemplate = tmpl(s) } // SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. @@ -434,7 +450,8 @@ func (c *Command) UsageFunc() (f func(*Command) error) { } return func(c *Command) error { c.mergePersistentFlags() - err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) + fn := c.getUsageTemplateFunc() + err := fn(c.OutOrStderr(), c) if err != nil { c.PrintErrln(err) } @@ -442,6 +459,19 @@ func (c *Command) UsageFunc() (f func(*Command) error) { } } +// getUsageTemplateFunc returns the usage template function for the command +// going up the command tree if necessary. +func (c *Command) getUsageTemplateFunc() func(w io.Writer, data interface{}) error { + if c.usageTemplate != nil { + return c.usageTemplate.fn + } + + if c.HasParent() { + return c.parent.getUsageTemplateFunc() + } + return defaultUsageFunc +} + // Usage puts out the usage for the command. // Used when a user provides invalid input. // Can be defined by user by overriding UsageFunc. @@ -460,15 +490,30 @@ func (c *Command) HelpFunc() func(*Command, []string) { } return func(c *Command, a []string) { c.mergePersistentFlags() + fn := c.getHelpTemplateFunc() // The help should be sent to stdout // See https://github.com/spf13/cobra/issues/1002 - err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) + err := fn(c.OutOrStdout(), c) if err != nil { c.PrintErrln(err) } } } +// getHelpTemplateFunc returns the help template function for the command +// going up the command tree if necessary. +func (c *Command) getHelpTemplateFunc() func(w io.Writer, data interface{}) error { + if c.helpTemplate != nil { + return c.helpTemplate.fn + } + + if c.HasParent() { + return c.parent.getHelpTemplateFunc() + } + + return defaultHelpFunc +} + // Help puts out the help for the command. // Used when a user calls help [command]. // Can be defined by user by overriding HelpFunc. @@ -543,71 +588,55 @@ func (c *Command) NamePadding() int { } // UsageTemplate returns usage template for the command. +// This function is kept for backwards-compatibility reasons. func (c *Command) UsageTemplate() string { - if c.usageTemplate != "" { - return c.usageTemplate + if c.usageTemplate != nil { + return c.usageTemplate.tmpl } if c.HasParent() { return c.parent.UsageTemplate() } - return `Usage:{{if .Runnable}} - {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} - {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} - -Aliases: - {{.NameAndAliases}}{{end}}{{if .HasExample}} - -Examples: -{{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}} - -Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}} - {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}} - -{{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}} - {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}} - -Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}} - {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} - -Flags: -{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} - -Global Flags: -{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} - -Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} - {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} - -Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} -` + return defaultUsageTemplate } // HelpTemplate return help template for the command. +// This function is kept for backwards-compatibility reasons. func (c *Command) HelpTemplate() string { - if c.helpTemplate != "" { - return c.helpTemplate + if c.helpTemplate != nil { + return c.helpTemplate.tmpl } if c.HasParent() { return c.parent.HelpTemplate() } - return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} - -{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` + return defaultHelpTemplate } // VersionTemplate return version template for the command. +// This function is kept for backwards-compatibility reasons. func (c *Command) VersionTemplate() string { - if c.versionTemplate != "" { - return c.versionTemplate + if c.versionTemplate != nil { + return c.versionTemplate.tmpl } if c.HasParent() { return c.parent.VersionTemplate() } - return `{{with .Name}}{{printf "%s " .}}{{end}}{{printf "version %s" .Version}} -` + return defaultVersionTemplate +} + +// getVersionTemplateFunc returns the version template function for the command +// going up the command tree if necessary. +func (c *Command) getVersionTemplateFunc() func(w io.Writer, data interface{}) error { + if c.versionTemplate != nil { + return c.versionTemplate.fn + } + + if c.HasParent() { + return c.parent.getVersionTemplateFunc() + } + return defaultVersionFunc } // ErrPrefix return error message prefix for the command @@ -894,7 +923,7 @@ func (c *Command) execute(a []string) (err error) { // If help is called, regardless of other flags, return we want help. // Also say we need help if the command isn't runnable. - helpVal, err := c.Flags().GetBool("help") + helpVal, err := c.Flags().GetBool(helpFlagName) if err != nil { // should be impossible to get here as we always declare a help // flag in InitDefaultHelpFlag() @@ -914,7 +943,8 @@ func (c *Command) execute(a []string) (err error) { return err } if versionVal { - err := tmpl(c.OutOrStdout(), c.VersionTemplate(), c) + fn := c.getVersionTemplateFunc() + err := fn(c.OutOrStdout(), c) if err != nil { c.Println(err) } @@ -1068,12 +1098,6 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { // initialize help at the last point to allow for user overriding c.InitDefaultHelpCmd() - // initialize completion at the last point to allow for user overriding - c.InitDefaultCompletionCmd() - - // Now that all commands have been created, let's make sure all groups - // are properly created also - c.checkCommandGroups() args := c.args @@ -1082,9 +1106,16 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { args = os.Args[1:] } - // initialize the hidden command to be used for shell completion + // initialize the __complete command to be used for shell completion c.initCompleteCmd(args) + // initialize the default completion command + c.InitDefaultCompletionCmd(args...) + + // Now that all commands have been created, let's make sure all groups + // are properly created also + c.checkCommandGroups() + var flags []string if c.TraverseChildren { cmd, flags, err = c.Traverse(args) @@ -1187,16 +1218,16 @@ func (c *Command) checkCommandGroups() { // If c already has help flag, it will do nothing. func (c *Command) InitDefaultHelpFlag() { c.mergePersistentFlags() - if c.Flags().Lookup("help") == nil { + if c.Flags().Lookup(helpFlagName) == nil { usage := "help for " - name := c.displayName() + name := c.DisplayName() if name == "" { usage += "this command" } else { usage += name } - c.Flags().BoolP("help", "h", false, usage) - _ = c.Flags().SetAnnotation("help", FlagSetByCobraAnnotation, []string{"true"}) + c.Flags().BoolP(helpFlagName, "h", false, usage) + _ = c.Flags().SetAnnotation(helpFlagName, FlagSetByCobraAnnotation, []string{"true"}) } } @@ -1215,7 +1246,7 @@ func (c *Command) InitDefaultVersionFlag() { if c.Name() == "" { usage += "this command" } else { - usage += c.Name() + usage += c.DisplayName() } if c.Flags().ShorthandLookup("v") == nil { c.Flags().BoolP("version", "v", false, usage) @@ -1239,9 +1270,9 @@ func (c *Command) InitDefaultHelpCmd() { Use: "help [command]", Short: "Help about any command", Long: `Help provides help for any command in the application. -Simply type ` + c.displayName() + ` help [path to command] for full details.`, - ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]string, ShellCompDirective) { - var completions []string +Simply type ` + c.DisplayName() + ` help [path to command] for full details.`, + ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { + var completions []Completion cmd, _, e := c.Root().Find(args) if e != nil { return nil, ShellCompDirectiveNoFileComp @@ -1253,7 +1284,7 @@ Simply type ` + c.displayName() + ` help [path to command] for full details.`, for _, subCmd := range cmd.Commands() { if subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand { if strings.HasPrefix(subCmd.Name(), toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) + completions = append(completions, CompletionWithDesc(subCmd.Name(), subCmd.Short)) } } } @@ -1430,10 +1461,12 @@ func (c *Command) CommandPath() string { if c.HasParent() { return c.Parent().CommandPath() + " " + c.Name() } - return c.displayName() + return c.DisplayName() } -func (c *Command) displayName() string { +// DisplayName returns the name to display in help text. Returns command Name() +// If CommandDisplayNameAnnoation is not set +func (c *Command) DisplayName() string { if displayName, ok := c.Annotations[CommandDisplayNameAnnotation]; ok { return displayName } @@ -1443,7 +1476,7 @@ func (c *Command) displayName() string { // UseLine puts out the full usage for a given command (including parents). func (c *Command) UseLine() string { var useline string - use := strings.Replace(c.Use, c.Name(), c.displayName(), 1) + use := strings.Replace(c.Use, c.Name(), c.DisplayName(), 1) if c.HasParent() { useline = c.parent.CommandPath() + " " + use } else { @@ -1649,7 +1682,7 @@ func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) f // to this command (local and persistent declared here and by all parents). func (c *Command) Flags() *flag.FlagSet { if c.flags == nil { - c.flags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.flags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } @@ -1664,7 +1697,7 @@ func (c *Command) Flags() *flag.FlagSet { func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { persistentFlags := c.PersistentFlags() - out := flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + out := flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.LocalFlags().VisitAll(func(f *flag.Flag) { if persistentFlags.Lookup(f.Name) == nil { out.AddFlag(f) @@ -1679,7 +1712,7 @@ func (c *Command) LocalFlags() *flag.FlagSet { c.mergePersistentFlags() if c.lflags == nil { - c.lflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.lflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } @@ -1707,7 +1740,7 @@ func (c *Command) InheritedFlags() *flag.FlagSet { c.mergePersistentFlags() if c.iflags == nil { - c.iflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.iflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } @@ -1736,7 +1769,7 @@ func (c *Command) NonInheritedFlags() *flag.FlagSet { // PersistentFlags returns the persistent FlagSet specifically set in the current command. func (c *Command) PersistentFlags() *flag.FlagSet { if c.pflags == nil { - c.pflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } @@ -1749,9 +1782,9 @@ func (c *Command) PersistentFlags() *flag.FlagSet { func (c *Command) ResetFlags() { c.flagErrorBuf = new(bytes.Buffer) c.flagErrorBuf.Reset() - c.flags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.flags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.flags.SetOutput(c.flagErrorBuf) - c.pflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.pflags.SetOutput(c.flagErrorBuf) c.lflags = nil @@ -1868,7 +1901,7 @@ func (c *Command) mergePersistentFlags() { // If c.parentsPflags == nil, it makes new. func (c *Command) updateParentsPflags() { if c.parentsPflags == nil { - c.parentsPflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError) + c.parentsPflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.parentsPflags.SetOutput(c.flagErrorBuf) c.parentsPflags.SortFlags = false } @@ -1894,3 +1927,141 @@ func commandNameMatches(s string, t string) bool { return s == t } + +// tmplFunc holds a template and a function that will execute said template. +type tmplFunc struct { + tmpl string + fn func(io.Writer, interface{}) error +} + +var defaultUsageTemplate = `Usage:{{if .Runnable}} + {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} + {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} + +Aliases: + {{.NameAndAliases}}{{end}}{{if .HasExample}} + +Examples: +{{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}} + +Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}} + +{{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}} + +Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} + +Flags: +{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} + +Global Flags: +{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} + +Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} + {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} + +Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} +` + +// defaultUsageFunc is equivalent to executing defaultUsageTemplate. The two should be changed in sync. +func defaultUsageFunc(w io.Writer, in interface{}) error { + c := in.(*Command) + fmt.Fprint(w, "Usage:") + if c.Runnable() { + fmt.Fprintf(w, "\n %s", c.UseLine()) + } + if c.HasAvailableSubCommands() { + fmt.Fprintf(w, "\n %s [command]", c.CommandPath()) + } + if len(c.Aliases) > 0 { + fmt.Fprintf(w, "\n\nAliases:\n") + fmt.Fprintf(w, " %s", c.NameAndAliases()) + } + if c.HasExample() { + fmt.Fprintf(w, "\n\nExamples:\n") + fmt.Fprintf(w, "%s", c.Example) + } + if c.HasAvailableSubCommands() { + cmds := c.Commands() + if len(c.Groups()) == 0 { + fmt.Fprintf(w, "\n\nAvailable Commands:") + for _, subcmd := range cmds { + if subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName { + fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) + } + } + } else { + for _, group := range c.Groups() { + fmt.Fprintf(w, "\n\n%s", group.Title) + for _, subcmd := range cmds { + if subcmd.GroupID == group.ID && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) { + fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) + } + } + } + if !c.AllChildCommandsHaveGroup() { + fmt.Fprintf(w, "\n\nAdditional Commands:") + for _, subcmd := range cmds { + if subcmd.GroupID == "" && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) { + fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) + } + } + } + } + } + if c.HasAvailableLocalFlags() { + fmt.Fprintf(w, "\n\nFlags:\n") + fmt.Fprint(w, trimRightSpace(c.LocalFlags().FlagUsages())) + } + if c.HasAvailableInheritedFlags() { + fmt.Fprintf(w, "\n\nGlobal Flags:\n") + fmt.Fprint(w, trimRightSpace(c.InheritedFlags().FlagUsages())) + } + if c.HasHelpSubCommands() { + fmt.Fprintf(w, "\n\nAdditional help topcis:") + for _, subcmd := range c.Commands() { + if subcmd.IsAdditionalHelpTopicCommand() { + fmt.Fprintf(w, "\n %s %s", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short) + } + } + } + if c.HasAvailableSubCommands() { + fmt.Fprintf(w, "\n\nUse \"%s [command] --help\" for more information about a command.", c.CommandPath()) + } + fmt.Fprintln(w) + return nil +} + +var defaultHelpTemplate = `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} + +{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` + +// defaultHelpFunc is equivalent to executing defaultHelpTemplate. The two should be changed in sync. +func defaultHelpFunc(w io.Writer, in interface{}) error { + c := in.(*Command) + usage := c.Long + if usage == "" { + usage = c.Short + } + usage = trimRightSpace(usage) + if usage != "" { + fmt.Fprintln(w, usage) + fmt.Fprintln(w) + } + if c.Runnable() || c.HasSubCommands() { + fmt.Fprint(w, c.UsageString()) + } + return nil +} + +var defaultVersionTemplate = `{{with .DisplayName}}{{printf "%s " .}}{{end}}{{printf "version %s" .Version}} +` + +// defaultVersionFunc is equivalent to executing defaultVersionTemplate. The two should be changed in sync. +func defaultVersionFunc(w io.Writer, in interface{}) error { + c := in.(*Command) + _, err := fmt.Fprintf(w, "%s version %s\n", c.DisplayName(), c.Version) + return err +} diff --git a/vendor/github.com/spf13/cobra/completions.go b/vendor/github.com/spf13/cobra/completions.go index c0c08b057..a1752f763 100644 --- a/vendor/github.com/spf13/cobra/completions.go +++ b/vendor/github.com/spf13/cobra/completions.go @@ -35,7 +35,7 @@ const ( ) // Global map of flag completion functions. Make sure to use flagCompletionMutex before you try to read and write from it. -var flagCompletionFunctions = map[*pflag.Flag]func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective){} +var flagCompletionFunctions = map[*pflag.Flag]CompletionFunc{} // lock for reading and writing from flagCompletionFunctions var flagCompletionMutex = &sync.RWMutex{} @@ -117,22 +117,50 @@ type CompletionOptions struct { HiddenDefaultCmd bool } +// Completion is a string that can be used for completions +// +// two formats are supported: +// - the completion choice +// - the completion choice with a textual description (separated by a TAB). +// +// [CompletionWithDesc] can be used to create a completion string with a textual description. +// +// Note: Go type alias is used to provide a more descriptive name in the documentation, but any string can be used. +type Completion = string + +// CompletionFunc is a function that provides completion results. +type CompletionFunc = func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) + +// CompletionWithDesc returns a [Completion] with a description by using the TAB delimited format. +func CompletionWithDesc(choice string, description string) Completion { + return choice + "\t" + description +} + // NoFileCompletions can be used to disable file completion for commands that should // not trigger file completions. -func NoFileCompletions(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) { +// +// This method satisfies [CompletionFunc]. +// It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction]. +func NoFileCompletions(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { return nil, ShellCompDirectiveNoFileComp } // FixedCompletions can be used to create a completion function which always // returns the same results. -func FixedCompletions(choices []string, directive ShellCompDirective) func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) { - return func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) { +// +// This method returns a function that satisfies [CompletionFunc] +// It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction]. +func FixedCompletions(choices []Completion, directive ShellCompDirective) CompletionFunc { + return func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { return choices, directive } } // RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. -func (c *Command) RegisterFlagCompletionFunc(flagName string, f func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)) error { +// +// You can use pre-defined completion functions such as [FixedCompletions] or [NoFileCompletions], +// or you can define your own. +func (c *Command) RegisterFlagCompletionFunc(flagName string, f CompletionFunc) error { flag := c.Flag(flagName) if flag == nil { return fmt.Errorf("RegisterFlagCompletionFunc: flag '%s' does not exist", flagName) @@ -148,7 +176,7 @@ func (c *Command) RegisterFlagCompletionFunc(flagName string, f func(cmd *Comman } // GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. -func (c *Command) GetFlagCompletionFunc(flagName string) (func(*Command, []string, string) ([]string, ShellCompDirective), bool) { +func (c *Command) GetFlagCompletionFunc(flagName string) (CompletionFunc, bool) { flag := c.Flag(flagName) if flag == nil { return nil, false @@ -270,7 +298,15 @@ func (c *Command) initCompleteCmd(args []string) { } } -func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDirective, error) { +// SliceValue is a reduced version of [pflag.SliceValue]. It is used to detect +// flags that accept multiple values and therefore can provide completion +// multiple times. +type SliceValue interface { + // GetSlice returns the flag value list as an array of strings. + GetSlice() []string +} + +func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCompDirective, error) { // The last argument, which is not completely typed by the user, // should not be part of the list of arguments toComplete := args[len(args)-1] @@ -298,7 +334,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi } if err != nil { // Unable to find the real command. E.g., someInvalidCmd - return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs) + return c, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs) } finalCmd.ctx = c.ctx @@ -328,7 +364,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi // Parse the flags early so we can check if required flags are set if err = finalCmd.ParseFlags(finalArgs); err != nil { - return finalCmd, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) + return finalCmd, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) } realArgCount := finalCmd.Flags().NArg() @@ -340,14 +376,14 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi if flagErr != nil { // If error type is flagCompError and we don't want flagCompletion we should ignore the error if _, ok := flagErr.(*flagCompError); !(ok && !flagCompletion) { - return finalCmd, []string{}, ShellCompDirectiveDefault, flagErr + return finalCmd, []Completion{}, ShellCompDirectiveDefault, flagErr } } // Look for the --help or --version flags. If they are present, // there should be no further completions. if helpOrVersionFlagPresent(finalCmd) { - return finalCmd, []string{}, ShellCompDirectiveNoFileComp, nil + return finalCmd, []Completion{}, ShellCompDirectiveNoFileComp, nil } // We only remove the flags from the arguments if DisableFlagParsing is not set. @@ -376,11 +412,11 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi return finalCmd, subDir, ShellCompDirectiveFilterDirs, nil } // Directory completion - return finalCmd, []string{}, ShellCompDirectiveFilterDirs, nil + return finalCmd, []Completion{}, ShellCompDirectiveFilterDirs, nil } } - var completions []string + var completions []Completion var directive ShellCompDirective // Enforce flag groups before doing flag completions @@ -399,10 +435,14 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi // If we have not found any required flags, only then can we show regular flags if len(completions) == 0 { doCompleteFlags := func(flag *pflag.Flag) { - if !flag.Changed || + _, acceptsMultiple := flag.Value.(SliceValue) + acceptsMultiple = acceptsMultiple || strings.Contains(flag.Value.Type(), "Slice") || - strings.Contains(flag.Value.Type(), "Array") { - // If the flag is not already present, or if it can be specified multiple times (Array or Slice) + strings.Contains(flag.Value.Type(), "Array") || + strings.HasPrefix(flag.Value.Type(), "stringTo") + + if !flag.Changed || acceptsMultiple { + // If the flag is not already present, or if it can be specified multiple times (Array, Slice, or stringTo) // we suggest it as a completion completions = append(completions, getFlagNameCompletions(flag, toComplete)...) } @@ -462,7 +502,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi for _, subCmd := range finalCmd.Commands() { if subCmd.IsAvailableCommand() || subCmd == finalCmd.helpCommand { if strings.HasPrefix(subCmd.Name(), toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) + completions = append(completions, CompletionWithDesc(subCmd.Name(), subCmd.Short)) } directive = ShellCompDirectiveNoFileComp } @@ -507,7 +547,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi } // Find the completion function for the flag or command - var completionFn func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) + var completionFn CompletionFunc if flag != nil && flagCompletion { flagCompletionMutex.RLock() completionFn = flagCompletionFunctions[flag] @@ -518,7 +558,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi if completionFn != nil { // Go custom completion defined for this flag or command. // Call the registered completion function to get the completions. - var comps []string + var comps []Completion comps, directive = completionFn(finalCmd, finalArgs, toComplete) completions = append(completions, comps...) } @@ -531,23 +571,23 @@ func helpOrVersionFlagPresent(cmd *Command) bool { len(versionFlag.Annotations[FlagSetByCobraAnnotation]) > 0 && versionFlag.Changed { return true } - if helpFlag := cmd.Flags().Lookup("help"); helpFlag != nil && + if helpFlag := cmd.Flags().Lookup(helpFlagName); helpFlag != nil && len(helpFlag.Annotations[FlagSetByCobraAnnotation]) > 0 && helpFlag.Changed { return true } return false } -func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { +func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []Completion { if nonCompletableFlag(flag) { - return []string{} + return []Completion{} } - var completions []string + var completions []Completion flagName := "--" + flag.Name if strings.HasPrefix(flagName, toComplete) { // Flag without the = - completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) + completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) // Why suggest both long forms: --flag and --flag= ? // This forces the user to *always* have to type either an = or a space after the flag name. @@ -559,20 +599,20 @@ func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { // if len(flag.NoOptDefVal) == 0 { // // Flag requires a value, so it can be suffixed with = // flagName += "=" - // completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) + // completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) // } } flagName = "-" + flag.Shorthand if len(flag.Shorthand) > 0 && strings.HasPrefix(flagName, toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) + completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) } return completions } -func completeRequireFlags(finalCmd *Command, toComplete string) []string { - var completions []string +func completeRequireFlags(finalCmd *Command, toComplete string) []Completion { + var completions []Completion doCompleteRequiredFlags := func(flag *pflag.Flag) { if _, present := flag.Annotations[BashCompOneRequiredFlag]; present { @@ -687,8 +727,8 @@ func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*p // 1- the feature has been explicitly disabled by the program, // 2- c has no subcommands (to avoid creating one), // 3- c already has a 'completion' command provided by the program. -func (c *Command) InitDefaultCompletionCmd() { - if c.CompletionOptions.DisableDefaultCmd || !c.HasSubCommands() { +func (c *Command) InitDefaultCompletionCmd(args ...string) { + if c.CompletionOptions.DisableDefaultCmd { return } @@ -701,6 +741,16 @@ func (c *Command) InitDefaultCompletionCmd() { haveNoDescFlag := !c.CompletionOptions.DisableNoDescFlag && !c.CompletionOptions.DisableDescriptions + // Special case to know if there are sub-commands or not. + hasSubCommands := false + for _, cmd := range c.commands { + if cmd.Name() != ShellCompRequestCmd && cmd.Name() != helpCommandName { + // We found a real sub-command (not 'help' or '__complete') + hasSubCommands = true + break + } + } + completionCmd := &Command{ Use: compCmdName, Short: "Generate the autocompletion script for the specified shell", @@ -714,6 +764,22 @@ See each sub-command's help for details on how to use the generated script. } c.AddCommand(completionCmd) + if !hasSubCommands { + // If the 'completion' command will be the only sub-command, + // we only create it if it is actually being called. + // This avoids breaking programs that would suddenly find themselves with + // a subcommand, which would prevent them from accepting arguments. + // We also create the 'completion' command if the user is triggering + // shell completion for it (prog __complete completion '') + subCmd, cmdArgs, err := c.Find(args) + if err != nil || subCmd.Name() != compCmdName && + !(subCmd.Name() == ShellCompRequestCmd && len(cmdArgs) > 1 && cmdArgs[0] == compCmdName) { + // The completion command is not being called or being completed so we remove it. + c.RemoveCommand(completionCmd) + return + } + } + out := c.OutOrStdout() noDesc := c.CompletionOptions.DisableDescriptions shortDesc := "Generate the autocompletion script for %s" diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go index a830b7bca..746dcb92e 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.go +++ b/vendor/github.com/spf13/cobra/powershell_completions.go @@ -162,7 +162,10 @@ filter __%[1]s_escapeStringWithSpecialChars { if (-Not $Description) { $Description = " " } - @{Name="$Name";Description="$Description"} + New-Object -TypeName PSCustomObject -Property @{ + Name = "$Name" + Description = "$Description" + } } @@ -240,7 +243,12 @@ filter __%[1]s_escapeStringWithSpecialChars { __%[1]s_debug "Only one completion left" # insert space after value - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space + if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ + [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } else { + $CompletionText + } } else { # Add the proper number of spaces to align the descriptions @@ -255,7 +263,12 @@ filter __%[1]s_escapeStringWithSpecialChars { $Description = " ($($comp.Description))" } - [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + $CompletionText = "$($comp.Name)$Description" + if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ + [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + } else { + $CompletionText + } } } @@ -264,7 +277,13 @@ filter __%[1]s_escapeStringWithSpecialChars { # insert space after value # MenuComplete will automatically show the ToolTip of # the highlighted value at the bottom of the suggestions. - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space + if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ + [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } else { + $CompletionText + } } # TabCompleteNext and in case we get something unknown @@ -272,7 +291,13 @@ filter __%[1]s_escapeStringWithSpecialChars { # Like MenuComplete but we don't want to add a space here because # the user need to press space anyway to get the completion. # Description will not be shown because that's not possible with TabCompleteNext - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) + if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ + [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } else { + $CompletionText + } } } diff --git a/vendor/k8s.io/api/resource/v1alpha3/types.go b/vendor/k8s.io/api/resource/v1alpha3/types.go index fb4d7041d..49d7c86de 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/types.go +++ b/vendor/k8s.io/api/resource/v1alpha3/types.go @@ -145,6 +145,10 @@ type ResourceSliceSpec struct { Devices []Device `json:"devices" protobuf:"bytes,6,name=devices"` } +// DriverNameMaxLength is the maximum valid length of a driver name in the +// ResourceSliceSpec and other places. It's the same as for CSI driver names. +const DriverNameMaxLength = 63 + // ResourcePool describes the pool that ResourceSlices belong to. type ResourcePool struct { // Name is used to identify the pool. For node-local devices, this diff --git a/vendor/k8s.io/api/resource/v1beta1/types.go b/vendor/k8s.io/api/resource/v1beta1/types.go index ca79c5a66..fbdc35ca8 100644 --- a/vendor/k8s.io/api/resource/v1beta1/types.go +++ b/vendor/k8s.io/api/resource/v1beta1/types.go @@ -144,6 +144,10 @@ type ResourceSliceSpec struct { Devices []Device `json:"devices" protobuf:"bytes,6,name=devices"` } +// DriverNameMaxLength is the maximum valid length of a driver name in the +// ResourceSliceSpec and other places. It's the same as for CSI driver names. +const DriverNameMaxLength = 63 + // ResourcePool describes the pool that ResourceSlices belong to. type ResourcePool struct { // Name is used to identify the pool. For node-local devices, this diff --git a/vendor/kmodules.xyz/client-go/.golangci.yml b/vendor/kmodules.xyz/client-go/.golangci.yml new file mode 100644 index 000000000..4f8a023cf --- /dev/null +++ b/vendor/kmodules.xyz/client-go/.golangci.yml @@ -0,0 +1,27 @@ +version: "2" +linters: + default: standard + enable: + - unparam + +formatters: + enable: + - gofmt + - goimports + settings: + gofmt: + rewrite-rules: + - pattern: 'interface{}' + replacement: 'any' + +issues: + max-same-issues: 100 + + exclude-files: + - generated.*\\.go + + exclude-dirs: + - vendor + +run: + timeout: 10m diff --git a/vendor/kmodules.xyz/client-go/Makefile b/vendor/kmodules.xyz/client-go/Makefile index a03d2f8ef..0d1f72430 100644 --- a/vendor/kmodules.xyz/client-go/Makefile +++ b/vendor/kmodules.xyz/client-go/Makefile @@ -58,7 +58,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) BASEIMAGE_PROD ?= gcr.io/distroless/static-debian12 BASEIMAGE_DBG ?= debian:12 -GO_VERSION ?= 1.24 +GO_VERSION ?= 1.25 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) @@ -242,8 +242,6 @@ test: $(BUILD_DIRS) ./hack/test.sh $(SRC_PKGS) \ " -ADDTL_LINTERS := gofmt,goimports,unparam - .PHONY: lint lint: $(BUILD_DIRS) @echo "running linter" @@ -261,7 +259,7 @@ lint: $(BUILD_DIRS) --env GO111MODULE=on \ --env GOFLAGS="-mod=vendor" \ $(BUILD_IMAGE) \ - golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default + golangci-lint run $(BUILD_DIRS): @mkdir -p $@ diff --git a/vendor/kmodules.xyz/client-go/api/v1/cluster.go b/vendor/kmodules.xyz/client-go/api/v1/cluster.go index 980fbbec5..3bafb8212 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/cluster.go +++ b/vendor/kmodules.xyz/client-go/api/v1/cluster.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//go:generate go-enum --mustparse --names --values package v1 import ( @@ -21,8 +22,6 @@ import ( "crypto/sha256" "encoding/base64" "fmt" - "math/bits" - "strings" ) // +kubebuilder:validation:Enum=AKS;DigitalOcean;EKS;Exoscale;Generic;GKE;Linode;Packet;Rancher;Scaleway;Vultr @@ -58,6 +57,7 @@ const ( ClusterNameKey string = "cluster.appscode.com/name" ClusterDisplayNameKey string = "cluster.appscode.com/display-name" ClusterProviderNameKey string = "cluster.appscode.com/provider" + ClusterModeKey string = "cluster.appscode.com/mode" ClusterProfileLabel string = "cluster.appscode.com/profile" AceOrgIDKey string = "ace.appscode.com/org-id" @@ -83,6 +83,7 @@ type ClusterMetadata struct { ManagerID string `json:"managerID,omitempty" protobuf:"bytes,9,opt,name=managerID"` HubClusterID string `json:"hubClusterID,omitempty" protobuf:"bytes,10,opt,name=hubClusterID"` CloudServiceAuthMode string `json:"cloudServiceAuthMode,omitempty" protobuf:"bytes,11,opt,name=cloudServiceAuthMode"` + Mode ClusterMode `json:"mode,omitempty" protobuf:"bytes,12,opt,name=mode,casttype=ClusterMode"` } func (md ClusterMetadata) Manager() string { @@ -99,100 +100,17 @@ func (md ClusterMetadata) State() string { return base64.URLEncoding.EncodeToString(hasher.Sum(nil)) } -/* -ENUM( - - ACE = 1 - OCMHub = 2 - OCMMulticlusterControlplane = 4 - OCMSpoke = 8 - OpenShift = 16 - Rancher = 32 - VirtualCluster = 64 - -) -*/ -type ClusterManager int - -const ( - ClusterManagerACE ClusterManager = 1 << iota - ClusterManagerOCMHub - ClusterManagerOCMMulticlusterControlplane - ClusterManagerOCMSpoke - ClusterManagerOpenShift - ClusterManagerRancher - ClusterManagerVirtualCluster -) - -func (cm ClusterManager) ManagedByACE() bool { - return cm&ClusterManagerACE == ClusterManagerACE -} +// +kubebuilder:validation:Enum=prod;qa;staging;dev +// ENUM(prod,qa,staging,dev) +type ClusterMode string -func (cm ClusterManager) ManagedByOCMHub() bool { - return cm&ClusterManagerOCMHub == ClusterManagerOCMHub -} - -func (cm ClusterManager) ManagedByOCMSpoke() bool { - return cm&ClusterManagerOCMSpoke == ClusterManagerOCMSpoke -} - -func (cm ClusterManager) ManagedByOCMMulticlusterControlplane() bool { - return cm&ClusterManagerOCMMulticlusterControlplane == ClusterManagerOCMMulticlusterControlplane -} - -func (cm ClusterManager) ManagedByRancher() bool { - return cm&ClusterManagerRancher == ClusterManagerRancher -} - -func (cm ClusterManager) ManagedByOpenShift() bool { - return cm&ClusterManagerOpenShift == ClusterManagerOpenShift -} - -func (cm ClusterManager) ManagedByVirtualCluster() bool { - return cm&ClusterManagerVirtualCluster == ClusterManagerVirtualCluster -} - -func (cm ClusterManager) Strings() []string { - out := make([]string, 0, 7) - if cm.ManagedByACE() { - out = append(out, "ACE") - } - if cm.ManagedByOCMHub() { - out = append(out, "OCMHub") - } - if cm.ManagedByOCMSpoke() { - out = append(out, "OCMSpoke") - } - if cm.ManagedByOCMMulticlusterControlplane() { - out = append(out, "OCMMulticlusterControlplane") - } - if cm.ManagedByRancher() { - out = append(out, "Rancher") - } - if cm.ManagedByOpenShift() { - out = append(out, "OpenShift") - } - if cm.ManagedByVirtualCluster() { - out = append(out, "vcluster") - } - return out -} - -func isPowerOfTwo(n int) bool { - return n > 0 && (n&(n-1)) == 0 -} - -func (cm ClusterManager) Name() string { - if !isPowerOfTwo(int(cm)) { - return cm.String() - } - idx := bits.TrailingZeros(uint(cm)) - return _ClusterManagerNames[idx] -} - -func (cm ClusterManager) String() string { - return strings.Join(cm.Strings(), ",") -} +// +//const ( +// ClusterModeProd ClusterMode = "prod" +// ClusterModeQA ClusterMode = "qa" +// ClusterModeStaging ClusterMode = "staging" +// ClusterModeDev ClusterMode = "dev" +//) type CAPIClusterInfo struct { Provider CAPIProvider `json:"provider" protobuf:"bytes,1,opt,name=provider,casttype=CAPIProvider"` @@ -221,11 +139,11 @@ const ( ) type ClusterClaimInfo struct { - ClusterMetadata ClusterInfo `json:"clusterMetadata"` + ClusterMetadata ClusterInfo `json:"clusterMetadata" protobuf:"bytes,1,opt,name=clusterMetadata"` } type ClusterClaimFeatures struct { - EnabledFeatures []string `json:"enabledFeatures,omitempty"` - ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty"` - DisabledFeatures []string `json:"disabledFeatures,omitempty"` + EnabledFeatures []string `json:"enabledFeatures,omitempty" protobuf:"bytes,1,rep,name=enabledFeatures"` + ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty" protobuf:"bytes,2,rep,name=externallyManagedFeatures"` + DisabledFeatures []string `json:"disabledFeatures,omitempty" protobuf:"bytes,3,rep,name=disabledFeatures"` } diff --git a/vendor/kmodules.xyz/client-go/api/v1/cluster_enum.go b/vendor/kmodules.xyz/client-go/api/v1/cluster_enum.go index ca2aeffff..c437b3929 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/cluster_enum.go +++ b/vendor/kmodules.xyz/client-go/api/v1/cluster_enum.go @@ -1,18 +1,7 @@ -/* -Copyright AppsCode Inc. and Contributors +// Code generated by go-enum DO NOT EDIT. +// Version: v0.9.2 -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Built By: go install package v1 @@ -21,54 +10,75 @@ import ( "strings" ) -var ErrInvalidClusterManager = fmt.Errorf("not a valid ClusterManager, try [%s]", strings.Join(_ClusterManagerNames, ", ")) +const ( + // ClusterModeProd is a ClusterMode of type prod. + ClusterModeProd ClusterMode = "prod" + // ClusterModeQa is a ClusterMode of type qa. + ClusterModeQa ClusterMode = "qa" + // ClusterModeStaging is a ClusterMode of type staging. + ClusterModeStaging ClusterMode = "staging" + // ClusterModeDev is a ClusterMode of type dev. + ClusterModeDev ClusterMode = "dev" +) -const _ClusterManagerName = "ACEOCMHubOCMMulticlusterControlplaneOCMSpokeOpenShiftRancherVirtualCluster" +var ErrInvalidClusterMode = fmt.Errorf("not a valid ClusterMode, try [%s]", strings.Join(_ClusterModeNames, ", ")) -var _ClusterManagerNames = []string{ - _ClusterManagerName[0:3], - _ClusterManagerName[3:9], - _ClusterManagerName[9:36], - _ClusterManagerName[36:44], - _ClusterManagerName[44:53], - _ClusterManagerName[53:60], - _ClusterManagerName[60:74], +var _ClusterModeNames = []string{ + string(ClusterModeProd), + string(ClusterModeQa), + string(ClusterModeStaging), + string(ClusterModeDev), } -// ClusterManagerNames returns a list of possible string values of ClusterManager. -func ClusterManagerNames() []string { - tmp := make([]string, len(_ClusterManagerNames)) - copy(tmp, _ClusterManagerNames) +// ClusterModeNames returns a list of possible string values of ClusterMode. +func ClusterModeNames() []string { + tmp := make([]string, len(_ClusterModeNames)) + copy(tmp, _ClusterModeNames) return tmp } -// ClusterManagerValues returns a list of the values for ClusterManager -func ClusterManagerValues() []ClusterManager { - return []ClusterManager{ - ClusterManagerACE, - ClusterManagerOCMHub, - ClusterManagerOCMMulticlusterControlplane, - ClusterManagerOCMSpoke, - ClusterManagerOpenShift, - ClusterManagerRancher, - ClusterManagerVirtualCluster, +// ClusterModeValues returns a list of the values for ClusterMode +func ClusterModeValues() []ClusterMode { + return []ClusterMode{ + ClusterModeProd, + ClusterModeQa, + ClusterModeStaging, + ClusterModeDev, } } -var _ClusterManagerValue = map[string]ClusterManager{ - _ClusterManagerName[0:3]: ClusterManagerACE, - _ClusterManagerName[3:9]: ClusterManagerOCMHub, - _ClusterManagerName[9:36]: ClusterManagerOCMMulticlusterControlplane, - _ClusterManagerName[36:44]: ClusterManagerOCMSpoke, - _ClusterManagerName[44:53]: ClusterManagerOpenShift, - _ClusterManagerName[53:60]: ClusterManagerRancher, - _ClusterManagerName[60:74]: ClusterManagerVirtualCluster, +// String implements the Stringer interface. +func (x ClusterMode) String() string { + return string(x) +} + +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x ClusterMode) IsValid() bool { + _, err := ParseClusterMode(string(x)) + return err == nil } -// ParseClusterManager attempts to convert a string to a ClusterManager. -func ParseClusterManager(name string) (ClusterManager, error) { - if x, ok := _ClusterManagerValue[name]; ok { +var _ClusterModeValue = map[string]ClusterMode{ + "prod": ClusterModeProd, + "qa": ClusterModeQa, + "staging": ClusterModeStaging, + "dev": ClusterModeDev, +} + +// ParseClusterMode attempts to convert a string to a ClusterMode. +func ParseClusterMode(name string) (ClusterMode, error) { + if x, ok := _ClusterModeValue[name]; ok { return x, nil } - return ClusterManager(0), fmt.Errorf("%s is %w", name, ErrInvalidClusterManager) + return ClusterMode(""), fmt.Errorf("%s is %w", name, ErrInvalidClusterMode) +} + +// MustParseClusterMode converts a string to a ClusterMode, and panics if is not valid. +func MustParseClusterMode(name string) ClusterMode { + val, err := ParseClusterMode(name) + if err != nil { + panic(err) + } + return val } diff --git a/vendor/kmodules.xyz/client-go/api/v1/clustermanager.go b/vendor/kmodules.xyz/client-go/api/v1/clustermanager.go new file mode 100644 index 000000000..3c3f1305d --- /dev/null +++ b/vendor/kmodules.xyz/client-go/api/v1/clustermanager.go @@ -0,0 +1,170 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "fmt" + "math/bits" + "strings" +) + +var ErrInvalidClusterManager = fmt.Errorf("not a valid ClusterManager, try [%s]", strings.Join(_ClusterManagerNames, ", ")) + +const _ClusterManagerName = "ACEOCMHubOCMMulticlusterControlplaneOCMSpokeOpenShiftRancherVirtualCluster" + +var _ClusterManagerNames = []string{ + _ClusterManagerName[0:3], + _ClusterManagerName[3:9], + _ClusterManagerName[9:36], + _ClusterManagerName[36:44], + _ClusterManagerName[44:53], + _ClusterManagerName[53:60], + _ClusterManagerName[60:74], +} + +// ClusterManagerNames returns a list of possible string values of ClusterManager. +func ClusterManagerNames() []string { + tmp := make([]string, len(_ClusterManagerNames)) + copy(tmp, _ClusterManagerNames) + return tmp +} + +// ClusterManagerValues returns a list of the values for ClusterManager +func ClusterManagerValues() []ClusterManager { + return []ClusterManager{ + ClusterManagerACE, + ClusterManagerOCMHub, + ClusterManagerOCMMulticlusterControlplane, + ClusterManagerOCMSpoke, + ClusterManagerOpenShift, + ClusterManagerRancher, + ClusterManagerVirtualCluster, + } +} + +var _ClusterManagerValue = map[string]ClusterManager{ + _ClusterManagerName[0:3]: ClusterManagerACE, + _ClusterManagerName[3:9]: ClusterManagerOCMHub, + _ClusterManagerName[9:36]: ClusterManagerOCMMulticlusterControlplane, + _ClusterManagerName[36:44]: ClusterManagerOCMSpoke, + _ClusterManagerName[44:53]: ClusterManagerOpenShift, + _ClusterManagerName[53:60]: ClusterManagerRancher, + _ClusterManagerName[60:74]: ClusterManagerVirtualCluster, +} + +// ParseClusterManager attempts to convert a string to a ClusterManager. +func ParseClusterManager(name string) (ClusterManager, error) { + if x, ok := _ClusterManagerValue[name]; ok { + return x, nil + } + return ClusterManager(0), fmt.Errorf("%s is %w", name, ErrInvalidClusterManager) +} + +/* +ENUM( + + ACE = 1 + OCMHub = 2 + OCMMulticlusterControlplane = 4 + OCMSpoke = 8 + OpenShift = 16 + Rancher = 32 + VirtualCluster = 64 + +) +*/ +type ClusterManager int + +const ( + ClusterManagerACE ClusterManager = 1 << iota + ClusterManagerOCMHub + ClusterManagerOCMMulticlusterControlplane + ClusterManagerOCMSpoke + ClusterManagerOpenShift + ClusterManagerRancher + ClusterManagerVirtualCluster +) + +func (cm ClusterManager) ManagedByACE() bool { + return cm&ClusterManagerACE == ClusterManagerACE +} + +func (cm ClusterManager) ManagedByOCMHub() bool { + return cm&ClusterManagerOCMHub == ClusterManagerOCMHub +} + +func (cm ClusterManager) ManagedByOCMSpoke() bool { + return cm&ClusterManagerOCMSpoke == ClusterManagerOCMSpoke +} + +func (cm ClusterManager) ManagedByOCMMulticlusterControlplane() bool { + return cm&ClusterManagerOCMMulticlusterControlplane == ClusterManagerOCMMulticlusterControlplane +} + +func (cm ClusterManager) ManagedByRancher() bool { + return cm&ClusterManagerRancher == ClusterManagerRancher +} + +func (cm ClusterManager) ManagedByOpenShift() bool { + return cm&ClusterManagerOpenShift == ClusterManagerOpenShift +} + +func (cm ClusterManager) ManagedByVirtualCluster() bool { + return cm&ClusterManagerVirtualCluster == ClusterManagerVirtualCluster +} + +func (cm ClusterManager) Strings() []string { + out := make([]string, 0, 7) + if cm.ManagedByACE() { + out = append(out, "ACE") + } + if cm.ManagedByOCMHub() { + out = append(out, "OCMHub") + } + if cm.ManagedByOCMSpoke() { + out = append(out, "OCMSpoke") + } + if cm.ManagedByOCMMulticlusterControlplane() { + out = append(out, "OCMMulticlusterControlplane") + } + if cm.ManagedByRancher() { + out = append(out, "Rancher") + } + if cm.ManagedByOpenShift() { + out = append(out, "OpenShift") + } + if cm.ManagedByVirtualCluster() { + out = append(out, "vcluster") + } + return out +} + +func isPowerOfTwo(n int) bool { + return n > 0 && (n&(n-1)) == 0 +} + +func (cm ClusterManager) Name() string { + if !isPowerOfTwo(int(cm)) { + return cm.String() + } + idx := bits.TrailingZeros(uint(cm)) + return _ClusterManagerNames[idx] +} + +func (cm ClusterManager) String() string { + return strings.Join(cm.Strings(), ",") +} diff --git a/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go b/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go index f1f0d5954..9f04f8cbb 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go +++ b/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go @@ -128,10 +128,66 @@ func (m *CertificateSpec) XXX_DiscardUnknown() { var xxx_messageInfo_CertificateSpec proto.InternalMessageInfo +func (m *ClusterClaimFeatures) Reset() { *m = ClusterClaimFeatures{} } +func (*ClusterClaimFeatures) ProtoMessage() {} +func (*ClusterClaimFeatures) Descriptor() ([]byte, []int) { + return fileDescriptor_af8e7a11c7a1ccd9, []int{3} +} +func (m *ClusterClaimFeatures) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterClaimFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ClusterClaimFeatures) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterClaimFeatures.Merge(m, src) +} +func (m *ClusterClaimFeatures) XXX_Size() int { + return m.Size() +} +func (m *ClusterClaimFeatures) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterClaimFeatures.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterClaimFeatures proto.InternalMessageInfo + +func (m *ClusterClaimInfo) Reset() { *m = ClusterClaimInfo{} } +func (*ClusterClaimInfo) ProtoMessage() {} +func (*ClusterClaimInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_af8e7a11c7a1ccd9, []int{4} +} +func (m *ClusterClaimInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterClaimInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ClusterClaimInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterClaimInfo.Merge(m, src) +} +func (m *ClusterClaimInfo) XXX_Size() int { + return m.Size() +} +func (m *ClusterClaimInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterClaimInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterClaimInfo proto.InternalMessageInfo + func (m *ClusterInfo) Reset() { *m = ClusterInfo{} } func (*ClusterInfo) ProtoMessage() {} func (*ClusterInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{3} + return fileDescriptor_af8e7a11c7a1ccd9, []int{5} } func (m *ClusterInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -159,7 +215,7 @@ var xxx_messageInfo_ClusterInfo proto.InternalMessageInfo func (m *ClusterMetadata) Reset() { *m = ClusterMetadata{} } func (*ClusterMetadata) ProtoMessage() {} func (*ClusterMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{4} + return fileDescriptor_af8e7a11c7a1ccd9, []int{6} } func (m *ClusterMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -187,7 +243,7 @@ var xxx_messageInfo_ClusterMetadata proto.InternalMessageInfo func (m *Condition) Reset() { *m = Condition{} } func (*Condition) ProtoMessage() {} func (*Condition) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{5} + return fileDescriptor_af8e7a11c7a1ccd9, []int{7} } func (m *Condition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -215,7 +271,7 @@ var xxx_messageInfo_Condition proto.InternalMessageInfo func (m *HealthCheckSpec) Reset() { *m = HealthCheckSpec{} } func (*HealthCheckSpec) ProtoMessage() {} func (*HealthCheckSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{6} + return fileDescriptor_af8e7a11c7a1ccd9, []int{8} } func (m *HealthCheckSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -243,7 +299,7 @@ var xxx_messageInfo_HealthCheckSpec proto.InternalMessageInfo func (m *ImageInfo) Reset() { *m = ImageInfo{} } func (*ImageInfo) ProtoMessage() {} func (*ImageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{7} + return fileDescriptor_af8e7a11c7a1ccd9, []int{9} } func (m *ImageInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +327,7 @@ var xxx_messageInfo_ImageInfo proto.InternalMessageInfo func (m *Lineage) Reset() { *m = Lineage{} } func (*Lineage) ProtoMessage() {} func (*Lineage) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{8} + return fileDescriptor_af8e7a11c7a1ccd9, []int{10} } func (m *Lineage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -299,7 +355,7 @@ var xxx_messageInfo_Lineage proto.InternalMessageInfo func (m *ObjectID) Reset() { *m = ObjectID{} } func (*ObjectID) ProtoMessage() {} func (*ObjectID) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{9} + return fileDescriptor_af8e7a11c7a1ccd9, []int{11} } func (m *ObjectID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -327,7 +383,7 @@ var xxx_messageInfo_ObjectID proto.InternalMessageInfo func (m *ObjectInfo) Reset() { *m = ObjectInfo{} } func (*ObjectInfo) ProtoMessage() {} func (*ObjectInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{10} + return fileDescriptor_af8e7a11c7a1ccd9, []int{12} } func (m *ObjectInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +411,7 @@ var xxx_messageInfo_ObjectInfo proto.InternalMessageInfo func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} func (*ObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{11} + return fileDescriptor_af8e7a11c7a1ccd9, []int{13} } func (m *ObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,7 +439,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo func (m *PullCredentials) Reset() { *m = PullCredentials{} } func (*PullCredentials) ProtoMessage() {} func (*PullCredentials) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{12} + return fileDescriptor_af8e7a11c7a1ccd9, []int{14} } func (m *PullCredentials) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -411,7 +467,7 @@ var xxx_messageInfo_PullCredentials proto.InternalMessageInfo func (m *ReadonlyHealthCheckSpec) Reset() { *m = ReadonlyHealthCheckSpec{} } func (*ReadonlyHealthCheckSpec) ProtoMessage() {} func (*ReadonlyHealthCheckSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{13} + return fileDescriptor_af8e7a11c7a1ccd9, []int{15} } func (m *ReadonlyHealthCheckSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -439,7 +495,7 @@ var xxx_messageInfo_ReadonlyHealthCheckSpec proto.InternalMessageInfo func (m *ResourceID) Reset() { *m = ResourceID{} } func (*ResourceID) ProtoMessage() {} func (*ResourceID) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{14} + return fileDescriptor_af8e7a11c7a1ccd9, []int{16} } func (m *ResourceID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -467,7 +523,7 @@ var xxx_messageInfo_ResourceID proto.InternalMessageInfo func (m *TLSConfig) Reset() { *m = TLSConfig{} } func (*TLSConfig) ProtoMessage() {} func (*TLSConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{15} + return fileDescriptor_af8e7a11c7a1ccd9, []int{17} } func (m *TLSConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -495,7 +551,7 @@ var xxx_messageInfo_TLSConfig proto.InternalMessageInfo func (m *TimeOfDay) Reset() { *m = TimeOfDay{} } func (*TimeOfDay) ProtoMessage() {} func (*TimeOfDay) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{16} + return fileDescriptor_af8e7a11c7a1ccd9, []int{18} } func (m *TimeOfDay) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TimeOfDay.Unmarshal(m, b) @@ -515,10 +571,38 @@ func (m *TimeOfDay) XXX_DiscardUnknown() { var xxx_messageInfo_TimeOfDay proto.InternalMessageInfo +func (m *TypeReference) Reset() { *m = TypeReference{} } +func (*TypeReference) ProtoMessage() {} +func (*TypeReference) Descriptor() ([]byte, []int) { + return fileDescriptor_af8e7a11c7a1ccd9, []int{19} +} +func (m *TypeReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TypeReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TypeReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_TypeReference.Merge(m, src) +} +func (m *TypeReference) XXX_Size() int { + return m.Size() +} +func (m *TypeReference) XXX_DiscardUnknown() { + xxx_messageInfo_TypeReference.DiscardUnknown(m) +} + +var xxx_messageInfo_TypeReference proto.InternalMessageInfo + func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} } func (*TypedObjectReference) ProtoMessage() {} func (*TypedObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{17} + return fileDescriptor_af8e7a11c7a1ccd9, []int{20} } func (m *TypedObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -546,7 +630,7 @@ var xxx_messageInfo_TypedObjectReference proto.InternalMessageInfo func (m *X509Subject) Reset() { *m = X509Subject{} } func (*X509Subject) ProtoMessage() {} func (*X509Subject) Descriptor() ([]byte, []int) { - return fileDescriptor_af8e7a11c7a1ccd9, []int{18} + return fileDescriptor_af8e7a11c7a1ccd9, []int{21} } func (m *X509Subject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -575,6 +659,8 @@ func init() { proto.RegisterType((*CAPIClusterInfo)(nil), "kmodules.xyz.client_go.api.v1.CAPIClusterInfo") proto.RegisterType((*CertificatePrivateKey)(nil), "kmodules.xyz.client_go.api.v1.CertificatePrivateKey") proto.RegisterType((*CertificateSpec)(nil), "kmodules.xyz.client_go.api.v1.CertificateSpec") + proto.RegisterType((*ClusterClaimFeatures)(nil), "kmodules.xyz.client_go.api.v1.ClusterClaimFeatures") + proto.RegisterType((*ClusterClaimInfo)(nil), "kmodules.xyz.client_go.api.v1.ClusterClaimInfo") proto.RegisterType((*ClusterInfo)(nil), "kmodules.xyz.client_go.api.v1.ClusterInfo") proto.RegisterType((*ClusterMetadata)(nil), "kmodules.xyz.client_go.api.v1.ClusterMetadata") proto.RegisterType((*Condition)(nil), "kmodules.xyz.client_go.api.v1.Condition") @@ -589,6 +675,7 @@ func init() { proto.RegisterType((*ResourceID)(nil), "kmodules.xyz.client_go.api.v1.ResourceID") proto.RegisterType((*TLSConfig)(nil), "kmodules.xyz.client_go.api.v1.TLSConfig") proto.RegisterType((*TimeOfDay)(nil), "kmodules.xyz.client_go.api.v1.TimeOfDay") + proto.RegisterType((*TypeReference)(nil), "kmodules.xyz.client_go.api.v1.TypeReference") proto.RegisterType((*TypedObjectReference)(nil), "kmodules.xyz.client_go.api.v1.TypedObjectReference") proto.RegisterType((*X509Subject)(nil), "kmodules.xyz.client_go.api.v1.X509Subject") } @@ -598,128 +685,138 @@ func init() { } var fileDescriptor_af8e7a11c7a1ccd9 = []byte{ - // 1921 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x8f, 0x1b, 0x49, - 0x15, 0x77, 0xc7, 0x9e, 0x8c, 0xfd, 0x3c, 0x89, 0x93, 0x4a, 0x50, 0x4c, 0x44, 0xdc, 0x43, 0x47, - 0x44, 0x13, 0xd8, 0xf4, 0x30, 0xa3, 0x04, 0x96, 0x15, 0x08, 0xc6, 0x76, 0x36, 0xf1, 0xee, 0x24, - 0x63, 0xca, 0x13, 0x76, 0xb5, 0x20, 0x50, 0x4d, 0x77, 0xd9, 0x53, 0x4c, 0xbb, 0xbb, 0x55, 0xd5, - 0x3d, 0xcb, 0xec, 0x69, 0x8f, 0x70, 0x5b, 0x6e, 0x1c, 0x37, 0x12, 0x7f, 0x02, 0x12, 0xe2, 0x2f, - 0x20, 0xc7, 0x70, 0x41, 0x2b, 0x81, 0x2c, 0x62, 0xae, 0x88, 0x0b, 0x02, 0xa1, 0x39, 0xa1, 0xaa, - 0xae, 0xfe, 0xb0, 0xc7, 0xb3, 0x33, 0x0b, 0x48, 0x7b, 0x73, 0xbf, 0xdf, 0xef, 0xbd, 0xfa, 0x78, - 0xaf, 0xde, 0x87, 0xe1, 0xde, 0xc1, 0x38, 0x70, 0x63, 0x8f, 0x0a, 0xfb, 0x67, 0x47, 0x1f, 0xac, - 0x3b, 0x1e, 0xa3, 0x7e, 0x74, 0x6f, 0x14, 0xac, 0x93, 0x90, 0xad, 0x1f, 0x6e, 0xac, 0x8f, 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, 0x97, 0xc0, 0xed, 0x4c, 0x8a, 0x0b, 0x0c, 0xb9, - 0x4f, 0x35, 0xaa, 0xf8, 0x0e, 0x95, 0x4d, 0x73, 0xb6, 0xcf, 0x7e, 0x2a, 0xc4, 0x39, 0x2e, 0xa7, - 0x44, 0x11, 0x71, 0x4a, 0xa3, 0x7c, 0x32, 0xbe, 0x98, 0x4f, 0x89, 0x83, 0x59, 0x08, 0xcf, 0x73, - 0xe5, 0xa0, 0x1e, 0x06, 0x22, 0x22, 0x5e, 0x27, 0x70, 0xb3, 0xa9, 0x5e, 0x0d, 0xea, 0xfd, 0x5c, - 0x8c, 0x8b, 0x1c, 0x39, 0x4b, 0x08, 0xca, 0x19, 0xf1, 0x9e, 0xc6, 0xe3, 0x3d, 0xca, 0x75, 0xbf, - 0x99, 0x05, 0xea, 0xa0, 0x80, 0xe1, 0x19, 0x66, 0xbb, 0xf3, 0xe2, 0x55, 0xab, 0xf4, 0xf2, 0x55, - 0xab, 0xf4, 0xc9, 0xab, 0x56, 0xe9, 0xc3, 0x69, 0xcb, 0x78, 0x31, 0x6d, 0x19, 0x2f, 0xa7, 0x2d, - 0xe3, 0x93, 0x69, 0xcb, 0xf8, 0xcb, 0xb4, 0x65, 0x7c, 0xf4, 0xd7, 0x56, 0xe9, 0xbd, 0x5b, 0x9f, - 0xfa, 0x67, 0xe1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, 0x7e, 0x97, 0xff, 0x4c, 0x14, 0x00, - 0x00, + // 2092 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f, 0x1c, 0x49, + 0x15, 0x77, 0x67, 0xc6, 0xf1, 0xcc, 0x1b, 0x3b, 0x93, 0x54, 0x8c, 0x32, 0x09, 0x1b, 0x4f, 0xe8, + 0x88, 0x28, 0x81, 0x4d, 0x1b, 0x47, 0x09, 0x2c, 0x2b, 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81, + 0x58, 0x1d, 0xd2, 0x90, 0xcc, 0xb0, 0x32, 0x7f, 0x63, 0x40, 0xbd, 0xbd, 0xde, 0xeb, 0xb6, 0xdd, + 0x48, 0x84, 0x94, 0x77, 0xbd, 0x3d, 0x1f, 0x7d, 0x07, 0x2a, 0x01, 0xf7, 0x47, 0xcc, 0xa1, 0xbc, + 0x61, 0xdc, 0x30, 0x6e, 0x57, 0x5b, 0x37, 0x9e, 0x8f, 0x9b, 0x73, 0x93, 0x71, 0xb3, 0xd2, 0xd3, + 0xf2, 0xa3, 0x71, 0x73, 0x51, 0x9a, 0x25, 0xff, 0x71, 0x6a, 0x81, 0x56, 0xa1, 0xea, 0x91, 0x21, + 0x15, 0x01, 0xb1, 0x69, 0xe3, 0x9c, 0x32, 0xbf, 0xa4, 0xcd, 0xab, 0x4f, 0x12, 0x05, 0xce, 0x30, + 0xe8, 0x01, 0xd4, 0xec, 0x78, 0x75, 0xa9, 0x6e, 0x94, 0x94, 0xc9, 0x65, 0x6d, 0x52, 0x6b, 0x67, + 0x2a, 0x9c, 0xc7, 0x99, 0xef, 0xc2, 0x97, 0xda, 0x94, 0x87, 0x6c, 0x8f, 0xd9, 0x24, 0xa4, 0x3d, + 0xce, 0x46, 0x24, 0xa4, 0x6f, 0xd2, 0x43, 0xd4, 0x82, 0x0a, 0xf5, 0x6c, 0xdf, 0x61, 0xde, 0x40, + 0xbb, 0x7f, 0x2b, 0x71, 0x7f, 0x43, 0xcb, 0x8f, 0xc6, 0x4d, 0x94, 0x59, 0x24, 0x52, 0x9c, 0xda, + 0x99, 0x7f, 0x9f, 0x87, 0x7a, 0x8e, 0xbd, 0x1f, 0x50, 0x1b, 0xdd, 0x84, 0x79, 0xe2, 0x32, 0x22, + 0x34, 0xe9, 0x92, 0x26, 0x9d, 0x5f, 0x97, 0x42, 0x1c, 0xeb, 0xd0, 0x3b, 0x50, 0x65, 0x42, 0x44, + 0x94, 0x63, 0xba, 0xa7, 0x76, 0x5f, 0xbb, 0x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, 0x7d, 0xb9, 0x32, 0xf7, + 0xd1, 0x64, 0xc5, 0x78, 0x3e, 0x59, 0x31, 0x5e, 0x4c, 0x56, 0x8c, 0x4f, 0x27, 0x2b, 0xc6, 0x9f, + 0x27, 0x2b, 0xc6, 0xc7, 0x7f, 0x59, 0x99, 0x7b, 0xe7, 0xfa, 0x67, 0x7e, 0x8b, 0xfe, 0x4f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x23, 0xdc, 0x56, 0x82, 0xab, 0x16, 0x00, 0x00, } func (m *CAPIClusterInfo) Marshal() (dAtA []byte, err error) { @@ -917,6 +1014,89 @@ func (m *CertificateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ClusterClaimFeatures) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterClaimFeatures) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterClaimFeatures) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DisabledFeatures) > 0 { + for iNdEx := len(m.DisabledFeatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DisabledFeatures[iNdEx]) + copy(dAtA[i:], m.DisabledFeatures[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DisabledFeatures[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.ExternallyManagedFeatures) > 0 { + for iNdEx := len(m.ExternallyManagedFeatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExternallyManagedFeatures[iNdEx]) + copy(dAtA[i:], m.ExternallyManagedFeatures[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExternallyManagedFeatures[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.EnabledFeatures) > 0 { + for iNdEx := len(m.EnabledFeatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EnabledFeatures[iNdEx]) + copy(dAtA[i:], m.EnabledFeatures[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EnabledFeatures[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ClusterClaimInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterClaimInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterClaimInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ClusterMetadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ClusterInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -991,6 +1171,16 @@ func (m *ClusterMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i -= len(m.Mode) + copy(dAtA[i:], m.Mode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Mode))) + i-- + dAtA[i] = 0x62 + i -= len(m.CloudServiceAuthMode) + copy(dAtA[i:], m.CloudServiceAuthMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CloudServiceAuthMode))) + i-- + dAtA[i] = 0x5a i -= len(m.HubClusterID) copy(dAtA[i:], m.HubClusterID) i = encodeVarintGenerated(dAtA, i, uint64(len(m.HubClusterID))) @@ -1547,6 +1737,39 @@ func (m *TLSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TypeReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TypeReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TypeReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + i -= len(m.APIGroup) + copy(dAtA[i:], m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *TypedObjectReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1775,6 +1998,44 @@ func (m *CertificateSpec) Size() (n int) { return n } +func (m *ClusterClaimFeatures) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.EnabledFeatures) > 0 { + for _, s := range m.EnabledFeatures { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ExternallyManagedFeatures) > 0 { + for _, s := range m.ExternallyManagedFeatures { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.DisabledFeatures) > 0 { + for _, s := range m.DisabledFeatures { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ClusterClaimInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ClusterMetadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *ClusterInfo) Size() (n int) { if m == nil { return 0 @@ -1824,6 +2085,10 @@ func (m *ClusterMetadata) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.HubClusterID) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.CloudServiceAuthMode) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Mode) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -2021,6 +2286,19 @@ func (m *TLSConfig) Size() (n int) { return n } +func (m *TypeReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *TypedObjectReference) Size() (n int) { if m == nil { return 0 @@ -2139,6 +2417,28 @@ func (this *CertificateSpec) String() string { }, "") return s } +func (this *ClusterClaimFeatures) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterClaimFeatures{`, + `EnabledFeatures:` + fmt.Sprintf("%v", this.EnabledFeatures) + `,`, + `ExternallyManagedFeatures:` + fmt.Sprintf("%v", this.ExternallyManagedFeatures) + `,`, + `DisabledFeatures:` + fmt.Sprintf("%v", this.DisabledFeatures) + `,`, + `}`, + }, "") + return s +} +func (this *ClusterClaimInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterClaimInfo{`, + `ClusterMetadata:` + strings.Replace(strings.Replace(this.ClusterMetadata.String(), "ClusterInfo", "ClusterInfo", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *ClusterInfo) String() string { if this == nil { return "nil" @@ -2167,6 +2467,8 @@ func (this *ClusterMetadata) String() string { `CABundle:` + fmt.Sprintf("%v", this.CABundle) + `,`, `ManagerID:` + fmt.Sprintf("%v", this.ManagerID) + `,`, `HubClusterID:` + fmt.Sprintf("%v", this.HubClusterID) + `,`, + `CloudServiceAuthMode:` + fmt.Sprintf("%v", this.CloudServiceAuthMode) + `,`, + `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, `}`, }, "") return s @@ -2325,6 +2627,17 @@ func (this *TLSConfig) String() string { }, "") return s } +func (this *TypeReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TypeReference{`, + `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `}`, + }, "") + return s +} func (this *TypedObjectReference) String() string { if this == nil { return "nil" @@ -3013,7 +3326,7 @@ func (m *CertificateSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClusterInfo) Unmarshal(dAtA []byte) error { +func (m *ClusterClaimFeatures) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3036,15 +3349,15 @@ func (m *ClusterInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClusterInfo: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterClaimFeatures: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterClaimFeatures: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EnabledFeatures", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3072,11 +3385,11 @@ func (m *ClusterInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UID = string(dAtA[iNdEx:postIndex]) + m.EnabledFeatures = append(m.EnabledFeatures, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExternallyManagedFeatures", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3104,11 +3417,11 @@ func (m *ClusterInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.ExternallyManagedFeatures = append(m.ExternallyManagedFeatures, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterManagers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DisabledFeatures", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3136,11 +3449,240 @@ func (m *ClusterInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClusterManagers = append(m.ClusterManagers, string(dAtA[iNdEx:postIndex])) + m.DisabledFeatures = append(m.DisabledFeatures, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CAPI", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterClaimInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterClaimInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterClaimInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClusterMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterManagers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClusterManagers = append(m.ClusterManagers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CAPI", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3544,6 +4086,70 @@ func (m *ClusterMetadata) Unmarshal(dAtA []byte) error { } m.HubClusterID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CloudServiceAuthMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CloudServiceAuthMode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mode = ClusterMode(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -5194,6 +5800,120 @@ func (m *TLSConfig) Unmarshal(dAtA []byte) error { } return nil } +func (m *TypeReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TypeReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TypeReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/kmodules.xyz/client-go/api/v1/generated.proto b/vendor/kmodules.xyz/client-go/api/v1/generated.proto index a6b1e76b1..c3a8864e2 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/generated.proto +++ b/vendor/kmodules.xyz/client-go/api/v1/generated.proto @@ -99,6 +99,18 @@ message CertificateSpec { optional CertificatePrivateKey privateKey = 11; } +message ClusterClaimFeatures { + repeated string enabledFeatures = 1; + + repeated string externallyManagedFeatures = 2; + + repeated string disabledFeatures = 3; +} + +message ClusterClaimInfo { + optional ClusterInfo clusterMetadata = 1; +} + // ClusterInfo used in ace-installer message ClusterInfo { optional string uid = 1; @@ -131,6 +143,10 @@ message ClusterMetadata { optional string managerID = 9; optional string hubClusterID = 10; + + optional string cloudServiceAuthMode = 11; + + optional string mode = 12; } // Condition defines an observation of a object operational state. @@ -292,7 +308,14 @@ message TLSConfig { message TimeOfDay { } -// TypedObjectReference represents an typed namespaced object. +// TypeReference represents an object type. +message TypeReference { + optional string apiGroup = 1; + + optional string kind = 2; +} + +// TypedObjectReference represents a typed namespaced object. message TypedObjectReference { optional string apiGroup = 1; diff --git a/vendor/kmodules.xyz/client-go/api/v1/object.go b/vendor/kmodules.xyz/client-go/api/v1/object.go index 92035935a..90e50df87 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/object.go +++ b/vendor/kmodules.xyz/client-go/api/v1/object.go @@ -158,8 +158,8 @@ func MustParseObjectID(key OID) *ObjectID { return oid } -func ObjectIDMap(key OID) (map[string]interface{}, error) { - id := map[string]interface{}{ +func ObjectIDMap(key OID) (map[string]any, error) { + id := map[string]any{ "group": "", "kind": "", "namespace": "", diff --git a/vendor/kmodules.xyz/client-go/api/v1/object_enum.go b/vendor/kmodules.xyz/client-go/api/v1/object_enum.go index 954a1ef8b..ba68f4448 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/object_enum.go +++ b/vendor/kmodules.xyz/client-go/api/v1/object_enum.go @@ -1,8 +1,7 @@ // Code generated by go-enum DO NOT EDIT. -// Version: -// Revision: -// Build Date: -// Built By: +// Version: v0.9.2 + +// Built By: go install package v1 diff --git a/vendor/kmodules.xyz/client-go/api/v1/timeofday.go b/vendor/kmodules.xyz/client-go/api/v1/timeofday.go index 88ea1a8ba..5d6310a44 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/timeofday.go +++ b/vendor/kmodules.xyz/client-go/api/v1/timeofday.go @@ -164,7 +164,7 @@ func (t TimeOfDay) MarshalJSON() ([]byte, error) { } // ToUnstructured implements the value.UnstructuredConverter interface. -func (t TimeOfDay) ToUnstructured() interface{} { +func (t TimeOfDay) ToUnstructured() any { if t.IsZero() { return nil } @@ -177,11 +177,11 @@ func (t TimeOfDay) ToUnstructured() interface{} { // the OpenAPI spec of this type. // // See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ TimeOfDay) OpenAPISchemaType() []string { return []string{"string"} } +func (TimeOfDay) OpenAPISchemaType() []string { return []string{"string"} } // OpenAPISchemaFormat is used by the kube-openapi generator when constructing // the OpenAPI spec of this type. -func (_ TimeOfDay) OpenAPISchemaFormat() string { return "time" } +func (TimeOfDay) OpenAPISchemaFormat() string { return "time" } // MarshalQueryParameter converts to a URL query parameter value func (t TimeOfDay) MarshalQueryParameter() (string, error) { @@ -201,7 +201,7 @@ func (t *TimeOfDay) Fuzz(c fuzz.Continue) { // Allow for about 1000 years of randomness. Leave off nanoseconds // because JSON doesn't represent them so they can't round-trip // properly. - t.Time = time.Unix(c.Rand.Int63n(1000*365*24*60*60), 0) + t.Time = time.Unix(c.Int63n(1000*365*24*60*60), 0) } // ensure Time implements fuzz.Interface diff --git a/vendor/kmodules.xyz/client-go/cluster/host_detector.go b/vendor/kmodules.xyz/client-go/cluster/host_detector.go index f10bbbd9f..4f974ec25 100644 --- a/vendor/kmodules.xyz/client-go/cluster/host_detector.go +++ b/vendor/kmodules.xyz/client-go/cluster/host_detector.go @@ -50,12 +50,12 @@ func TestGKE() (string, error) { if err != nil { return "", err } - defer resp.Body.Close() + defer resp.Body.Close() // nolint:errcheck body, err := io.ReadAll(resp.Body) if err != nil { return "", err } - content := make(map[string]interface{}) + content := make(map[string]any) err = yaml.Unmarshal(body, &content) if err != nil { return "", err diff --git a/vendor/kmodules.xyz/client-go/cluster/lib.go b/vendor/kmodules.xyz/client-go/cluster/lib.go index 96dedd6d5..86fe1aa93 100644 --- a/vendor/kmodules.xyz/client-go/cluster/lib.go +++ b/vendor/kmodules.xyz/client-go/cluster/lib.go @@ -56,7 +56,7 @@ func ClusterMetadata(c client.Reader) (*kmapi.ClusterMetadata, error) { var cm core.ConfigMap err = c.Get(context.TODO(), client.ObjectKey{Name: kmapi.AceInfoConfigMapName, Namespace: metav1.NamespacePublic}, &cm) if err == nil { - result, err := ClusterMetadataFromConfigMap(&cm, string(ns.UID)) + result, err := ClusterMetadataFromConfigMap(&cm, DetectClusterMode(&ns), string(ns.UID)) if err == nil { return result, nil } @@ -67,6 +67,14 @@ func ClusterMetadata(c client.Reader) (*kmapi.ClusterMetadata, error) { return LegacyClusterMetadataFromNamespace(&ns) } +func DetectClusterMode(ns *core.Namespace) kmapi.ClusterMode { + v := ns.Annotations[kmapi.ClusterModeKey] + if mode, err := kmapi.ParseClusterMode(v); err == nil { + return mode + } + return kmapi.ClusterModeProd +} + func LegacyClusterMetadataFromNamespace(ns *core.Namespace) (*kmapi.ClusterMetadata, error) { if ns.Name != metav1.NamespaceSystem { return nil, fmt.Errorf("expected namespace %s, found namespace %s", metav1.NamespaceSystem, ns.Name) @@ -80,11 +88,12 @@ func LegacyClusterMetadataFromNamespace(ns *core.Namespace) (*kmapi.ClusterMetad Name: name, DisplayName: ns.Annotations[kmapi.ClusterDisplayNameKey], Provider: kmapi.HostingProvider(ns.Annotations[kmapi.ClusterProviderNameKey]), + Mode: DetectClusterMode(ns), } return md, nil } -func ClusterMetadataFromConfigMap(cm *core.ConfigMap, clusterUIDVerifier string) (*kmapi.ClusterMetadata, error) { +func ClusterMetadataFromConfigMap(cm *core.ConfigMap, mode kmapi.ClusterMode, clusterUIDVerifier string) (*kmapi.ClusterMetadata, error) { if cm.Name != kmapi.AceInfoConfigMapName || cm.Namespace != metav1.NamespacePublic { return nil, fmt.Errorf("expected configmap %s/%s, found %s/%s", metav1.NamespacePublic, kmapi.AceInfoConfigMapName, cm.Namespace, cm.Name) } @@ -116,6 +125,7 @@ func ClusterMetadataFromConfigMap(cm *core.ConfigMap, clusterUIDVerifier string) if md.Name == "" { md.Name = ClusterName() } + md.Mode = mode return md, nil } @@ -182,6 +192,10 @@ func DetectCAPICluster(kc client.Reader) (*kmapi.CAPIClusterInfo, error) { return nil, err } + if getProviderName(capiProvider) == "" { + return nil, nil + } + return &kmapi.CAPIClusterInfo{ Provider: getProviderName(capiProvider), Namespace: ns, diff --git a/vendor/kmodules.xyz/client-go/conditions/getter.go b/vendor/kmodules.xyz/client-go/conditions/getter.go index b915573eb..4bfa177a6 100644 --- a/vendor/kmodules.xyz/client-go/conditions/getter.go +++ b/vendor/kmodules.xyz/client-go/conditions/getter.go @@ -223,7 +223,7 @@ func mirror(from Getter, targetCondition kmapi.ConditionType, options ...MirrorO case true: condition = TrueCondition(targetCondition) case false: - condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, mirrorOpt.fallbackMessage) //nolint:govet + condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, "%s", mirrorOpt.fallbackMessage) } } diff --git a/vendor/kmodules.xyz/client-go/conditions/matcher.go b/vendor/kmodules.xyz/client-go/conditions/matcher.go index f79d2b413..43a161512 100644 --- a/vendor/kmodules.xyz/client-go/conditions/matcher.go +++ b/vendor/kmodules.xyz/client-go/conditions/matcher.go @@ -36,8 +36,8 @@ type matchConditions struct { expected kmapi.Conditions } -func (m matchConditions) Match(actual interface{}) (success bool, err error) { - elems := []interface{}{} +func (m matchConditions) Match(actual any) (success bool, err error) { + elems := []any{} for _, condition := range m.expected { elems = append(elems, MatchCondition(condition)) } @@ -45,11 +45,11 @@ func (m matchConditions) Match(actual interface{}) (success bool, err error) { return gomega.ConsistOf(elems).Match(actual) } -func (m matchConditions) FailureMessage(actual interface{}) (message string) { +func (m matchConditions) FailureMessage(actual any) (message string) { return fmt.Sprintf("expected\n\t%#v\nto match\n\t%#v\n", actual, m.expected) } -func (m matchConditions) NegatedFailureMessage(actual interface{}) (message string) { +func (m matchConditions) NegatedFailureMessage(actual any) (message string) { return fmt.Sprintf("expected\n\t%#v\nto not match\n\t%#v\n", actual, m.expected) } @@ -64,7 +64,7 @@ type matchCondition struct { expected kmapi.Condition } -func (m matchCondition) Match(actual interface{}) (success bool, err error) { +func (m matchCondition) Match(actual any) (success bool, err error) { actualCondition, ok := actual.(kmapi.Condition) if !ok { return false, fmt.Errorf("actual should be of type Condition") @@ -94,10 +94,10 @@ func (m matchCondition) Match(actual interface{}) (success bool, err error) { return ok, err } -func (m matchCondition) FailureMessage(actual interface{}) (message string) { +func (m matchCondition) FailureMessage(actual any) (message string) { return fmt.Sprintf("expected\n\t%#v\nto match\n\t%#v\n", actual, m.expected) } -func (m matchCondition) NegatedFailureMessage(actual interface{}) (message string) { +func (m matchCondition) NegatedFailureMessage(actual any) (message string) { return fmt.Sprintf("expected\n\t%#v\nto not match\n\t%#v\n", actual, m.expected) } diff --git a/vendor/kmodules.xyz/client-go/conditions/matchers.go b/vendor/kmodules.xyz/client-go/conditions/matchers.go index 508932205..f35e606d0 100644 --- a/vendor/kmodules.xyz/client-go/conditions/matchers.go +++ b/vendor/kmodules.xyz/client-go/conditions/matchers.go @@ -36,7 +36,7 @@ type conditionMatcher struct { Expected *kmapi.Condition } -func (matcher *conditionMatcher) Match(actual interface{}) (success bool, err error) { +func (matcher *conditionMatcher) Match(actual any) (success bool, err error) { actualCondition, ok := actual.(*kmapi.Condition) if !ok { return false, errors.New("value should be a condition") @@ -45,10 +45,10 @@ func (matcher *conditionMatcher) Match(actual interface{}) (success bool, err er return hasSameState(actualCondition, matcher.Expected), nil } -func (matcher *conditionMatcher) FailureMessage(actual interface{}) (message string) { +func (matcher *conditionMatcher) FailureMessage(actual any) (message string) { return format.Message(actual, "to have the same state of", matcher.Expected) } -func (matcher *conditionMatcher) NegatedFailureMessage(actual interface{}) (message string) { +func (matcher *conditionMatcher) NegatedFailureMessage(actual any) (message string) { return format.Message(actual, "not to have the same state of", matcher.Expected) } diff --git a/vendor/kmodules.xyz/client-go/conditions/merge.go b/vendor/kmodules.xyz/client-go/conditions/merge.go index e1ab6bc6e..ba18d905b 100644 --- a/vendor/kmodules.xyz/client-go/conditions/merge.go +++ b/vendor/kmodules.xyz/client-go/conditions/merge.go @@ -32,9 +32,9 @@ type localizedCondition struct { } // merge a list of condition into a single one. -// This operation is designed to ensure visibility of the most relevant util for defining the +// This operation is designed to ensure visibility of the most relevant conditions for defining the // operational state of a component. E.g. If there is one error in the condition list, this one takes -// priority over the other util, and it should be reflected in the target condition. +// priority over the other conditions and it is should be reflected in the target condition. // // More specifically: // 1. Conditions are grouped by status, severity @@ -63,11 +63,10 @@ func merge(conditions []localizedCondition, targetCondition kmapi.ConditionType, targetReason := getReason(g, options) targetMessage := getMessage(g, options) - if g.TopGroup().status == metav1.ConditionFalse { - return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, targetMessage) //nolint:govet + return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, "%s", targetMessage) } - return UnknownCondition(targetCondition, targetReason, targetMessage) //nolint:govet + return UnknownCondition(targetCondition, targetReason, "%s", targetMessage) } // getConditionGroups groups a list of conditions according to status, severity values. diff --git a/vendor/kmodules.xyz/client-go/conditions/setter.go b/vendor/kmodules.xyz/client-go/conditions/setter.go index eb9bf49f7..0e6b95de5 100644 --- a/vendor/kmodules.xyz/client-go/conditions/setter.go +++ b/vendor/kmodules.xyz/client-go/conditions/setter.go @@ -88,7 +88,7 @@ func TrueCondition(t kmapi.ConditionType) *kmapi.Condition { } // FalseCondition returns a condition with Status=False and the given type. -func FalseCondition(t kmapi.ConditionType, reason string, severity kmapi.ConditionSeverity, messageFormat string, messageArgs ...interface{}) *kmapi.Condition { +func FalseCondition(t kmapi.ConditionType, reason string, severity kmapi.ConditionSeverity, messageFormat string, messageArgs ...any) *kmapi.Condition { return &kmapi.Condition{ Type: t, Status: metav1.ConditionFalse, @@ -99,7 +99,7 @@ func FalseCondition(t kmapi.ConditionType, reason string, severity kmapi.Conditi } // UnknownCondition returns a condition with Status=Unknown and the given type. -func UnknownCondition(t kmapi.ConditionType, reason string, messageFormat string, messageArgs ...interface{}) *kmapi.Condition { +func UnknownCondition(t kmapi.ConditionType, reason string, messageFormat string, messageArgs ...any) *kmapi.Condition { return &kmapi.Condition{ Type: t, Status: metav1.ConditionUnknown, @@ -114,12 +114,12 @@ func MarkTrue(to Setter, t kmapi.ConditionType) { } // MarkUnknown sets Status=Unknown for the condition with the given type. -func MarkUnknown(to Setter, t kmapi.ConditionType, reason, messageFormat string, messageArgs ...interface{}) { +func MarkUnknown(to Setter, t kmapi.ConditionType, reason, messageFormat string, messageArgs ...any) { Set(to, UnknownCondition(t, reason, messageFormat, messageArgs...)) } // MarkFalse sets Status=False for the condition with the given type. -func MarkFalse(to Setter, t kmapi.ConditionType, reason string, severity kmapi.ConditionSeverity, messageFormat string, messageArgs ...interface{}) { +func MarkFalse(to Setter, t kmapi.ConditionType, reason string, severity kmapi.ConditionSeverity, messageFormat string, messageArgs ...any) { Set(to, FalseCondition(t, reason, severity, messageFormat, messageArgs...)) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index 1b7ed9e41..9a5c5ef10 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -260,7 +260,7 @@ func GetVolumeMountByName(volumeMounts []core.VolumeMount, name string) *core.Vo func UpsertVolumeMount(mounts []core.VolumeMount, nv ...core.VolumeMount) []core.VolumeMount { upsert := func(m core.VolumeMount) { for i, vol := range mounts { - if vol.Name == m.Name { + if vol.MountPath == m.MountPath { mounts[i] = m return } diff --git a/vendor/kmodules.xyz/client-go/meta/annotations.go b/vendor/kmodules.xyz/client-go/meta/annotations.go index 4ffdd4e50..0718696c5 100644 --- a/vendor/kmodules.xyz/client-go/meta/annotations.go +++ b/vendor/kmodules.xyz/client-go/meta/annotations.go @@ -23,7 +23,7 @@ import ( kutil "kmodules.xyz/client-go" ) -type ParserFunc func(map[string]string, string) (interface{}, error) +type ParserFunc func(map[string]string, string) (any, error) var ( _ ParserFunc = GetBool @@ -35,7 +35,7 @@ var ( _ ParserFunc = GetDuration ) -func GetBool(m map[string]string, key string) (interface{}, error) { +func GetBool(m map[string]string, key string) (any, error) { if m == nil { return false, kutil.ErrNotFound } @@ -51,7 +51,7 @@ func GetBoolValue(m map[string]string, key string) (bool, error) { return v.(bool), err } -func GetInt(m map[string]string, key string) (interface{}, error) { +func GetInt(m map[string]string, key string) (any, error) { if m == nil { return 0, kutil.ErrNotFound } @@ -67,7 +67,7 @@ func GetIntValue(m map[string]string, key string) (int, error) { return v.(int), err } -func GetString(m map[string]string, key string) (interface{}, error) { +func GetString(m map[string]string, key string) (any, error) { if m == nil { return "", kutil.ErrNotFound } @@ -99,7 +99,7 @@ func RemoveKey(m map[string]string, key string) map[string]string { return m } -func GetList(m map[string]string, key string) (interface{}, error) { +func GetList(m map[string]string, key string) (any, error) { if m == nil { return []string{}, kutil.ErrNotFound } @@ -117,7 +117,7 @@ func GetListValue(m map[string]string, key string) ([]string, error) { return v.([]string), err } -func GetMap(m map[string]string, key string) (interface{}, error) { +func GetMap(m map[string]string, key string) (any, error) { if m == nil { return map[string]string{}, kutil.ErrNotFound } @@ -135,7 +135,7 @@ func GetMapValue(m map[string]string, key string) (map[string]string, error) { return v.(map[string]string), err } -func GetFloat(m map[string]string, key string) (interface{}, error) { +func GetFloat(m map[string]string, key string) (any, error) { if m == nil { return 0.0, kutil.ErrNotFound } @@ -152,7 +152,7 @@ func GetFloatValue(m map[string]string, key string) (float64, error) { return v.(float64), err } -func GetDuration(m map[string]string, key string) (interface{}, error) { +func GetDuration(m map[string]string, key string) (any, error) { if m == nil { return time.Duration(0), kutil.ErrNotFound } @@ -169,10 +169,10 @@ func GetDurationValue(m map[string]string, key string) (time.Duration, error) { return v.(time.Duration), err } -type GetFunc func(map[string]string) (interface{}, error) +type GetFunc func(map[string]string) (any, error) func ParseFor(key string, fn ParserFunc) GetFunc { - return func(m map[string]string) (interface{}, error) { + return func(m map[string]string) (any, error) { return fn(m, key) } } diff --git a/vendor/kmodules.xyz/client-go/meta/cmp.go b/vendor/kmodules.xyz/client-go/meta/cmp.go index 101583a6d..5258b3d92 100644 --- a/vendor/kmodules.xyz/client-go/meta/cmp.go +++ b/vendor/kmodules.xyz/client-go/meta/cmp.go @@ -40,11 +40,11 @@ var cmpOptions = []cmp.Option{ }), } -func Diff(x, y interface{}) string { +func Diff(x, y any) string { return cmp.Diff(x, y, cmpOptions...) } -func Equal(x, y interface{}) bool { +func Equal(x, y any) bool { return cmp.Equal(x, y, cmpOptions...) } @@ -75,7 +75,7 @@ func EqualAnnotation(x, y map[string]string) bool { return true } -func JsonDiff(old, new interface{}) (string, error) { +func JsonDiff(old, new any) (string, error) { json := jsoniter.ConfigFastest oldBytes, err := json.Marshal(old) if err != nil { @@ -94,7 +94,7 @@ func JsonDiff(old, new interface{}) (string, error) { return "", err } - var aJson map[string]interface{} + var aJson map[string]any if err := json.Unmarshal(oldBytes, &aJson); err != nil { return "", err } diff --git a/vendor/kmodules.xyz/client-go/meta/dataformat.go b/vendor/kmodules.xyz/client-go/meta/dataformat.go index 6fd675ca6..bc3ad53f7 100644 --- a/vendor/kmodules.xyz/client-go/meta/dataformat.go +++ b/vendor/kmodules.xyz/client-go/meta/dataformat.go @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/yaml" ) -func DecodeObject(in interface{}, out interface{}) error { +func DecodeObject(in any, out any) error { config := &mapstructure.DecoderConfig{ Metadata: nil, TagName: "json", @@ -56,10 +56,11 @@ func NewDataFormat(format string, def DataFormat) DataFormat { } } -func Marshal(v interface{}, format DataFormat) ([]byte, error) { - if format == JsonFormat { +func Marshal(v any, format DataFormat) ([]byte, error) { + switch format { + case JsonFormat: return json.Marshal(v) - } else if format == YAMLFormat { + case YAMLFormat: return yaml.Marshal(v) } return nil, fmt.Errorf("unknonw format: %v", format) diff --git a/vendor/kmodules.xyz/client-go/meta/encoding.go b/vendor/kmodules.xyz/client-go/meta/encoding.go index abaa4f0ed..1ba1b120f 100644 --- a/vendor/kmodules.xyz/client-go/meta/encoding.go +++ b/vendor/kmodules.xyz/client-go/meta/encoding.go @@ -149,7 +149,7 @@ func UnmarshalFromJSON(data []byte, gv schema.GroupVersion) (runtime.Object, err // // WARNING: `json` tags are not respected when struct converted to map[string]interface{} // WARNING: Embedded structs are not decoded properly: https://github.com/mitchellh/mapstructure/pull/80 -func Decode(input interface{}, output interface{}) error { +func Decode(input any, output any) error { config := &mapstructure.DecoderConfig{ DecodeHook: StringToQuantityHookFunc(), Metadata: nil, @@ -169,8 +169,8 @@ func StringToQuantityHookFunc() mapstructure.DecodeHookFunc { return func( f reflect.Type, t reflect.Type, - data interface{}, - ) (interface{}, error) { + data any, + ) (any, error) { if f.Kind() != reflect.String { return data, nil } diff --git a/vendor/kmodules.xyz/client-go/meta/hash.go b/vendor/kmodules.xyz/client-go/meta/hash.go index 0e7778f4f..b8f2ec165 100644 --- a/vendor/kmodules.xyz/client-go/meta/hash.go +++ b/vendor/kmodules.xyz/client-go/meta/hash.go @@ -44,7 +44,7 @@ func ResourceHash(obj metav1.Object) string { // ObjectHash includes all top label fields (like data, spec) except TypeMeta, ObjectMeta and Status // also includes Generation, Annotation and Labels form ObjectMeta func ObjectHash(in metav1.Object) string { - obj := make(map[string]interface{}) + obj := make(map[string]any) obj["generation"] = in.GetGeneration() if len(in.GetLabels()) > 0 { @@ -84,7 +84,7 @@ func ObjectHash(in metav1.Object) string { } func GenerationHash(in metav1.Object) string { - obj := make(map[string]interface{}, 3) + obj := make(map[string]any, 3) obj["generation"] = in.GetGeneration() if len(in.GetLabels()) > 0 { obj["labels"] = in.GetLabels() @@ -106,7 +106,7 @@ func GenerationHash(in metav1.Object) string { // DeepHashObject writes specified object to hash using the spew library // which follows pointers and prints actual values of the nested objects // ensuring the hash does not change when a pointer changes. -func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { +func DeepHashObject(hasher hash.Hash, objectToWrite any) { hasher.Reset() printer := spew.ConfigState{ Indent: " ", @@ -114,10 +114,10 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { DisableMethods: true, SpewKeys: true, } - printer.Fprintf(hasher, "%#v", objectToWrite) + _, _ = printer.Fprintf(hasher, "%#v", objectToWrite) } -func MustAlreadyReconciled(o interface{}) bool { +func MustAlreadyReconciled(o any) bool { reconciled, err := AlreadyReconciled(o) if err != nil { panic("failed to extract status.observedGeneration field due to err:" + err.Error()) @@ -125,7 +125,7 @@ func MustAlreadyReconciled(o interface{}) bool { return reconciled } -func AlreadyReconciled(o interface{}) (bool, error) { +func AlreadyReconciled(o any) (bool, error) { var generation, observedGeneration int64 var err error diff --git a/vendor/kmodules.xyz/client-go/meta/lib.go b/vendor/kmodules.xyz/client-go/meta/lib.go index bf456b8f9..0e6f761e2 100644 --- a/vendor/kmodules.xyz/client-go/meta/lib.go +++ b/vendor/kmodules.xyz/client-go/meta/lib.go @@ -31,6 +31,7 @@ import ( // ref: https://github.com/kubernetes-sigs/application/blob/4ead7f1b87048b7717b3e474a21fdc07e6bce636/pkg/controller/application/application_controller.go#L28 const ( NameLabelKey = "app.kubernetes.io/name" + NamespaceLabelKey = "app.kubernetes.io/namespace" VersionLabelKey = "app.kubernetes.io/version" InstanceLabelKey = "app.kubernetes.io/instance" PartOfLabelKey = "app.kubernetes.io/part-of" @@ -67,7 +68,7 @@ func DeleteInForeground() metav1.DeleteOptions { return metav1.DeleteOptions{PropagationPolicy: &policy} } -func GetKind(v interface{}) string { +func GetKind(v any) string { return reflect.Indirect(reflect.ValueOf(v)).Type().Name() } diff --git a/vendor/kmodules.xyz/client-go/meta/patch.go b/vendor/kmodules.xyz/client-go/meta/patch.go index 10d5e8a69..db8c227a8 100644 --- a/vendor/kmodules.xyz/client-go/meta/patch.go +++ b/vendor/kmodules.xyz/client-go/meta/patch.go @@ -29,14 +29,14 @@ import ( var json = jsoniter.ConfigFastest -func toJson(v interface{}) ([]byte, error) { +func toJson(v any) ([]byte, error) { if u, ok := v.([]byte); ok { return u, nil } return json.Marshal(v) } -func CreateStrategicPatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error) { +func CreateStrategicPatch(cur any, mod any, fns ...mergepatch.PreconditionFunc) ([]byte, error) { curJson, err := toJson(cur) if err != nil { return nil, err @@ -50,7 +50,7 @@ func CreateStrategicPatch(cur interface{}, mod interface{}, fns ...mergepatch.Pr return strategicpatch.CreateTwoWayMergePatch(curJson, modJson, mod, fns...) } -func CreateJSONMergePatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error) { +func CreateJSONMergePatch(cur any, mod any, fns ...mergepatch.PreconditionFunc) ([]byte, error) { curJson, err := toJson(cur) if err != nil { return nil, err @@ -72,7 +72,7 @@ func CreateJSONMergePatch(cur interface{}, mod interface{}, fns ...mergepatch.Pr return patch, nil } -func CreateJSONPatch(cur interface{}, mod interface{}) ([]byte, error) { +func CreateJSONPatch(cur any, mod any) ([]byte, error) { curJson, err := toJson(cur) if err != nil { return nil, err @@ -93,7 +93,7 @@ func CreateJSONPatch(cur interface{}, mod interface{}) ([]byte, error) { // Apply the preconditions to the patch, and return an error if any of them fail. // ref: https://github.com/kubernetes/apimachinery/blob/master/pkg/util/jsonmergepatch/patch.go#L74 func meetPreconditions(patch []byte, fns ...mergepatch.PreconditionFunc) error { - var patchMap map[string]interface{} + var patchMap map[string]any if err := json.Unmarshal(patch, &patchMap); err != nil { return fmt.Errorf("failed to unmarshal patch for precondition check: %s", patch) } @@ -115,8 +115,8 @@ func meetPreconditions(patch []byte, fns ...mergepatch.PreconditionFunc) error { // ref: https://github.com/kubernetes/apimachinery/blob/master/pkg/util/mergepatch/util.go#L30 func RequireChainKeyUnchanged(key string) mergepatch.PreconditionFunc { - return func(patch interface{}) bool { - patchMap, ok := patch.(map[string]interface{}) + return func(patch any) bool { + patchMap, ok := patch.(map[string]any) if !ok { fmt.Println("Invalid data") return true @@ -125,7 +125,7 @@ func RequireChainKeyUnchanged(key string) mergepatch.PreconditionFunc { } } -func checkChainKeyUnchanged(key string, mapData map[string]interface{}) bool { +func checkChainKeyUnchanged(key string, mapData map[string]any) bool { keys := strings.Split(key, ".") newKey := strings.Join(keys[1:], ".") @@ -134,7 +134,7 @@ func checkChainKeyUnchanged(key string, mapData map[string]interface{}) bool { return true } for _, val := range mapData { - if !checkChainKeyUnchanged(newKey, val.(map[string]interface{})) { + if !checkChainKeyUnchanged(newKey, val.(map[string]any)) { return false } } @@ -143,13 +143,13 @@ func checkChainKeyUnchanged(key string, mapData map[string]interface{}) bool { if !ok || len(keys) == 1 { return !ok } - if x, ok := values.([]interface{}); ok { + if x, ok := values.([]any); ok { // x is of type []Interface for _, val := range x { - return checkChainKeyUnchanged(newKey, val.(map[string]interface{})) + return checkChainKeyUnchanged(newKey, val.(map[string]any)) } } - return checkChainKeyUnchanged(newKey, values.(map[string]interface{})) + return checkChainKeyUnchanged(newKey, values.(map[string]any)) } return true } diff --git a/vendor/kmodules.xyz/client-go/meta/status.go b/vendor/kmodules.xyz/client-go/meta/status.go index efa436837..893fe26b0 100644 --- a/vendor/kmodules.xyz/client-go/meta/status.go +++ b/vendor/kmodules.xyz/client-go/meta/status.go @@ -33,7 +33,7 @@ type Condition struct { ObservedGeneration int64 `json:"observedGeneration,omitempty"` } -func StatusEqual(old, new interface{}) bool { +func StatusEqual(old, new any) bool { oldStatus, oldExists := extractStatusFromObject(old) newStatus, newExists := extractStatusFromObject(new) if oldExists && newExists { @@ -48,7 +48,7 @@ func StatusEqual(old, new interface{}) bool { return !oldExists && !newExists } -func StatusConditionAwareEqual(old, new interface{}) bool { +func StatusConditionAwareEqual(old, new any) bool { oldStatus, oldExists := extractStatusFromObject(old) newStatus, newExists := extractStatusFromObject(new) if oldExists && newExists { @@ -61,7 +61,7 @@ func StatusConditionAwareEqual(old, new interface{}) bool { var result bool if oldKind == reflect.Map { - result = statusMapEqual(oldStatus.(map[string]interface{}), newStatus.(map[string]interface{})) + result = statusMapEqual(oldStatus.(map[string]any), newStatus.(map[string]any)) } else { oldStruct := structs.New(oldStatus) oldStruct.TagName = "json" @@ -81,7 +81,7 @@ func StatusConditionAwareEqual(old, new interface{}) bool { return !oldExists && !newExists } -func extractStatusFromObject(o interface{}) (interface{}, bool) { +func extractStatusFromObject(o any) (any, bool) { switch obj := o.(type) { case *unstructured.Unstructured: v, ok, _ := unstructured.NestedFieldNoCopy(obj.Object, "status") @@ -114,7 +114,7 @@ func conditionsEqual(old, nu []Condition) bool { return true } -func statusMapEqual(old, nu map[string]interface{}) bool { +func statusMapEqual(old, nu map[string]any) bool { // optimization if len(old) != len(nu) { return false diff --git a/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go index 8b44af024..eba09778a 100644 --- a/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go @@ -19178,6 +19178,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/vaultserver_version_helpers.go b/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/vaultserver_version_helpers.go index 2733c31a1..f476a57a3 100644 --- a/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/vaultserver_version_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/catalog/v1alpha1/vaultserver_version_helpers.go @@ -22,7 +22,7 @@ import ( "kmodules.xyz/client-go/apiextensions" ) -func (_ VaultServerVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (v VaultServerVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceVaultServerVersions)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go index 13f4201fa..38b4d3e7e 100644 --- a/vendor/kubevault.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go @@ -19175,6 +19175,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/aws_role_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/aws_role_helpers.go index fdb927966..b5a221b20 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/aws_role_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/aws_role_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ AWSRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r AWSRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceAWSRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/azure_role_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/azure_role_helpers.go index 2010da994..978c25611 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/azure_role_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/azure_role_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ AzureRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r AzureRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceAzureRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/elasticsearch_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/elasticsearch_helpers.go index 2c3d97ab9..343ddc0d2 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/elasticsearch_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/elasticsearch_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ ElasticsearchRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r ElasticsearchRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceElasticsearchRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/gcp_role_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/gcp_role_helpers.go index 40a51f5d3..1eeb961b5 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/gcp_role_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/gcp_role_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ GCPRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r GCPRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceGCPRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mariadb_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mariadb_helpers.go index 0bc179049..e89bed1db 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mariadb_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mariadb_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ MariaDBRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r MariaDBRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceMariaDBRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mongo_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mongo_helpers.go index f8e5cc6a4..9fab6c2a1 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mongo_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mongo_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ MongoDBRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r MongoDBRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceMongoDBRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mysql_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mysql_helpers.go index f86ead09f..e501f7250 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mysql_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/mysql_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ MySQLRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r MySQLRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceMySQLRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/openapi_generated.go index 20b41bad2..0785d472d 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/openapi_generated.go @@ -19233,6 +19233,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/pki_role_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/pki_role_helpers.go index 7cf7d508e..ac123af51 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/pki_role_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/pki_role_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ PKIRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (p PKIRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePKIRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/postgres_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/postgres_helpers.go index d8d25d9bc..50f51264d 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/postgres_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/postgres_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ PostgresRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r PostgresRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePostgresRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/redis_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/redis_helpers.go index 964df39d4..1cc314e29 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/redis_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/redis_helpers.go @@ -25,7 +25,7 @@ import ( clustermeta "kmodules.xyz/client-go/cluster" ) -func (_ RedisRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r RedisRole) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceRedisRoles)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_access_request_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_access_request_helpers.go index 391cee451..f9ce178ac 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_access_request_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_access_request_helpers.go @@ -22,7 +22,7 @@ import ( "kmodules.xyz/client-go/apiextensions" ) -func (_ SecretAccessRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (d SecretAccessRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceSecretAccessRequests)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_engine_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_engine_helpers.go index c7323cece..e2dd76727 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_engine_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_engine_helpers.go @@ -27,7 +27,7 @@ import ( appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" ) -func (_ SecretEngine) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (e SecretEngine) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceSecretEngines)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_role_binding_helpers.go b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_role_binding_helpers.go index 0f83c33a2..92044d5d6 100644 --- a/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_role_binding_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/engine/v1alpha1/secret_role_binding_helpers.go @@ -25,7 +25,7 @@ import ( meta_util "kmodules.xyz/client-go/meta" ) -func (_ SecretRoleBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (d SecretRoleBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceSecretRoleBindings)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/openapi_generated.go index 771fed821..4df973f3f 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/openapi_generated.go @@ -19203,6 +19203,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_helpers.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_helpers.go index ce3ec5a40..b6a7d7544 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_helpers.go @@ -35,17 +35,16 @@ import ( "kmodules.xyz/client-go/apiextensions" apps_util "kmodules.xyz/client-go/apps/v1" clustermeta "kmodules.xyz/client-go/cluster" - "kmodules.xyz/client-go/meta" meta_util "kmodules.xyz/client-go/meta" mona "kmodules.xyz/monitoring-agent-api/api/v1" ofst "kmodules.xyz/offshoot-api/api/v1" ) -func (_ VaultServer) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (v VaultServer) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceVaultServers)) } -func (_ VaultServer) ResourceFQN() string { +func (v VaultServer) ResourceFQN() string { return fmt.Sprintf("%s.%s", ResourceVaultServers, kubevault.GroupName) } @@ -120,7 +119,7 @@ func (v VaultServer) StatsLabels() map[string]string { // Returns the default certificate secret name for given alias. func (vs *VaultServer) DefaultCertSecretName(alias string) string { - return meta.NameWithSuffix(fmt.Sprintf("%s-%s", vs.Name, alias), "certs") + return meta_util.NameWithSuffix(fmt.Sprintf("%s-%s", vs.Name, alias), "certs") } // Returns certificate secret name for given alias if exists, @@ -145,7 +144,7 @@ type vaultServerStatsService struct { } func (v vaultServerStatsService) ServiceMonitorAdditionalLabels() map[string]string { - return v.VaultServer.OffshootLabels() + return v.OffshootLabels() } func (v vaultServerStatsService) GetNamespace() string { @@ -178,12 +177,12 @@ func (v vaultServerStatsService) TLSConfig() *promapi.TLSConfig { CA: promapi.SecretOrConfigMap{ Secret: &core.SecretKeySelector{ LocalObjectReference: core.LocalObjectReference{ - Name: v.VaultServer.GetCertSecretName(string(VaultServerCert)), + Name: v.GetCertSecretName(string(VaultServerCert)), }, Key: core.TLSCertKey, }, }, - ServerName: ptr.To(fmt.Sprintf("%s.%s.svc", v.VaultServer.ServiceName(VaultServerServiceVault), v.VaultServer.Namespace)), + ServerName: ptr.To(fmt.Sprintf("%s.%s.svc", v.VaultServer.ServiceName(VaultServerServiceVault), v.Namespace)), }, } } diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_types.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_types.go index 451f861a8..e9bdf7bed 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_types.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha1/vaultserver_types.go @@ -750,7 +750,7 @@ type UnsealerSpec struct { // How often to attempt to unseal the vault instance // +optional - RetryPeriodSeconds time.Duration `json:"retryPeriodSeconds,omitempty"` + RetryPeriodSeconds time.Duration `json:"retryPeriodSeconds,omitempty"` //nolint // overwrite existing unseal keys and root tokens, possibly dangerous! // +optional diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/openapi_generated.go index 7a5e5ba63..77aa8313a 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/openapi_generated.go @@ -19204,6 +19204,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_helpers.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_helpers.go index edd860794..f23745312 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_helpers.go @@ -43,11 +43,11 @@ import ( func (*VaultServer) Hub() {} -func (_ VaultServer) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (v VaultServer) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceVaultServers)) } -func (_ VaultServer) ResourceFQN() string { +func (v VaultServer) ResourceFQN() string { return fmt.Sprintf("%s.%s", ResourceVaultServers, kubevault.GroupName) } @@ -151,7 +151,7 @@ type vaultServerStatsService struct { } func (v vaultServerStatsService) ServiceMonitorAdditionalLabels() map[string]string { - return v.VaultServer.OffshootLabels() + return v.OffshootLabels() } func (v vaultServerStatsService) GetNamespace() string { @@ -184,12 +184,12 @@ func (v vaultServerStatsService) TLSConfig() *promapi.TLSConfig { CA: promapi.SecretOrConfigMap{ Secret: &core.SecretKeySelector{ LocalObjectReference: core.LocalObjectReference{ - Name: v.VaultServer.GetCertSecretName(string(VaultServerCert)), + Name: v.GetCertSecretName(string(VaultServerCert)), }, Key: core.TLSCertKey, }, }, - ServerName: ptr.To(fmt.Sprintf("%s.%s.svc", v.VaultServer.ServiceName(VaultServerServiceVault), v.VaultServer.Namespace)), + ServerName: ptr.To(fmt.Sprintf("%s.%s.svc", v.VaultServer.ServiceName(VaultServerServiceVault), v.Namespace)), }, } } diff --git a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_types.go b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_types.go index fd276a949..25b3b8f9f 100644 --- a/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_types.go +++ b/vendor/kubevault.dev/apimachinery/apis/kubevault/v1alpha2/vaultserver_types.go @@ -830,7 +830,7 @@ type UnsealerSpec struct { // How often to attempt to unseal the vault instance // +optional - RetryPeriodSeconds time.Duration `json:"retryPeriodSeconds,omitempty"` + RetryPeriodSeconds time.Duration `json:"retryPeriodSeconds,omitempty"` //nolint // overwrite existing unseal keys and root tokens, possibly dangerous! // +optional diff --git a/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go index a36a9558c..6b6fb9681 100644 --- a/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go @@ -19177,6 +19177,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/vault_ops_helpers.go b/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/vault_ops_helpers.go index fbc03bd52..fb016cc69 100644 --- a/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/vault_ops_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/ops/v1alpha1/vault_ops_helpers.go @@ -25,7 +25,7 @@ import ( "kmodules.xyz/client-go/apiextensions" ) -func (_ VaultOpsRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (e VaultOpsRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralVaultOpsRequest)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/openapi_generated.go b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/openapi_generated.go index 90f49696a..4ea63a914 100644 --- a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/openapi_generated.go +++ b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/openapi_generated.go @@ -19187,6 +19187,12 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, diff --git a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicy_helpers.go b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicy_helpers.go index aae16b1ec..af4363060 100644 --- a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicy_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicy_helpers.go @@ -26,7 +26,7 @@ import ( meta_util "kmodules.xyz/client-go/meta" ) -func (_ VaultPolicy) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (v VaultPolicy) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceVaultPolicies)) } diff --git a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicybinding_helpers.go b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicybinding_helpers.go index 23c66085e..0f4cdb0a3 100644 --- a/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicybinding_helpers.go +++ b/vendor/kubevault.dev/apimachinery/apis/policy/v1alpha1/vaultpolicybinding_helpers.go @@ -27,7 +27,7 @@ import ( meta_util "kmodules.xyz/client-go/meta" ) -func (_ VaultPolicyBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (v VaultPolicyBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceVaultPolicyBindings)) } @@ -71,58 +71,58 @@ func (v *VaultPolicyBinding) SetDefaults() { v.Spec.VaultRoleName = v.PolicyBindingName() } - if v.Spec.SubjectRef.Kubernetes != nil { - if v.Spec.SubjectRef.Kubernetes.Path == "" { - v.Spec.SubjectRef.Kubernetes.Path = "kubernetes" + if v.Spec.Kubernetes != nil { + if v.Spec.Kubernetes.Path == "" { + v.Spec.Kubernetes.Path = "kubernetes" } - if v.Spec.SubjectRef.Kubernetes.Name == "" { - v.Spec.SubjectRef.Kubernetes.Name = v.PolicyBindingName() + if v.Spec.Kubernetes.Name == "" { + v.Spec.Kubernetes.Name = v.PolicyBindingName() } } - if v.Spec.SubjectRef.AppRole != nil { - if v.Spec.SubjectRef.AppRole.Path == "" { - v.Spec.SubjectRef.AppRole.Path = "approle" + if v.Spec.AppRole != nil { + if v.Spec.AppRole.Path == "" { + v.Spec.AppRole.Path = "approle" } - if v.Spec.SubjectRef.AppRole.RoleName == "" { - v.Spec.SubjectRef.AppRole.RoleName = v.PolicyBindingName() + if v.Spec.AppRole.RoleName == "" { + v.Spec.AppRole.RoleName = v.PolicyBindingName() } } - if v.Spec.SubjectRef.LdapGroup != nil { - if v.Spec.SubjectRef.LdapGroup.Path == "" { - v.Spec.SubjectRef.LdapGroup.Path = "ldap" + if v.Spec.LdapGroup != nil { + if v.Spec.LdapGroup.Path == "" { + v.Spec.LdapGroup.Path = "ldap" } } - if v.Spec.SubjectRef.LdapUser != nil { - if v.Spec.SubjectRef.LdapUser.Path == "" { - v.Spec.SubjectRef.LdapUser.Path = "ldap" + if v.Spec.LdapUser != nil { + if v.Spec.LdapUser.Path == "" { + v.Spec.LdapUser.Path = "ldap" } } - if v.Spec.SubjectRef.JWT != nil { - if v.Spec.SubjectRef.JWT.Path == "" { - v.Spec.SubjectRef.JWT.Path = "jwt" + if v.Spec.JWT != nil { + if v.Spec.JWT.Path == "" { + v.Spec.JWT.Path = "jwt" } - if v.Spec.SubjectRef.JWT.Name == "" { - v.Spec.SubjectRef.JWT.Name = v.PolicyBindingName() + if v.Spec.JWT.Name == "" { + v.Spec.JWT.Name = v.PolicyBindingName() } } - if v.Spec.SubjectRef.OIDC != nil { - if v.Spec.SubjectRef.OIDC.Path == "" { - v.Spec.SubjectRef.OIDC.Path = "oidc" + if v.Spec.OIDC != nil { + if v.Spec.OIDC.Path == "" { + v.Spec.OIDC.Path = "oidc" } - if v.Spec.SubjectRef.OIDC.Name == "" { - v.Spec.SubjectRef.OIDC.Name = v.PolicyBindingName() + if v.Spec.OIDC.Name == "" { + v.Spec.OIDC.Name = v.PolicyBindingName() } } } -func (v VaultPolicyBinding) GeneratePayload(i interface{}) (map[string]interface{}, error) { +func (v VaultPolicyBinding) GeneratePayload(i any) (map[string]any, error) { var err error - payload := make(map[string]interface{}) + payload := make(map[string]any) byte, err := json.Marshal(i) if err == nil { err = json.Unmarshal(byte, &payload) diff --git a/vendor/kubevault.dev/apimachinery/crds/lib.go b/vendor/kubevault.dev/apimachinery/crds/lib.go index 2871fe153..421ebb2d4 100644 --- a/vendor/kubevault.dev/apimachinery/crds/lib.go +++ b/vendor/kubevault.dev/apimachinery/crds/lib.go @@ -28,7 +28,7 @@ import ( //go:embed *.yaml var fs embed.FS -func load(filename string, o interface{}) error { +func load(filename string, o any) error { data, err := fs.ReadFile(filename) if err != nil { return err diff --git a/vendor/modules.txt b/vendor/modules.txt index b64aabcb3..86ba721e6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -271,8 +271,8 @@ github.com/google/gnostic-models/extensions github.com/google/gnostic-models/jsonschema github.com/google/gnostic-models/openapiv2 github.com/google/gnostic-models/openapiv3 -# github.com/google/go-cmp v0.6.0 -## explicit; go 1.13 +# github.com/google/go-cmp v0.7.0 +## explicit; go 1.21 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags @@ -387,12 +387,13 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.17.11 -## explicit; go 1.21 +# github.com/klauspost/compress v1.18.0 +## explicit; go 1.22 github.com/klauspost/compress github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 github.com/klauspost/compress/internal/cpuinfo +github.com/klauspost/compress/internal/le github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash @@ -519,7 +520,7 @@ github.com/sergi/go-diff/diffmatchpatch # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus -# github.com/spf13/cobra v1.8.1 +# github.com/spf13/cobra v1.9.1 ## explicit; go 1.15 github.com/spf13/cobra github.com/spf13/cobra/doc @@ -867,7 +868,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.32.2 +# k8s.io/api v0.32.3 ## explicit; go 1.23.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -928,7 +929,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.32.2 +# k8s.io/apiextensions-apiserver v0.32.3 ## explicit; go 1.23.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -939,7 +940,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 -# k8s.io/apimachinery v0.32.2 +# k8s.io/apimachinery v0.32.3 ## explicit; go 1.23.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -1006,7 +1007,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.32.2 => github.com/kmodules/apiserver v0.32.3-0.20250221062720-35dc674c7dd6 +# k8s.io/apiserver v0.32.3 => github.com/kmodules/apiserver v0.32.3-0.20250221062720-35dc674c7dd6 ## explicit; go 1.23.0 k8s.io/apiserver/pkg/authentication/user # k8s.io/cli-runtime v0.32.2 @@ -1015,7 +1016,7 @@ k8s.io/cli-runtime/pkg/genericclioptions k8s.io/cli-runtime/pkg/genericiooptions k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource -# k8s.io/client-go v0.32.2 +# k8s.io/client-go v0.32.3 ## explicit; go 1.23.0 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -1308,7 +1309,7 @@ k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/component-base v0.32.2 +# k8s.io/component-base v0.32.3 ## explicit; go 1.23.0 k8s.io/component-base/version # k8s.io/klog/v2 v2.130.1 @@ -1320,7 +1321,7 @@ k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler -# k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9 +# k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff ## explicit; go 1.21 k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common @@ -1358,8 +1359,8 @@ k8s.io/utils/trace # kmodules.xyz/apiversion v0.2.0 ## explicit; go 1.14 kmodules.xyz/apiversion -# kmodules.xyz/client-go v0.32.4 -## explicit; go 1.23.0 +# kmodules.xyz/client-go v0.32.11 +## explicit; go 1.24.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 kmodules.xyz/client-go/apiextensions @@ -1384,10 +1385,10 @@ kmodules.xyz/custom-resources/crds # kmodules.xyz/monitoring-agent-api v0.32.0 ## explicit; go 1.23.0 kmodules.xyz/monitoring-agent-api/api/v1 -# kmodules.xyz/offshoot-api v0.30.1 -## explicit; go 1.22.0 +# kmodules.xyz/offshoot-api v0.32.0 +## explicit; go 1.23.0 kmodules.xyz/offshoot-api/api/v1 -# kubevault.dev/apimachinery v0.23.0 +# kubevault.dev/apimachinery v0.23.1-0.20251210060231-c3bdb5a16bf7 ## explicit; go 1.24.0 kubevault.dev/apimachinery/apis kubevault.dev/apimachinery/apis/catalog