From 4e205020af2ccc1f4f698f79412e0207bc6e14a1 Mon Sep 17 00:00:00 2001 From: Brock Bylovas <60940551+bbylovas@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:33:04 -0600 Subject: [PATCH 01/28] test goveng ingest --- README.md | 2 +- charts/metrics-agent/Chart.yaml | 4 ++-- charts/metrics-agent/values.yaml | 2 +- client/client.go | 3 +++ version/version.go | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9472a513..7575a595 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | CLOUDABILITY_INFORMER_RESYNC_INTERVAL | Optional: Period of time (in hours) that the informers will fully resync the list of running resources. Default: 24 hours. Can be set to 0 to never resync | | CLOUDABILITY_PARSE_METRIC_DATA | Optional: When true, core files will be parsed and non-relevant data will be removed prior to upload. Default: `false` | | CLOUDABILITY_HTTPS_CLIENT_TIMEOUT | Optional: Amount (in seconds) of time the http client has before timing out requests. Might need to be increased to clusters with large payloads. Default: `60` | -| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1` | +| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1`, `us-gov-west-1` | | CLOUDABILITY_CUSTOM_S3_BUCKET | Optional: A custom S3 bucket the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. CLOUDABILITY_CUSTOM_S3_REGION is REQUIRED if this is set. | | CLOUDABILITY_CUSTOM_S3_REGION | Optional: The AWS region that the custom s3 bucket is in. This will initialize the correct region for the s3 client. CLOUDABILITY_CUSTOM_S3_BUCKET is REQUIRED if this is set. | diff --git a/charts/metrics-agent/Chart.yaml b/charts/metrics-agent/Chart.yaml index 93e2d44f..0d1a1987 100644 --- a/charts/metrics-agent/Chart.yaml +++ b/charts/metrics-agent/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 2.11.29 +version: 2.11.30 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 2.11.29 \ No newline at end of file +appVersion: 2.11.30 \ No newline at end of file diff --git a/charts/metrics-agent/values.yaml b/charts/metrics-agent/values.yaml index 574f4fc9..ce7a6c28 100644 --- a/charts/metrics-agent/values.yaml +++ b/charts/metrics-agent/values.yaml @@ -24,7 +24,7 @@ pollInterval: 180 image: name: cloudability/metrics-agent - tag: 2.11.29 + tag: 2.11.30 pullPolicy: Always imagePullSecrets: [] diff --git a/client/client.go b/client/client.go index 5c4fcb01..cd8ac1cf 100644 --- a/client/client.go +++ b/client/client.go @@ -34,6 +34,7 @@ const DefaultBaseURL string = "https://metrics-collector.cloudability.com/metric const EUBaseURL string = "https://metrics-collector-eu.cloudability.com/metricsample" const AUBaseURL string = "https://metrics-collector-au.cloudability.com/metricsample" const MEBaseURL string = "https://metrics-collector-me.cloudability.com/metricsample" +const UsGovEngBaseURL string = "https://metrics-collector-gov-eng.cloudability.com" const defaultTimeout = 1 * time.Minute const defaultMaxRetries = 5 @@ -421,6 +422,8 @@ func GetUploadURLByRegion(region string) string { return AUBaseURL case "me-central-1": return MEBaseURL + case "us-gov-west-1": + return UsGovEngBaseURL case "us-west-2": return DefaultBaseURL default: diff --git a/version/version.go b/version/version.go index a4f759fa..596687a8 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // VERSION is the current version of the agent -var VERSION = "2.11.29" +var VERSION = "2.11.30" From 40d9f12b2bc03870b5b6bdec77e10aac9116ac87 Mon Sep 17 00:00:00 2001 From: Brock Bylovas <60940551+bbylovas@users.noreply.github.com> Date: Fri, 16 Aug 2024 09:04:44 -0600 Subject: [PATCH 02/28] fix url --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index cd8ac1cf..1f0d409c 100644 --- a/client/client.go +++ b/client/client.go @@ -34,7 +34,7 @@ const DefaultBaseURL string = "https://metrics-collector.cloudability.com/metric const EUBaseURL string = "https://metrics-collector-eu.cloudability.com/metricsample" const AUBaseURL string = "https://metrics-collector-au.cloudability.com/metricsample" const MEBaseURL string = "https://metrics-collector-me.cloudability.com/metricsample" -const UsGovEngBaseURL string = "https://metrics-collector-gov-eng.cloudability.com" +const UsGovEngBaseURL string = "https://metrics-collector-gov-eng.cloudability.com/metricsample" const defaultTimeout = 1 * time.Minute const defaultMaxRetries = 5 From 9f014580d6de7829b880ca2d2a42dd1b04462426 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 13:44:39 -0700 Subject: [PATCH 03/28] azure blob storage upload support --- README.md | 10 ++ charts/metrics-agent/Chart.yaml | 4 +- charts/metrics-agent/values.yaml | 2 +- cmd/kubernetesCmd.go | 81 ++++++++++---- go.mod | 17 ++- go.sum | 51 +++++++-- kubernetes/kubernetes.go | 179 +++++++++++++++++++++++-------- version/version.go | 2 +- 8 files changed, 265 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 755f9cb0..79a2aa1b 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,11 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1`, `us-gov-west-1` | | CLOUDABILITY_CUSTOM_S3_BUCKET | Optional: A custom S3 bucket the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. CLOUDABILITY_CUSTOM_S3_REGION is REQUIRED if this is set. | | CLOUDABILITY_CUSTOM_S3_REGION | Optional: The AWS region that the custom s3 bucket is in. This will initialize the correct region for the s3 client. CLOUDABILITY_CUSTOM_S3_BUCKET is REQUIRED if this is set. | +| CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME | Optional: A custom Azure blob container name the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. | +| CLOUDABILITY_CUSTOM_AZURE_BLOB_URL | Optional: The Azure storage account's URL. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | +| CLOUDABILITY_CUSTOM_AZURE_TENANT_ID | Optional: The Azure Service account's Tenant ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | +| CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID | Optional: The Azure Service account's Client ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | +| CLOUDABILITY_CUSTOM_AZURE_CLIENT_Secret | Optional: The Azure Service account's Client Secret. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | ```sh @@ -90,6 +95,11 @@ Flags: --upload_region The region the metrics-agent will upload data to. (default `us-west-2`) --custom_s3_bucket string A custom S3 bucket the metrics-agent will upload data to. - Optional --custom_s3_region The AWS region that the custom s3 bucket is created. + --custom_azure_blob_container_name string A custom Azure blob container name the metrics-agent will upload data to. - Optional + --custom_azure_blob_url A custom Azure blob url metrics-agent uses to create the Azure client. + --custom_azure_tenant_id A custom Azure Service principal tenant id the metrics-agent uses to create the Azure client. + --custom_azure_client_id A custom Azure Service Principal client id the metrics-agent uses to create the Azure client. + --custom_azure_client_secret A custom Azure Service Principal client secret the metrics-agent uses to create the Azure client. Global Flags: --log_format string Format for log output (JSON,PLAIN) (default "PLAIN") --log_level string Log level to run the agent at (INFO,WARN,DEBUG) (default "INFO") diff --git a/charts/metrics-agent/Chart.yaml b/charts/metrics-agent/Chart.yaml index 2a8972bb..e23b009e 100644 --- a/charts/metrics-agent/Chart.yaml +++ b/charts/metrics-agent/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 2.11.33 +version: 2.11.34 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 2.11.33 \ No newline at end of file +appVersion: 2.11.34 \ No newline at end of file diff --git a/charts/metrics-agent/values.yaml b/charts/metrics-agent/values.yaml index d2e81c6b..3eea1804 100644 --- a/charts/metrics-agent/values.yaml +++ b/charts/metrics-agent/values.yaml @@ -24,7 +24,7 @@ pollInterval: 180 image: name: cloudability/metrics-agent - tag: 2.11.33 + tag: 2.11.34 pullPolicy: Always imagePullSecrets: [] diff --git a/cmd/kubernetesCmd.go b/cmd/kubernetesCmd.go index 1dcb109a..6367356f 100644 --- a/cmd/kubernetesCmd.go +++ b/cmd/kubernetesCmd.go @@ -150,6 +150,37 @@ func init() { "", "The AWS region that the custom s3 bucket is in", ) + kubernetesCmd.PersistentFlags().StringVar( + &config.CustomAzureUploadBlobContainerName, + "custom_azure_blob_container_name", + "", + "The Azure blob container name the metrics-agent will upload data to. Default is an empty string which will not upload "+ + "to custom azure location", + ) + kubernetesCmd.PersistentFlags().StringVar( + &config.CustomAzureBlobUrl, + "custom_azure_blob_url", + "", + "The Azure blob url the metrics-agent will upload data to.", + ) + kubernetesCmd.PersistentFlags().StringVar( + &config.CustomAzureTenantId, + "custom_azure_tenant_id", + "", + "The Azure tenant id the metrics-agent uses when connecting to the azure blob.", + ) + kubernetesCmd.PersistentFlags().StringVar( + &config.CustomAzureClientId, + "custom_azure_client_id", + "", + "The Azure client id the metrics-agent uses when connecting to the azure blob.", + ) + kubernetesCmd.PersistentFlags().StringVar( + &config.CustomAzureClientSecret, + "custom_azure_client_secret", + "", + "The Azure client secret the metrics-agent uses when connecting to the azure blob.", + ) //nolint gas _ = viper.BindPFlag("api_key", kubernetesCmd.PersistentFlags().Lookup("api_key")) @@ -177,32 +208,42 @@ func init() { _ = viper.BindPFlag("upload_region", kubernetesCmd.PersistentFlags().Lookup("upload_region")) _ = viper.BindPFlag("custom_s3_bucket", kubernetesCmd.PersistentFlags().Lookup("custom_s3_bucket")) _ = viper.BindPFlag("custom_s3_region", kubernetesCmd.PersistentFlags().Lookup("custom_s3_region")) + _ = viper.BindPFlag("custom_azure_blob_container_name", kubernetesCmd.PersistentFlags().Lookup("custom_azure_blob_container_name")) + _ = viper.BindPFlag("custom_azure_blob_url", kubernetesCmd.PersistentFlags().Lookup("custom_azure_blob_url")) + _ = viper.BindPFlag("custom_azure_tenant_id", kubernetesCmd.PersistentFlags().Lookup("custom_azure_tenant_id")) + _ = viper.BindPFlag("custom_azure_client_id", kubernetesCmd.PersistentFlags().Lookup("custom_azure_client_id")) + _ = viper.BindPFlag("custom_azure_client_secret", kubernetesCmd.PersistentFlags().Lookup("custom_azure_client_secret")) viper.SetEnvPrefix("cloudability") viper.AutomaticEnv() RootCmd.AddCommand(kubernetesCmd) config = kubernetes.KubeAgentConfig{ - APIKey: viper.GetString("api_key"), - ClusterName: viper.GetString("cluster_name"), - PollInterval: viper.GetInt("poll_interval"), - CollectionRetryLimit: viper.GetUint("collection_retry_limit"), - OutboundProxy: viper.GetString("outbound_proxy"), - OutboundProxyAuth: viper.GetString("outbound_proxy_auth"), - OutboundProxyInsecure: viper.GetBool("outbound_proxy_insecure"), - Insecure: viper.GetBool("insecure"), - Cert: viper.GetString("certificate_file"), - Key: viper.GetString("key_file"), - ConcurrentPollers: viper.GetInt("number_of_concurrent_node_pollers"), - ForceKubeProxy: viper.GetBool("force_kube_proxy"), - Namespace: viper.GetString("namespace"), - ScratchDir: viper.GetString("scratch_dir"), - InformerResyncInterval: viper.GetInt("informer_resync_interval"), - ParseMetricData: viper.GetBool("parse_metric_data"), - HTTPSTimeout: viper.GetInt("https_client_timeout"), - UploadRegion: viper.GetString("upload_region"), - CustomS3UploadBucket: viper.GetString("custom_s3_bucket"), - CustomS3Region: viper.GetString("custom_s3_region"), + APIKey: viper.GetString("api_key"), + ClusterName: viper.GetString("cluster_name"), + PollInterval: viper.GetInt("poll_interval"), + CollectionRetryLimit: viper.GetUint("collection_retry_limit"), + OutboundProxy: viper.GetString("outbound_proxy"), + OutboundProxyAuth: viper.GetString("outbound_proxy_auth"), + OutboundProxyInsecure: viper.GetBool("outbound_proxy_insecure"), + Insecure: viper.GetBool("insecure"), + Cert: viper.GetString("certificate_file"), + Key: viper.GetString("key_file"), + ConcurrentPollers: viper.GetInt("number_of_concurrent_node_pollers"), + ForceKubeProxy: viper.GetBool("force_kube_proxy"), + Namespace: viper.GetString("namespace"), + ScratchDir: viper.GetString("scratch_dir"), + InformerResyncInterval: viper.GetInt("informer_resync_interval"), + ParseMetricData: viper.GetBool("parse_metric_data"), + HTTPSTimeout: viper.GetInt("https_client_timeout"), + UploadRegion: viper.GetString("upload_region"), + CustomS3UploadBucket: viper.GetString("custom_s3_bucket"), + CustomS3Region: viper.GetString("custom_s3_region"), + CustomAzureUploadBlobContainerName: viper.GetString("custom_azure_blob_container_name"), + CustomAzureBlobUrl: viper.GetString("custom_azure_blob_url"), + CustomAzureTenantId: viper.GetString("custom_azure_tenant_id"), + CustomAzureClientId: viper.GetString("custom_azure_client_id"), + CustomAzureClientSecret: viper.GetString("custom_azure_client_secret"), } } diff --git a/go.mod b/go.mod index 41727efc..c50abe4b 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,8 @@ module github.com/cloudability/metrics-agent go 1.22 require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 github.com/aws/aws-sdk-go v1.35.24 github.com/google/cadvisor v0.48.1 github.com/googleapis/gnostic v0.5.5 @@ -21,6 +23,9 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/alessio/shellescape v1.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -33,18 +38,20 @@ require ( github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.16 // indirect @@ -56,6 +63,7 @@ require ( github.com/nxadm/tail v1.4.8 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/spf13/afero v1.9.2 // indirect @@ -63,11 +71,12 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index 46939825..ab313fa7 100644 --- a/go.sum +++ b/go.sum @@ -593,6 +593,22 @@ cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcP dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 h1:cf+OIKbkmMHBaC3u78AXomweqM0oxQSgBXRZf3WH4yM= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1/go.mod h1:ap1dmS6vQKJxSMNiGJcq4QuUQkOynyD93gLw6MDF7ek= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= @@ -627,6 +643,8 @@ github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -644,6 +662,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/emicklei/go-restful/v3 v3.10.0 h1:X4gma4HM7hFm6WMeAsTfqA0GOfdNoCzBIkHGoRLGXuM= @@ -701,6 +721,8 @@ github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= @@ -784,8 +806,9 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -838,6 +861,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= 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/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= @@ -850,12 +875,15 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= @@ -907,6 +935,8 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2 github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -933,13 +963,15 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= +github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= +github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= @@ -976,8 +1008,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -1003,6 +1036,7 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1170,6 +1204,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1179,8 +1214,9 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= @@ -1202,8 +1238,9 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 4cb46f43..88c55d46 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -21,6 +21,8 @@ import ( "strings" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" @@ -49,46 +51,51 @@ type ClusterVersion struct { // KubeAgentConfig K8s agent configuration type KubeAgentConfig struct { - APIKey string - BearerToken string - BearerTokenPath string - Cert string - ClusterName string - ClusterHostURL string - clusterUID string - HeapsterURL string - Key string - OutboundProxyAuth string - OutboundProxy string - provisioningID string - ForceKubeProxy bool - Insecure bool - OutboundProxyInsecure bool - UseInClusterConfig bool - PollInterval int - ConcurrentPollers int - CollectionRetryLimit uint - failedNodeList map[string]error - AgentStartTime time.Time - Clientset kubernetes.Interface - ClusterVersion ClusterVersion - HeapsterProxyURL url.URL - OutboundProxyURL url.URL - HTTPClient http.Client - NodeClient raw.Client - InClusterClient raw.Client - msExportDirectory *os.File - TLSClientConfig rest.TLSClientConfig - Namespace string - ScratchDir string - NodeMetrics EndpointMask - Informers map[string]*cache.SharedIndexInformer - InformerResyncInterval int - ParseMetricData bool - HTTPSTimeout int - UploadRegion string - CustomS3UploadBucket string - CustomS3Region string + APIKey string + BearerToken string + BearerTokenPath string + Cert string + ClusterName string + ClusterHostURL string + clusterUID string + HeapsterURL string + Key string + OutboundProxyAuth string + OutboundProxy string + provisioningID string + ForceKubeProxy bool + Insecure bool + OutboundProxyInsecure bool + UseInClusterConfig bool + PollInterval int + ConcurrentPollers int + CollectionRetryLimit uint + failedNodeList map[string]error + AgentStartTime time.Time + Clientset kubernetes.Interface + ClusterVersion ClusterVersion + HeapsterProxyURL url.URL + OutboundProxyURL url.URL + HTTPClient http.Client + NodeClient raw.Client + InClusterClient raw.Client + msExportDirectory *os.File + TLSClientConfig rest.TLSClientConfig + Namespace string + ScratchDir string + NodeMetrics EndpointMask + Informers map[string]*cache.SharedIndexInformer + InformerResyncInterval int + ParseMetricData bool + HTTPSTimeout int + UploadRegion string + CustomS3UploadBucket string + CustomS3Region string + CustomAzureUploadBlobContainerName string + CustomAzureBlobUrl string + CustomAzureTenantId string + CustomAzureClientId string + CustomAzureClientSecret string } const uploadInterval time.Duration = 10 @@ -136,6 +143,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { kubeAgent := newKubeAgent(ctx, config) customS3Mode := isCustomS3UploadEnvsSet(&kubeAgent) + customAzureMode := isCustomAzureUploadEnvsSet(&kubeAgent) // Log start time kubeAgent.AgentStartTime = time.Now() @@ -174,7 +182,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { log.Warnf("Warning: Non-fatal error occurred retrieving baseline metrics: %s", err) } - if !customS3Mode { + if !customS3Mode && !customAzureMode { err = performConnectionChecks(&kubeAgent) if err != nil { log.Warnf("WARNING: failed to retrieve S3 URL in connectivity test, agent will fail to "+ @@ -201,7 +209,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { } } // Send metric sample - kubeAgent.sendMetricsBasedOnUploadMode(customS3Mode, metricSample) + kubeAgent.sendMetricsBasedOnUploadMode(customS3Mode, customAzureMode, metricSample) case <-pollChan.C: err := kubeAgent.collectMetrics(ctx, kubeAgent, kubeAgent.Clientset, clientSetNodeSource) @@ -237,6 +245,29 @@ func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { return true } +func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { + if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobUrl == "" && ka.CustomAzureClientId == "" && + ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantId == "" { + if ka.APIKey == "" { + log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + + "when not using CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") + } + return false + } + if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobUrl == "" || ka.CustomAzureClientId == "" || + ka.CustomAzureClientSecret == "" || ka.CustomAzureTenantId == "" { + log.Fatalf("Invalid agent configuration. Detected only one of the six required environment variables "+ + "to run in custom Azure upload mode. CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME is set to %s. "+ + "CLOUDABILITY_CUSTOM_AZURE_BLOB_URL is set to %s CLOUDABILITY_CUSTOM_AZURE_TENANT_ID is set to %s. "+ + "CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID is set to %s. CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET is set to %s.", + ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobUrl, ka.CustomAzureClientId, ka.CustomAzureTenantId, + ka.CustomAzureClientSecret) + } + log.Infof("Detected custom Azure blob configuration, "+ + "Will upload collected metrics to %s", ka.CustomAzureUploadBlobContainerName) + return true +} + func performConnectionChecks(ka *KubeAgentConfig) error { log.Info("Performing connectivity checks. Checking that the agent can retrieve S3 URL") @@ -443,10 +474,13 @@ func (ka KubeAgentConfig) sendMetrics(metricSample *os.File) { } } -func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(customS3Mode bool, metricSample *os.File) { +func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(customS3Mode bool, customAzureMode bool, metricSample *os.File) { if customS3Mode { log.Infof("Uploading Metrics to Custom S3 Bucket %s", ka.CustomS3UploadBucket) go ka.sendMetricsToCustomS3(metricSample) + } else if customAzureMode { + log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) + go ka.sendMetricsToCustomBlob(metricSample) } else { log.Info("Uploading Metrics") go ka.sendMetrics(metricSample) @@ -471,7 +505,7 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } defer fileReader.Close() - key := generateSampleKey(ka.clusterUID) + key := generateSampleKey(ka.clusterUID, "aws") sampleToUpload := &s3manager.UploadInput{ Bucket: aws.String(ka.CustomS3UploadBucket), Key: aws.String(key), @@ -492,13 +526,61 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } } -// generateSampleKey creates a key (location) for s3 to upload the sample to. Example of s3 location format +func (ka KubeAgentConfig) sendMetricsToCustomBlob(metricSample *os.File) { + os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantId) + os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientId) + os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("Could not establish Azure credentials, "+ + "ensure Azure environment variables are set correctly: %s", err) + } + azureClient, err := azblob.NewClient(ka.CustomAzureBlobUrl, cred, nil) + if err != nil { + log.Fatalf("Could not establish Azure Client, "+ + "ensure Azure environment variables are set correctly: %s", err) + } + ka.uploadBlob(azureClient, metricSample) +} + +func (ka KubeAgentConfig) uploadBlob(client *azblob.Client, metricSample *os.File) { + file, err := os.Open(metricSample.Name()) + if err != nil { + log.Fatalf("Unable to open metric sample file %v", err) + } + defer file.Close() + key := generateSampleKey(ka.clusterUID, "azure") + _, err = client.UploadFile(context.Background(), ka.CustomAzureUploadBlobContainerName, key, file, nil) + if err != nil { + log.Fatalf("Failed to put Object to custom Azure blob with error: %s", err) + } else { + sn := strings.Split(metricSample.Name(), "/") + log.Infof("Exported metric sample %s to custom Azure blob: %s", + strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) + } + err = os.Remove(metricSample.Name()) + if err != nil { + log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) + } +} + +// generateSampleKey creates a key (location) for s3 or azure to upload the sample to. Example of s3 location format // /production/data/metrics-agent///
//---.tgz -func generateSampleKey(clusterUID string) string { +// example of azure location format +// production/data/metrics-agent///
//---.tgz +func generateSampleKey(clusterUID, provider string) string { currentTime := time.Now() year, month, day := currentTime.Date() hour := currentTime.Hour() minute := currentTime.Minute() + if provider == "aws" { + return fmt.Sprintf("/production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, + int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) + } + if provider == "azure" { + return fmt.Sprintf("production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, + int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) + } return fmt.Sprintf("/production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) } @@ -833,6 +915,11 @@ func createAgentStatusMetric(workDir *os.File, config KubeAgentConfig, sampleSta m.Values["upload_region"] = config.UploadRegion m.Values["custom_s3_bucket"] = config.CustomS3UploadBucket m.Values["custom_s3_region"] = config.CustomS3Region + m.Values["custom_azure_blob_container_name"] = config.CustomAzureUploadBlobContainerName + m.Values["custom_azure_blob_url"] = config.CustomAzureBlobUrl + m.Values["custom_azure_tenant_id"] = config.CustomAzureTenantId + m.Values["custom_azure_client_id"] = config.CustomAzureClientId + m.Values["custom_azure_client_secret"] = config.CustomAzureClientSecret if len(config.OutboundProxyAuth) > 0 { m.Values["outbound_proxy_auth"] = "true" } else { diff --git a/version/version.go b/version/version.go index fd55a3be..0acf51ea 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // VERSION is the current version of the agent -var VERSION = "2.11.33" +var VERSION = "2.11.34" From a64935ff863c4c0ec6a3a6dcbd272c13dfd0b762 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 13:49:55 -0700 Subject: [PATCH 04/28] linter fixes --- cmd/kubernetesCmd.go | 12 ++++++------ kubernetes/kubernetes.go | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/kubernetesCmd.go b/cmd/kubernetesCmd.go index 6367356f..27be0c2a 100644 --- a/cmd/kubernetesCmd.go +++ b/cmd/kubernetesCmd.go @@ -158,19 +158,19 @@ func init() { "to custom azure location", ) kubernetesCmd.PersistentFlags().StringVar( - &config.CustomAzureBlobUrl, + &config.CustomAzureBlobURL, "custom_azure_blob_url", "", "The Azure blob url the metrics-agent will upload data to.", ) kubernetesCmd.PersistentFlags().StringVar( - &config.CustomAzureTenantId, + &config.CustomAzureTenantID, "custom_azure_tenant_id", "", "The Azure tenant id the metrics-agent uses when connecting to the azure blob.", ) kubernetesCmd.PersistentFlags().StringVar( - &config.CustomAzureClientId, + &config.CustomAzureClientID, "custom_azure_client_id", "", "The Azure client id the metrics-agent uses when connecting to the azure blob.", @@ -240,9 +240,9 @@ func init() { CustomS3UploadBucket: viper.GetString("custom_s3_bucket"), CustomS3Region: viper.GetString("custom_s3_region"), CustomAzureUploadBlobContainerName: viper.GetString("custom_azure_blob_container_name"), - CustomAzureBlobUrl: viper.GetString("custom_azure_blob_url"), - CustomAzureTenantId: viper.GetString("custom_azure_tenant_id"), - CustomAzureClientId: viper.GetString("custom_azure_client_id"), + CustomAzureBlobURL: viper.GetString("custom_azure_blob_url"), + CustomAzureTenantID: viper.GetString("custom_azure_tenant_id"), + CustomAzureClientID: viper.GetString("custom_azure_client_id"), CustomAzureClientSecret: viper.GetString("custom_azure_client_secret"), } diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 88c55d46..12dbcc17 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -92,9 +92,9 @@ type KubeAgentConfig struct { CustomS3UploadBucket string CustomS3Region string CustomAzureUploadBlobContainerName string - CustomAzureBlobUrl string - CustomAzureTenantId string - CustomAzureClientId string + CustomAzureBlobURL string + CustomAzureTenantID string + CustomAzureClientID string CustomAzureClientSecret string } @@ -246,21 +246,21 @@ func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { } func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { - if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobUrl == "" && ka.CustomAzureClientId == "" && - ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantId == "" { + if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobURL == "" && ka.CustomAzureClientID == "" && + ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantID == "" { if ka.APIKey == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + "when not using CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") } return false } - if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobUrl == "" || ka.CustomAzureClientId == "" || - ka.CustomAzureClientSecret == "" || ka.CustomAzureTenantId == "" { + if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobURL == "" || ka.CustomAzureClientID == "" || + ka.CustomAzureClientSecret == "" || ka.CustomAzureTenantID == "" { log.Fatalf("Invalid agent configuration. Detected only one of the six required environment variables "+ "to run in custom Azure upload mode. CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME is set to %s. "+ "CLOUDABILITY_CUSTOM_AZURE_BLOB_URL is set to %s CLOUDABILITY_CUSTOM_AZURE_TENANT_ID is set to %s. "+ "CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID is set to %s. CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET is set to %s.", - ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobUrl, ka.CustomAzureClientId, ka.CustomAzureTenantId, + ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobURL, ka.CustomAzureClientID, ka.CustomAzureTenantID, ka.CustomAzureClientSecret) } log.Infof("Detected custom Azure blob configuration, "+ @@ -527,15 +527,15 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } func (ka KubeAgentConfig) sendMetricsToCustomBlob(metricSample *os.File) { - os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantId) - os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientId) + os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantID) + os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientID) os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("Could not establish Azure credentials, "+ "ensure Azure environment variables are set correctly: %s", err) } - azureClient, err := azblob.NewClient(ka.CustomAzureBlobUrl, cred, nil) + azureClient, err := azblob.NewClient(ka.CustomAzureBlobURL, cred, nil) if err != nil { log.Fatalf("Could not establish Azure Client, "+ "ensure Azure environment variables are set correctly: %s", err) @@ -916,9 +916,9 @@ func createAgentStatusMetric(workDir *os.File, config KubeAgentConfig, sampleSta m.Values["custom_s3_bucket"] = config.CustomS3UploadBucket m.Values["custom_s3_region"] = config.CustomS3Region m.Values["custom_azure_blob_container_name"] = config.CustomAzureUploadBlobContainerName - m.Values["custom_azure_blob_url"] = config.CustomAzureBlobUrl - m.Values["custom_azure_tenant_id"] = config.CustomAzureTenantId - m.Values["custom_azure_client_id"] = config.CustomAzureClientId + m.Values["custom_azure_blob_url"] = config.CustomAzureBlobURL + m.Values["custom_azure_tenant_id"] = config.CustomAzureTenantID + m.Values["custom_azure_client_id"] = config.CustomAzureClientID m.Values["custom_azure_client_secret"] = config.CustomAzureClientSecret if len(config.OutboundProxyAuth) > 0 { m.Values["outbound_proxy_auth"] = "true" From a114a0069acc5521b9192cecd7b29e71d1c9e437 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 13:58:59 -0700 Subject: [PATCH 05/28] more lint fixes --- cmd/kubernetesCmd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/kubernetesCmd.go b/cmd/kubernetesCmd.go index 27be0c2a..2f5ad9a7 100644 --- a/cmd/kubernetesCmd.go +++ b/cmd/kubernetesCmd.go @@ -154,8 +154,8 @@ func init() { &config.CustomAzureUploadBlobContainerName, "custom_azure_blob_container_name", "", - "The Azure blob container name the metrics-agent will upload data to. Default is an empty string which will not upload "+ - "to custom azure location", + "The Azure blob container name the metrics-agent will upload data to. Default is an empty string "+ + "which will not upload to custom azure location", ) kubernetesCmd.PersistentFlags().StringVar( &config.CustomAzureBlobURL, @@ -182,7 +182,7 @@ func init() { "The Azure client secret the metrics-agent uses when connecting to the azure blob.", ) - //nolint gas + //nolint gas, lll _ = viper.BindPFlag("api_key", kubernetesCmd.PersistentFlags().Lookup("api_key")) _ = viper.BindPFlag("cluster_name", kubernetesCmd.PersistentFlags().Lookup("cluster_name")) _ = viper.BindPFlag("heapster_override_url", kubernetesCmd.PersistentFlags().Lookup("heapster_override_url")) From 2e049fc0f659a61ba008b3bdf14abbe5d00c28a1 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 14:03:59 -0700 Subject: [PATCH 06/28] Update kubernetesCmd.go --- cmd/kubernetesCmd.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/kubernetesCmd.go b/cmd/kubernetesCmd.go index 2f5ad9a7..a6a539df 100644 --- a/cmd/kubernetesCmd.go +++ b/cmd/kubernetesCmd.go @@ -182,7 +182,7 @@ func init() { "The Azure client secret the metrics-agent uses when connecting to the azure blob.", ) - //nolint gas, lll + //nolint gas _ = viper.BindPFlag("api_key", kubernetesCmd.PersistentFlags().Lookup("api_key")) _ = viper.BindPFlag("cluster_name", kubernetesCmd.PersistentFlags().Lookup("cluster_name")) _ = viper.BindPFlag("heapster_override_url", kubernetesCmd.PersistentFlags().Lookup("heapster_override_url")) @@ -208,7 +208,8 @@ func init() { _ = viper.BindPFlag("upload_region", kubernetesCmd.PersistentFlags().Lookup("upload_region")) _ = viper.BindPFlag("custom_s3_bucket", kubernetesCmd.PersistentFlags().Lookup("custom_s3_bucket")) _ = viper.BindPFlag("custom_s3_region", kubernetesCmd.PersistentFlags().Lookup("custom_s3_region")) - _ = viper.BindPFlag("custom_azure_blob_container_name", kubernetesCmd.PersistentFlags().Lookup("custom_azure_blob_container_name")) + _ = viper.BindPFlag("custom_azure_blob_container_name", kubernetesCmd.PersistentFlags().Lookup( + "custom_azure_blob_container_name")) _ = viper.BindPFlag("custom_azure_blob_url", kubernetesCmd.PersistentFlags().Lookup("custom_azure_blob_url")) _ = viper.BindPFlag("custom_azure_tenant_id", kubernetesCmd.PersistentFlags().Lookup("custom_azure_tenant_id")) _ = viper.BindPFlag("custom_azure_client_id", kubernetesCmd.PersistentFlags().Lookup("custom_azure_client_id")) From 87dcdbc8cd812599d5c03f5ddb5b8b191eae5d18 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 16:53:22 -0700 Subject: [PATCH 07/28] refactor updates --- README.md | 10 ++++---- kubernetes/kubernetes.go | 53 +++++++++++++++++++++++----------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 79a2aa1b..a514c976 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | CLOUDABILITY_CUSTOM_AZURE_BLOB_URL | Optional: The Azure storage account's URL. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | | CLOUDABILITY_CUSTOM_AZURE_TENANT_ID | Optional: The Azure Service account's Tenant ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | | CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID | Optional: The Azure Service account's Client ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | -| CLOUDABILITY_CUSTOM_AZURE_CLIENT_Secret | Optional: The Azure Service account's Client Secret. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | +| CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET | Optional: The Azure Service account's Client Secret. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | ```sh @@ -96,10 +96,10 @@ Flags: --custom_s3_bucket string A custom S3 bucket the metrics-agent will upload data to. - Optional --custom_s3_region The AWS region that the custom s3 bucket is created. --custom_azure_blob_container_name string A custom Azure blob container name the metrics-agent will upload data to. - Optional - --custom_azure_blob_url A custom Azure blob url metrics-agent uses to create the Azure client. - --custom_azure_tenant_id A custom Azure Service principal tenant id the metrics-agent uses to create the Azure client. - --custom_azure_client_id A custom Azure Service Principal client id the metrics-agent uses to create the Azure client. - --custom_azure_client_secret A custom Azure Service Principal client secret the metrics-agent uses to create the Azure client. + --custom_azure_blob_url A custom Azure blob url metrics-agent uses to create the Azure client. - Optional + --custom_azure_tenant_id A custom Azure Service principal tenant id the metrics-agent uses to create the Azure client. - Optional + --custom_azure_client_id A custom Azure Service Principal client id the metrics-agent uses to create the Azure client. - Optional + --custom_azure_client_secret A custom Azure Service Principal client secret the metrics-agent uses to create the Azure client. - Optional Global Flags: --log_format string Format for log output (JSON,PLAIN) (default "PLAIN") --log_level string Log level to run the agent at (INFO,WARN,DEBUG) (default "INFO") diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 12dbcc17..6000830e 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -141,9 +141,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { // Create k8s agent kubeAgent := newKubeAgent(ctx, config) - - customS3Mode := isCustomS3UploadEnvsSet(&kubeAgent) - customAzureMode := isCustomAzureUploadEnvsSet(&kubeAgent) + customMode, agentProvider := isCustomUploadEnvsSet(&kubeAgent) // Log start time kubeAgent.AgentStartTime = time.Now() @@ -182,7 +180,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { log.Warnf("Warning: Non-fatal error occurred retrieving baseline metrics: %s", err) } - if !customS3Mode && !customAzureMode { + if !customMode { err = performConnectionChecks(&kubeAgent) if err != nil { log.Warnf("WARNING: failed to retrieve S3 URL in connectivity test, agent will fail to "+ @@ -209,7 +207,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { } } // Send metric sample - kubeAgent.sendMetricsBasedOnUploadMode(customS3Mode, customAzureMode, metricSample) + kubeAgent.sendMetricsBasedOnUploadMode(agentProvider, metricSample) case <-pollChan.C: err := kubeAgent.collectMetrics(ctx, kubeAgent, kubeAgent.Clientset, clientSetNodeSource) @@ -225,15 +223,25 @@ func CollectKubeMetrics(config KubeAgentConfig) { } +// isCustomUploadEnvsSet checks the KubeAgentConfig for custom upload ENVs and returns true/false and the provider mode +// Currently supported: AWS and Azure, the goal is to add more support with this function later +func isCustomUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { + var isCustomUpload bool + var agentMode string + isCustomUpload, agentMode = isCustomS3UploadEnvsSet(ka) + isCustomUpload, agentMode = isCustomAzureUploadEnvsSet(ka) + return isCustomUpload, agentMode +} + // isCustomS3UploadEnvsSet checks to see if the agent has a custom S3 location and S3 region to upload to // if both these variables are not set, default upload to Apptio S3 -func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { +func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) (bool, string) { if ka.CustomS3Region == "" && ka.CustomS3UploadBucket == "" { if ka.APIKey == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + "when not using CLOUDABILITY_CUSTOM_S3_BUCKET & CLOUDABILITY_CUSTOM_S3_REGION") } - return false + return false, "" } if ka.CustomS3UploadBucket == "" || ka.CustomS3Region == "" { log.Fatalf("Invalid agent configuration. Detected only one of the two required environment variables "+ @@ -242,17 +250,19 @@ func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { } log.Infof("Detected custom S3 bucket location and S3 bucket region. "+ "Will upload collected metrics to %s in the aws region %s", ka.CustomS3UploadBucket, ka.CustomS3Region) - return true + return true, "aws" } -func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { +// isCustomAzureUploadEnvsSet checks to see if the agent has custom Azure credentials needed for uploads +// if these vars are found, set the env vars needed for the azure client. If not set, default upload to Apptio S3 +func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobURL == "" && ka.CustomAzureClientID == "" && ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantID == "" { if ka.APIKey == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + "when not using CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") } - return false + return false, "" } if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobURL == "" || ka.CustomAzureClientID == "" || ka.CustomAzureClientSecret == "" || ka.CustomAzureTenantID == "" { @@ -263,9 +273,12 @@ func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobURL, ka.CustomAzureClientID, ka.CustomAzureTenantID, ka.CustomAzureClientSecret) } + os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantID) + os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientID) + os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) log.Infof("Detected custom Azure blob configuration, "+ "Will upload collected metrics to %s", ka.CustomAzureUploadBlobContainerName) - return true + return true, "azure" } func performConnectionChecks(ka *KubeAgentConfig) error { @@ -474,14 +487,17 @@ func (ka KubeAgentConfig) sendMetrics(metricSample *os.File) { } } -func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(customS3Mode bool, customAzureMode bool, metricSample *os.File) { - if customS3Mode { +// sendMetricsBasedOnUploadMode checks the agentProvider for a custom upload config. If none are found it will use the +// default upload mode. This will allow for more custom provider upload options in the future. +func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(agentProvider string, metricSample *os.File) { + switch agentProvider { + case "s3": log.Infof("Uploading Metrics to Custom S3 Bucket %s", ka.CustomS3UploadBucket) go ka.sendMetricsToCustomS3(metricSample) - } else if customAzureMode { + case "azure": log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) go ka.sendMetricsToCustomBlob(metricSample) - } else { + default: log.Info("Uploading Metrics") go ka.sendMetrics(metricSample) } @@ -527,9 +543,6 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } func (ka KubeAgentConfig) sendMetricsToCustomBlob(metricSample *os.File) { - os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantID) - os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientID) - os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("Could not establish Azure credentials, "+ @@ -573,10 +586,6 @@ func generateSampleKey(clusterUID, provider string) string { year, month, day := currentTime.Date() hour := currentTime.Hour() minute := currentTime.Minute() - if provider == "aws" { - return fmt.Sprintf("/production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, - int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) - } if provider == "azure" { return fmt.Sprintf("production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) From 9181575ac95fecffc98f2c4c1a01b541bd2f71b0 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 14 Oct 2024 17:02:52 -0700 Subject: [PATCH 08/28] linter fixes --- kubernetes/kubernetes.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 6000830e..e97dd02f 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -103,6 +103,9 @@ const retryCount uint = 10 const DefaultCollectionRetry = 1 const DefaultInformerResync = 24 +// azure const created for linter error: string `azure` has 3 occurrences, make it a constant (goconst) +const azure = "azure" + // node connection methods const proxy = "proxy" const direct = "direct" @@ -229,6 +232,9 @@ func isCustomUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { var isCustomUpload bool var agentMode string isCustomUpload, agentMode = isCustomS3UploadEnvsSet(ka) + if isCustomUpload { + return isCustomUpload, agentMode + } isCustomUpload, agentMode = isCustomAzureUploadEnvsSet(ka) return isCustomUpload, agentMode } @@ -278,7 +284,7 @@ func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) log.Infof("Detected custom Azure blob configuration, "+ "Will upload collected metrics to %s", ka.CustomAzureUploadBlobContainerName) - return true, "azure" + return true, azure } func performConnectionChecks(ka *KubeAgentConfig) error { @@ -494,7 +500,7 @@ func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(agentProvider string, met case "s3": log.Infof("Uploading Metrics to Custom S3 Bucket %s", ka.CustomS3UploadBucket) go ka.sendMetricsToCustomS3(metricSample) - case "azure": + case azure: log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) go ka.sendMetricsToCustomBlob(metricSample) default: @@ -562,7 +568,7 @@ func (ka KubeAgentConfig) uploadBlob(client *azblob.Client, metricSample *os.Fil log.Fatalf("Unable to open metric sample file %v", err) } defer file.Close() - key := generateSampleKey(ka.clusterUID, "azure") + key := generateSampleKey(ka.clusterUID, azure) _, err = client.UploadFile(context.Background(), ka.CustomAzureUploadBlobContainerName, key, file, nil) if err != nil { log.Fatalf("Failed to put Object to custom Azure blob with error: %s", err) From 220145f405967b0641d31553625152538d7c3600 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 15 Oct 2024 12:52:20 -0700 Subject: [PATCH 09/28] Update kubernetes.go --- kubernetes/kubernetes.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index e97dd02f..e89b26f4 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -279,9 +279,6 @@ func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobURL, ka.CustomAzureClientID, ka.CustomAzureTenantID, ka.CustomAzureClientSecret) } - os.Setenv("AZURE_TENANT_ID", ka.CustomAzureTenantID) - os.Setenv("AZURE_CLIENT_ID", ka.CustomAzureClientID) - os.Setenv("AZURE_CLIENT_SECRET", ka.CustomAzureClientSecret) log.Infof("Detected custom Azure blob configuration, "+ "Will upload collected metrics to %s", ka.CustomAzureUploadBlobContainerName) return true, azure @@ -549,7 +546,8 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } func (ka KubeAgentConfig) sendMetricsToCustomBlob(metricSample *os.File) { - cred, err := azidentity.NewDefaultAzureCredential(nil) + cred, err := azidentity.NewClientSecretCredential(ka.CustomAzureTenantID, ka.CustomAzureClientID, + ka.CustomAzureClientSecret, nil) if err != nil { log.Fatalf("Could not establish Azure credentials, "+ "ensure Azure environment variables are set correctly: %s", err) From 4808887bfe24f7a218b7be5347c64d74951d83cf Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 15 Oct 2024 16:34:53 -0700 Subject: [PATCH 10/28] review updates 2 --- cmd/kubernetesCmd.go | 3 +- kubernetes/kubernetes.go | 127 ++++++++++++++++++++++----------------- 2 files changed, 73 insertions(+), 57 deletions(-) diff --git a/cmd/kubernetesCmd.go b/cmd/kubernetesCmd.go index a6a539df..86f33fc4 100644 --- a/cmd/kubernetesCmd.go +++ b/cmd/kubernetesCmd.go @@ -154,8 +154,7 @@ func init() { &config.CustomAzureUploadBlobContainerName, "custom_azure_blob_container_name", "", - "The Azure blob container name the metrics-agent will upload data to. Default is an empty string "+ - "which will not upload to custom azure location", + "The Azure blob container name the metrics-agent will upload data to.", ) kubernetesCmd.PersistentFlags().StringVar( &config.CustomAzureBlobURL, diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index e89b26f4..7fd0acd9 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -10,6 +10,9 @@ import ( "encoding/json" "errors" "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/aws/aws-sdk-go/aws" "io" "net/http" "net/url" @@ -23,7 +26,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" @@ -103,8 +105,10 @@ const retryCount uint = 10 const DefaultCollectionRetry = 1 const DefaultInformerResync = 24 -// azure const created for linter error: string `azure` has 3 occurrences, make it a constant (goconst) -const azure = "azure" +const ( + azureProvider = "azure" + awsProvider = "aws" +) // node connection methods const proxy = "proxy" @@ -210,7 +214,7 @@ func CollectKubeMetrics(config KubeAgentConfig) { } } // Send metric sample - kubeAgent.sendMetricsBasedOnUploadMode(agentProvider, metricSample) + kubeAgent.sendMetricsBasedOnUploadMode(ctx, agentProvider, metricSample) case <-pollChan.C: err := kubeAgent.collectMetrics(ctx, kubeAgent, kubeAgent.Clientset, clientSetNodeSource) @@ -229,25 +233,26 @@ func CollectKubeMetrics(config KubeAgentConfig) { // isCustomUploadEnvsSet checks the KubeAgentConfig for custom upload ENVs and returns true/false and the provider mode // Currently supported: AWS and Azure, the goal is to add more support with this function later func isCustomUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { - var isCustomUpload bool - var agentMode string - isCustomUpload, agentMode = isCustomS3UploadEnvsSet(ka) - if isCustomUpload { - return isCustomUpload, agentMode - } - isCustomUpload, agentMode = isCustomAzureUploadEnvsSet(ka) - return isCustomUpload, agentMode + isCustomS3Upload := isCustomS3UploadEnvsSet(ka) + if isCustomS3Upload { + return isCustomS3Upload, awsProvider + } + isCustomBlobUpload := isCustomAzureUploadEnvsSet(ka) + if isCustomBlobUpload { + return isCustomBlobUpload, azureProvider + } + return false, "" } // isCustomS3UploadEnvsSet checks to see if the agent has a custom S3 location and S3 region to upload to // if both these variables are not set, default upload to Apptio S3 -func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) (bool, string) { +func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { if ka.CustomS3Region == "" && ka.CustomS3UploadBucket == "" { if ka.APIKey == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + "when not using CLOUDABILITY_CUSTOM_S3_BUCKET & CLOUDABILITY_CUSTOM_S3_REGION") } - return false, "" + return false } if ka.CustomS3UploadBucket == "" || ka.CustomS3Region == "" { log.Fatalf("Invalid agent configuration. Detected only one of the two required environment variables "+ @@ -256,32 +261,37 @@ func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) (bool, string) { } log.Infof("Detected custom S3 bucket location and S3 bucket region. "+ "Will upload collected metrics to %s in the aws region %s", ka.CustomS3UploadBucket, ka.CustomS3Region) - return true, "aws" + return true } // isCustomAzureUploadEnvsSet checks to see if the agent has custom Azure credentials needed for uploads // if these vars are found, set the env vars needed for the azure client. If not set, default upload to Apptio S3 -func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { +func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobURL == "" && ka.CustomAzureClientID == "" && ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantID == "" { if ka.APIKey == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + "when not using CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") } - return false, "" + return false + } + if ka.CustomAzureTenantID == "" { + log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_TENANT_ID is not set.") } - if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobURL == "" || ka.CustomAzureClientID == "" || - ka.CustomAzureClientSecret == "" || ka.CustomAzureTenantID == "" { - log.Fatalf("Invalid agent configuration. Detected only one of the six required environment variables "+ - "to run in custom Azure upload mode. CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME is set to %s. "+ - "CLOUDABILITY_CUSTOM_AZURE_BLOB_URL is set to %s CLOUDABILITY_CUSTOM_AZURE_TENANT_ID is set to %s. "+ - "CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID is set to %s. CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET is set to %s.", - ka.CustomAzureUploadBlobContainerName, ka.CustomAzureBlobURL, ka.CustomAzureClientID, ka.CustomAzureTenantID, - ka.CustomAzureClientSecret) + if ka.CustomAzureClientID == "" { + log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID is not set.") + } + if ka.CustomAzureClientSecret == "" { + log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET is not set.") + } + if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobURL == "" { + log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME is set to %s. "+ + "CLOUDABILITY_CUSTOM_AZURE_BLOB_URL is set to %s.", ka.CustomAzureUploadBlobContainerName, + ka.CustomAzureBlobURL) } log.Infof("Detected custom Azure blob configuration, "+ "Will upload collected metrics to %s", ka.CustomAzureUploadBlobContainerName) - return true, azure + return true } func performConnectionChecks(ka *KubeAgentConfig) error { @@ -492,14 +502,15 @@ func (ka KubeAgentConfig) sendMetrics(metricSample *os.File) { // sendMetricsBasedOnUploadMode checks the agentProvider for a custom upload config. If none are found it will use the // default upload mode. This will allow for more custom provider upload options in the future. -func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(agentProvider string, metricSample *os.File) { +func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(ctx context.Context, agentProvider string, + metricSample *os.File) { switch agentProvider { - case "s3": + case awsProvider: log.Infof("Uploading Metrics to Custom S3 Bucket %s", ka.CustomS3UploadBucket) go ka.sendMetricsToCustomS3(metricSample) - case azure: + case azureProvider: log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) - go ka.sendMetricsToCustomBlob(metricSample) + go ka.sendMetricsToCustomBlob(ctx, metricSample) default: log.Info("Uploading Metrics") go ka.sendMetrics(metricSample) @@ -524,7 +535,7 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } defer fileReader.Close() - key := generateSampleKey(ka.clusterUID, "aws") + key := generateSampleKey(ka.clusterUID, awsProvider) sampleToUpload := &s3manager.UploadInput{ Bucket: aws.String(ka.CustomS3UploadBucket), Key: aws.String(key), @@ -545,40 +556,50 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { } } -func (ka KubeAgentConfig) sendMetricsToCustomBlob(metricSample *os.File) { +func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { cred, err := azidentity.NewClientSecretCredential(ka.CustomAzureTenantID, ka.CustomAzureClientID, ka.CustomAzureClientSecret, nil) if err != nil { log.Fatalf("Could not establish Azure credentials, "+ "ensure Azure environment variables are set correctly: %s", err) } - azureClient, err := azblob.NewClient(ka.CustomAzureBlobURL, cred, nil) + retryConfig := azblob.ClientOptions{ + ClientOptions: azcore.ClientOptions{ + Retry: policy.RetryOptions{ + MaxRetries: 3, + }, + }, + } + azureClient, err := azblob.NewClient(ka.CustomAzureBlobURL, cred, &retryConfig) if err != nil { log.Fatalf("Could not establish Azure Client, "+ "ensure Azure environment variables are set correctly: %s", err) } - ka.uploadBlob(azureClient, metricSample) + ka.uploadBlob(ctx, azureClient, metricSample) } -func (ka KubeAgentConfig) uploadBlob(client *azblob.Client, metricSample *os.File) { +func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, metricSample *os.File) { file, err := os.Open(metricSample.Name()) if err != nil { log.Fatalf("Unable to open metric sample file %v", err) } defer file.Close() - key := generateSampleKey(ka.clusterUID, azure) - _, err = client.UploadFile(context.Background(), ka.CustomAzureUploadBlobContainerName, key, file, nil) + key := generateSampleKey(ka.clusterUID, azureProvider) + _, err = client.UploadFile(ctx, ka.CustomAzureUploadBlobContainerName, key, file, nil) if err != nil { log.Fatalf("Failed to put Object to custom Azure blob with error: %s", err) - } else { - sn := strings.Split(metricSample.Name(), "/") - log.Infof("Exported metric sample %s to custom Azure blob: %s", - strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) - } - err = os.Remove(metricSample.Name()) - if err != nil { - log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) } + + sn := strings.Split(metricSample.Name(), "/") + log.Infof("Exported metric sample %s to custom Azure blob: %s", + strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) + + defer func(name string) { + err := os.Remove(name) + if err != nil { + log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) + } + }(metricSample.Name()) } // generateSampleKey creates a key (location) for s3 or azure to upload the sample to. Example of s3 location format @@ -586,16 +607,16 @@ func (ka KubeAgentConfig) uploadBlob(client *azblob.Client, metricSample *os.Fil // example of azure location format // production/data/metrics-agent///
//---.tgz func generateSampleKey(clusterUID, provider string) string { - currentTime := time.Now() + currentTime := time.Now().UTC() year, month, day := currentTime.Date() hour := currentTime.Hour() minute := currentTime.Minute() - if provider == "azure" { - return fmt.Sprintf("production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, - int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) - } - return fmt.Sprintf("/production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, + key := fmt.Sprintf("production/data/metrics-agent/%d/%02d/%02d/%s/%s-%s-%02d-%02d.tgz", year, int(month), day, clusterUID, clusterUID, currentTime.Format("20060102"), hour, minute) + if provider == azureProvider { + return key + } + return "/" + key } func handleError(err error, region string) string { @@ -929,10 +950,6 @@ func createAgentStatusMetric(workDir *os.File, config KubeAgentConfig, sampleSta m.Values["custom_s3_bucket"] = config.CustomS3UploadBucket m.Values["custom_s3_region"] = config.CustomS3Region m.Values["custom_azure_blob_container_name"] = config.CustomAzureUploadBlobContainerName - m.Values["custom_azure_blob_url"] = config.CustomAzureBlobURL - m.Values["custom_azure_tenant_id"] = config.CustomAzureTenantID - m.Values["custom_azure_client_id"] = config.CustomAzureClientID - m.Values["custom_azure_client_secret"] = config.CustomAzureClientSecret if len(config.OutboundProxyAuth) > 0 { m.Values["outbound_proxy_auth"] = "true" } else { From a1affa56472516b380573de598aeb47ff1a09f3b Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Wed, 16 Oct 2024 14:23:10 -0700 Subject: [PATCH 11/28] some refactors --- README.md | 2 +- kubernetes/kubernetes.go | 42 +++++++++++++--------------------------- util/util.go | 17 ++++++++++++++++ 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 77691dde..7fdf8cc3 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | Environment Variable | Description | |------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| CLOUDABILITY_API_KEY | Required: Cloudability api key | +| CLOUDABILITY_API_KEY | Required/Optional: Cloudability api key. Optional only if using Custom S3 upload or Custom Azure blob upload. | | CLOUDABILITY_CLUSTER_NAME | Required: The cluster name to be used for the cluster the agent is running in. | | CLOUDABILITY_POLL_INTERVAL | Optional: The interval (Seconds) to poll metrics. Default: 180 | | CLOUDABILITY_OUTBOUND_PROXY | Optional: The URL of an outbound HTTP/HTTPS proxy for the agent to use (eg: http://x.x.x.x:8080). The URL must contain the scheme prefix (http:// or https://) | diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 7fd0acd9..a70fe5b0 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -233,13 +233,17 @@ func CollectKubeMetrics(config KubeAgentConfig) { // isCustomUploadEnvsSet checks the KubeAgentConfig for custom upload ENVs and returns true/false and the provider mode // Currently supported: AWS and Azure, the goal is to add more support with this function later func isCustomUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { - isCustomS3Upload := isCustomS3UploadEnvsSet(ka) - if isCustomS3Upload { - return isCustomS3Upload, awsProvider - } - isCustomBlobUpload := isCustomAzureUploadEnvsSet(ka) - if isCustomBlobUpload { - return isCustomBlobUpload, azureProvider + if ka.APIKey == "" { + isCustomS3Upload := isCustomS3UploadEnvsSet(ka) + if isCustomS3Upload { + return isCustomS3Upload, awsProvider + } + isCustomBlobUpload := isCustomAzureUploadEnvsSet(ka) + if isCustomBlobUpload { + return isCustomBlobUpload, azureProvider + } + log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + + "when not using CLOUDABILITY_CUSTOM_S3 or CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") } return false, "" } @@ -248,10 +252,6 @@ func isCustomUploadEnvsSet(ka *KubeAgentConfig) (bool, string) { // if both these variables are not set, default upload to Apptio S3 func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { if ka.CustomS3Region == "" && ka.CustomS3UploadBucket == "" { - if ka.APIKey == "" { - log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + - "when not using CLOUDABILITY_CUSTOM_S3_BUCKET & CLOUDABILITY_CUSTOM_S3_REGION") - } return false } if ka.CustomS3UploadBucket == "" || ka.CustomS3Region == "" { @@ -269,10 +269,6 @@ func isCustomS3UploadEnvsSet(ka *KubeAgentConfig) bool { func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { if ka.CustomAzureUploadBlobContainerName == "" && ka.CustomAzureBlobURL == "" && ka.CustomAzureClientID == "" && ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantID == "" { - if ka.APIKey == "" { - log.Fatalf("Invalid agent configuration. CLOUDABILITY_API_KEY is required " + - "when not using CLOUDABILITY_CUSTOM_AZURE_BLOB env vars.") - } return false } if ka.CustomAzureTenantID == "" { @@ -533,8 +529,6 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { if err != nil { log.Fatalf("Unable to open metric sample file %v", err) } - defer fileReader.Close() - key := generateSampleKey(ka.clusterUID, awsProvider) sampleToUpload := &s3manager.UploadInput{ Bucket: aws.String(ka.CustomS3UploadBucket), @@ -550,10 +544,7 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { log.Infof("Exported metric sample %s to custom S3 bucket: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomS3UploadBucket) } - err = os.Remove(metricSample.Name()) - if err != nil { - log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) - } + util.SafeCloseDeferLogger(fileReader) } func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { @@ -583,7 +574,6 @@ func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, if err != nil { log.Fatalf("Unable to open metric sample file %v", err) } - defer file.Close() key := generateSampleKey(ka.clusterUID, azureProvider) _, err = client.UploadFile(ctx, ka.CustomAzureUploadBlobContainerName, key, file, nil) if err != nil { @@ -593,13 +583,7 @@ func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, sn := strings.Split(metricSample.Name(), "/") log.Infof("Exported metric sample %s to custom Azure blob: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) - - defer func(name string) { - err := os.Remove(name) - if err != nil { - log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) - } - }(metricSample.Name()) + util.SafeCloseDeferLogger(file) } // generateSampleKey creates a key (location) for s3 or azure to upload the sample to. Example of s3 location format diff --git a/util/util.go b/util/util.go index 36ba613d..db629dd6 100644 --- a/util/util.go +++ b/util/util.go @@ -288,6 +288,23 @@ func SafeClose(closer func() error, err *error) { } } +// SafeCloseDeferLogger takes a file and runs the deferred closing of both. Used for custom agent uploads +func SafeCloseDeferLogger(file *os.File) { + defer func(name string) { + err := os.Remove(name) + if err != nil { + log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) + } + }(file.Name()) + + defer func(file *os.File) { + err := file.Close() + if err != nil { + log.Warnf("Warning: Unable to close metric sample: %v", err) + } + }(file) +} + // MatchOneFile returns the name of one file based on a given directory and pattern // returning an error if more or less than one match is found. The syntax of patterns is the same // as in filepath.Glob & Match. From a892ad60c09b835bcfe477f2cb5669f5ea0f2cb1 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Thu, 17 Oct 2024 09:53:27 -0700 Subject: [PATCH 12/28] update defer --- kubernetes/kubernetes.go | 4 ++-- util/util.go | 20 ++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index a70fe5b0..8cda26c7 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -544,7 +544,7 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { log.Infof("Exported metric sample %s to custom S3 bucket: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomS3UploadBucket) } - util.SafeCloseDeferLogger(fileReader) + defer util.SafeCloseDeferLogger(fileReader) } func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { @@ -583,7 +583,7 @@ func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, sn := strings.Split(metricSample.Name(), "/") log.Infof("Exported metric sample %s to custom Azure blob: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) - util.SafeCloseDeferLogger(file) + defer util.SafeCloseDeferLogger(file) } // generateSampleKey creates a key (location) for s3 or azure to upload the sample to. Example of s3 location format diff --git a/util/util.go b/util/util.go index db629dd6..4c1f1af4 100644 --- a/util/util.go +++ b/util/util.go @@ -290,19 +290,15 @@ func SafeClose(closer func() error, err *error) { // SafeCloseDeferLogger takes a file and runs the deferred closing of both. Used for custom agent uploads func SafeCloseDeferLogger(file *os.File) { - defer func(name string) { - err := os.Remove(name) - if err != nil { - log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) - } - }(file.Name()) + err := os.Remove(file.Name()) + if err != nil { + log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) + } - defer func(file *os.File) { - err := file.Close() - if err != nil { - log.Warnf("Warning: Unable to close metric sample: %v", err) - } - }(file) + err = file.Close() + if err != nil { + log.Warnf("Warning: Unable to close metric sample: %v", err) + } } // MatchOneFile returns the name of one file based on a given directory and pattern From 403c1cd1babfddf0286d56b72beef16b96388072 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Thu, 17 Oct 2024 10:34:28 -0700 Subject: [PATCH 13/28] safe close update --- kubernetes/kubernetes.go | 4 ++-- util/util.go | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 8cda26c7..8693a742 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -544,7 +544,7 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { log.Infof("Exported metric sample %s to custom S3 bucket: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomS3UploadBucket) } - defer util.SafeCloseDeferLogger(fileReader) + util.SafeCloseLogger(fileReader) } func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { @@ -583,7 +583,7 @@ func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, sn := strings.Split(metricSample.Name(), "/") log.Infof("Exported metric sample %s to custom Azure blob: %s", strings.TrimSuffix(sn[len(sn)-1], ".tgz"), ka.CustomAzureUploadBlobContainerName) - defer util.SafeCloseDeferLogger(file) + util.SafeCloseLogger(file) } // generateSampleKey creates a key (location) for s3 or azure to upload the sample to. Example of s3 location format diff --git a/util/util.go b/util/util.go index 4c1f1af4..753ec703 100644 --- a/util/util.go +++ b/util/util.go @@ -288,16 +288,15 @@ func SafeClose(closer func() error, err *error) { } } -// SafeCloseDeferLogger takes a file and runs the deferred closing of both. Used for custom agent uploads -func SafeCloseDeferLogger(file *os.File) { - err := os.Remove(file.Name()) +// SafeCloseLogger takes a file and runs the deferred closing of both. Used for custom agent uploads +func SafeCloseLogger(file *os.File) { + err := file.Close() if err != nil { - log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) + log.Warnf("Warning: Unable to close metric sample: %v", err) } - - err = file.Close() + err = os.Remove(file.Name()) if err != nil { - log.Warnf("Warning: Unable to close metric sample: %v", err) + log.Warnf("Warning: Unable to cleanup after metric sample upload: %v", err) } } From f03f2388ae8a461a7e447a66976d87de476215aa Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Thu, 17 Oct 2024 12:57:16 -0700 Subject: [PATCH 14/28] Update util.go --- util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index 753ec703..cd846e64 100644 --- a/util/util.go +++ b/util/util.go @@ -288,7 +288,7 @@ func SafeClose(closer func() error, err *error) { } } -// SafeCloseLogger takes a file and runs the deferred closing of both. Used for custom agent uploads +// SafeCloseLogger takes a file and closes then removes it. Used for custom agent uploads func SafeCloseLogger(file *os.File) { err := file.Close() if err != nil { From 2c379cc159e3b4f1deb2c790089fc7d6f0721002 Mon Sep 17 00:00:00 2001 From: jdhudson3 <43144225+jdhudson3@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:06:32 -0500 Subject: [PATCH 15/28] beta changes for filtering old data --- .snyk | 21 ++++++--- README.md | 4 +- charts/metrics-agent/Chart.yaml | 4 +- .../templates/extra-objects.yaml | 4 ++ charts/metrics-agent/values.yaml | 20 +++++++- client/client.go | 6 +-- client/client_test.go | 4 ++ go.mod | 2 +- kubernetes/kubernetes_test.go | 47 +++++++++++++++---- retrieval/k8s/k8s_stats.go | 36 +++++++++++++- testdata/pods.jsonl | 2 + version/version.go | 2 +- 12 files changed, 126 insertions(+), 26 deletions(-) create mode 100644 charts/metrics-agent/templates/extra-objects.yaml diff --git a/.snyk b/.snyk index 30e4fbe3..d0635e83 100644 --- a/.snyk +++ b/.snyk @@ -33,27 +33,27 @@ ignore: SNYK-GOLANG-GOLANGORGXIMAGETIFF-7268348: - '*': reason: No fix available yet - expires: 2024-10-11T00:00:00.000Z + expires: 2025-01-11T00:00:00.000Z created: 2024-07-11T23:07:11.176Z SNYK-GOLANG-K8SIOCLIENTGOTRANSPORT-7538822: - '*': reason: >- - When bumping this dependency to the recommended version several critical vulnerabilities are introduced. - Ignoring for 90 days. + When bumping this dependency to the recommended version several + critical vulnerabilities are introduced. Ignoring for 90 days. expires: 2024-10-22T00:00:00.000Z created: 2024-07-23T00:41:35.050Z SNYK-GOLANG-K8SIOCLIENTGOUTILJSONPATH-7540854: - '*': reason: >- - When bumping this dependency to the recommended version several critical vulnerabilities are introduced. - Ignoring for 90 days. + When bumping this dependency to the recommended version several + critical vulnerabilities are introduced. Ignoring for 90 days. expires: 2024-10-22T00:00:00.000Z created: 2024-07-23T00:42:14.222Z SNYK-GOLANG-K8SIOAPISERVERPLUGINPKGAUTHENTICATORTOKENOIDC-7459774: - '*': reason: >- - When bumping this dependency to the recommended version several critical vulnerabilities are introduced. - Ignoring for 90 days. + When bumping this dependency to the recommended version several + critical vulnerabilities are introduced. Ignoring for 90 days. expires: 2024-10-22T00:00:00.000Z created: 2024-07-23T00:42:33.848Z SNYK-CC-K8S-8: @@ -64,4 +64,11 @@ ignore: volume/volumeMount to their deployment expires: 2200-01-01T00:00:00.000Z created: 2024-07-23T00:43:23.074Z + SNYK-ALPINE320-OPENSSL-8235201: + - '*': + reason: >- + Alpine 3.20.3 is the newest version of alpine available, ignoring + temporarily until patch version is ready + expires: 2024-11-30T00:00:00.000Z + created: 2024-10-30T18:01:47.217Z patch: {} diff --git a/README.md b/README.md index 7575a595..b6994daa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The metrics-agent collects allocation metrics from a Kubernetes cluster system a By default, the agent runs in a namespace named "cloudability" (see options below). Once deployed, the agent will pull metrics from the Kubernetes API and directly from each node in the cluster it is running in. An example kubernetes deployment can be found [here](deploy/kubernetes/cloudability-metrics-agent.yaml). -Every 10 minutes the metrics agent creates a tarball of the gathered metrics and uploads to an Amazon Web Service S3 bucket. This process requires outbound connections to https://metrics-collector.cloudability.com/, to obtain a pre-signed URL, and https://cldy-cake-pipeline.s3.amazonaws.com/ to upload the data. If the metrics agent is deployed behind a firewall, these addresses should be added to the outbound allow list. +Every 10 minutes the metrics agent creates a tarball of the gathered metrics and uploads to an Amazon Web Service S3 bucket. This process requires outbound connections to https://metrics-collector.cloudability.com/, to obtain a pre-signed URL, and https://apptio*.s3.amazonaws.com/ to upload the data. If the metrics agent is deployed behind a firewall, these addresses should be added to the outbound allow list. ## Supported Versions @@ -56,7 +56,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | CLOUDABILITY_INFORMER_RESYNC_INTERVAL | Optional: Period of time (in hours) that the informers will fully resync the list of running resources. Default: 24 hours. Can be set to 0 to never resync | | CLOUDABILITY_PARSE_METRIC_DATA | Optional: When true, core files will be parsed and non-relevant data will be removed prior to upload. Default: `false` | | CLOUDABILITY_HTTPS_CLIENT_TIMEOUT | Optional: Amount (in seconds) of time the http client has before timing out requests. Might need to be increased to clusters with large payloads. Default: `60` | -| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1`, `us-gov-west-1` | +| CLOUDABILITY_UPLOAD_REGION | Optional: The region the metrics-agent will upload data to. Default `us-west-2`. Supported values: `us-west-2`, `eu-central-1`, `ap-southeast-2`, `me-central-1`, `us-gov-west-1` | | CLOUDABILITY_CUSTOM_S3_BUCKET | Optional: A custom S3 bucket the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. CLOUDABILITY_CUSTOM_S3_REGION is REQUIRED if this is set. | | CLOUDABILITY_CUSTOM_S3_REGION | Optional: The AWS region that the custom s3 bucket is in. This will initialize the correct region for the s3 client. CLOUDABILITY_CUSTOM_S3_BUCKET is REQUIRED if this is set. | diff --git a/charts/metrics-agent/Chart.yaml b/charts/metrics-agent/Chart.yaml index 0d1a1987..2a8972bb 100644 --- a/charts/metrics-agent/Chart.yaml +++ b/charts/metrics-agent/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 2.11.30 +version: 2.11.33 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 2.11.30 \ No newline at end of file +appVersion: 2.11.33 \ No newline at end of file diff --git a/charts/metrics-agent/templates/extra-objects.yaml b/charts/metrics-agent/templates/extra-objects.yaml new file mode 100644 index 00000000..2855904e --- /dev/null +++ b/charts/metrics-agent/templates/extra-objects.yaml @@ -0,0 +1,4 @@ +{{ range .Values.extraObjects }} +--- +{{ tpl (toYaml .) $ }} +{{ end }} \ No newline at end of file diff --git a/charts/metrics-agent/values.yaml b/charts/metrics-agent/values.yaml index ce7a6c28..d2e81c6b 100644 --- a/charts/metrics-agent/values.yaml +++ b/charts/metrics-agent/values.yaml @@ -24,7 +24,7 @@ pollInterval: 180 image: name: cloudability/metrics-agent - tag: 2.11.30 + tag: 2.11.33 pullPolicy: Always imagePullSecrets: [] @@ -108,3 +108,21 @@ readOnlyRootFilesystem: false drop: - ALL + +# Extra K8s manifests to deploy, +# NOTE: not all various extraObject deployment configurations are tested/supported. When adding extra resources +# to the metrics-agent deployment, Cloudability may not be able to assist in deployment troubleshooting +extraObjects: [] +# Example extra manifest +# - apiVersion: external-secrets.io/v1beta1 +# kind: SecretStore +# metadata: +# name: aws-store-xxxxx +# annotations: +# argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true +# argocd.argoproj.io/sync-wave: "99" +# spec: +# provider: +# aws: +# service: SecretsManager +# region: us-west-2 diff --git a/client/client.go b/client/client.go index 1f0d409c..2639d96e 100644 --- a/client/client.go +++ b/client/client.go @@ -34,7 +34,7 @@ const DefaultBaseURL string = "https://metrics-collector.cloudability.com/metric const EUBaseURL string = "https://metrics-collector-eu.cloudability.com/metricsample" const AUBaseURL string = "https://metrics-collector-au.cloudability.com/metricsample" const MEBaseURL string = "https://metrics-collector-me.cloudability.com/metricsample" -const UsGovEngBaseURL string = "https://metrics-collector-gov-eng.cloudability.com/metricsample" +const GovBaseURL string = "https://metrics-collector-production-gov.cloudability.com/metricsample" const defaultTimeout = 1 * time.Minute const defaultMaxRetries = 5 @@ -422,10 +422,10 @@ func GetUploadURLByRegion(region string) string { return AUBaseURL case "me-central-1": return MEBaseURL - case "us-gov-west-1": - return UsGovEngBaseURL case "us-west-2": return DefaultBaseURL + case "us-gov-west-1": + return GovBaseURL default: log.Warnf("Region %s is not supported. Defaulting to us-west-2 region.", region) return DefaultBaseURL diff --git a/client/client_test.go b/client/client_test.go index 49f49916..c24f185b 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -553,6 +553,10 @@ func Test_getUploadURLByRegion(t *testing.T) { if uploadURL != client.MEBaseURL { t.Error("ME URL was not generated correctly") } + uploadURL = client.GetUploadURLByRegion("us-gov-west-1") + if uploadURL != client.GovBaseURL { + t.Error("Gov URL was not generated correctly") + } // unsupported region should default to us-west-2 url generation uploadURL = client.GetUploadURLByRegion("my-unsupported-region-1") if uploadURL != client.DefaultBaseURL { diff --git a/go.mod b/go.mod index dcbd2b4d..41727efc 100644 --- a/go.mod +++ b/go.mod @@ -90,7 +90,7 @@ replace ( github.com/docker/docker => github.com/docker/docker v25.0.5+incompatible github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.18 - github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.12 + github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.14 golang.org/x/crypto => golang.org/x/crypto v0.24.0 golang.org/x/image => golang.org/x/image v0.10.0 golang.org/x/net => golang.org/x/net v0.23.0 diff --git a/kubernetes/kubernetes_test.go b/kubernetes/kubernetes_test.go index 248be8da..5d14e5f2 100644 --- a/kubernetes/kubernetes_test.go +++ b/kubernetes/kubernetes_test.go @@ -1,6 +1,7 @@ package kubernetes import ( + "bytes" "context" "encoding/json" "net/http" @@ -400,6 +401,24 @@ func TestCollectMetrics(t *testing.T) { return nil }) }) + t.Run("Ensure that resources are properly filtered out", func(t *testing.T) { + filepath.Walk(ka.msExportDirectory.Name(), func(path string, info os.FileInfo, err error) error { + if err != nil { + t.Error(err) + } + if strings.Contains(info.Name(), "jsonl") { + in, err := os.ReadFile(path) + if err != nil { + t.Error(err) + } + fileLen := strings.Count(string(in), "\n") + if fileLen != 1 { + t.Errorf("Expected 1 entry in file %s, got %d", info.Name(), fileLen) + } + } + return nil + }) + }) t.Run("Ensure collection occurs with parseMetrics enabled"+ "ensure sensitive data is stripped", func(t *testing.T) { err = kubeAgentParseMetrics.collectMetrics(context.TODO(), kubeAgentParseMetrics, cs, fns) @@ -594,25 +613,37 @@ func getMockInformers(clusterVersion float64, stopCh chan struct{}) (map[string] nodes.Add(&v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "n1", Annotations: annotation}}) persistentVolumes.Add(&v1.PersistentVolume{ObjectMeta: metav1.ObjectMeta{Name: "pv1", Annotations: annotation}}) persistentVolumeClaims.Add(&v1.PersistentVolumeClaim{ObjectMeta: metav1.ObjectMeta{Name: "pvc1", Annotations: annotation}}) - replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs1", Annotations: annotation}}) + replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs1", Annotations: annotation}, + Status: v1apps.ReplicaSetStatus{Replicas: int32(1)}}) + // should not be exported as replicaset is empty + replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs2", Annotations: annotation}}) daemonSets.Add(&v1apps.DaemonSet{ObjectMeta: metav1.ObjectMeta{Name: "ds1", Annotations: annotation}}) jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job1", Annotations: annotation}}) + oneDayAgo := metav1.NewTime(time.Now().Add(-24 * time.Hour)) + // should not be exported as job was completed some time ago + jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job2", Annotations: annotation}, + Status: v1batch.JobStatus{CompletionTime: &oneDayAgo}}) + // should not be exported as job was completed some time ago + jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job3", Annotations: annotation}, + Status: v1batch.JobStatus{Failed: int32(1), StartTime: &oneDayAgo}}) if clusterVersion > 1.20 { cronJobs.Add(&v1batch.CronJob{ObjectMeta: metav1.ObjectMeta{Name: "cj1", Annotations: annotation}}) } - // pods is unique as we use this pod file for parseMetrics testing - // for parseMetricData testing, add a cldy metrics-agent pod to the mock informers + // adds 3 pods, two of which completed long ago and will not be added to export sample podData, err := os.ReadFile("../testdata/pods.jsonl") if err != nil { return nil, err } - var myPod *v1.Pod - err = json.Unmarshal(podData, &myPod) - if err != nil { - return nil, err + dec := json.NewDecoder(bytes.NewReader(podData)) + for dec.More() { + var pod v1.Pod + if err := dec.Decode(&pod); err != nil { + return nil, err + } + pods.Add(&pod) } - pods.Add(myPod) + // namespace also used in testing namespaceData, err := os.ReadFile("../testdata/namespaces.jsonl") if err != nil { diff --git a/retrieval/k8s/k8s_stats.go b/retrieval/k8s/k8s_stats.go index 21ef53f5..69b668c7 100644 --- a/retrieval/k8s/k8s_stats.go +++ b/retrieval/k8s/k8s_stats.go @@ -96,7 +96,9 @@ func writeK8sResourceFile(workDir *os.File, resourceName string, datawriter := bufio.NewWriter(file) for _, k8Resource := range resourceList { - + if shouldSkipResource(k8Resource) { + continue + } if parseMetricData { k8Resource = sanitizeData(k8Resource) } @@ -124,6 +126,38 @@ func writeK8sResourceFile(workDir *os.File, resourceName string, return err } +//nolint:gocyclo +func shouldSkipResource(k8Resource interface{}) bool { + // safe buffer to allow for longer lived resources to be ingested correctly + previousHour := time.Now().Add(-1 * time.Hour) + switch resource := k8Resource.(type) { + case *v1batch.Job: + if resource.Status.CompletionTime != nil && + previousHour.After(resource.Status.CompletionTime.Time) { + return true + } + if resource.Status.Failed > 0 && resource.Status.StartTime != nil && + previousHour.After(resource.Status.StartTime.Time) { + return true + } + case *corev1.Pod: + if resource.Status.Phase == corev1.PodSucceeded || resource.Status.Phase == corev1.PodFailed { + canSkip := true + for _, v := range resource.Status.ContainerStatuses { + if v.State.Terminated != nil && v.State.Terminated.FinishedAt.After(previousHour) { + canSkip = false + } + } + return canSkip + } + case *v1apps.ReplicaSet: + if resource.Status.Replicas == 0 && previousHour.After(resource.CreationTimestamp.Time) { + return true + } + } + return false +} + // nolint: gocyclo func sanitizeData(to interface{}) interface{} { switch to.(type) { diff --git a/testdata/pods.jsonl b/testdata/pods.jsonl index 569ce016..d7f8d9b0 100644 --- a/testdata/pods.jsonl +++ b/testdata/pods.jsonl @@ -1 +1,3 @@ {"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn2","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} +{"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn3","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Succeeded","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} +{"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn4","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Failed","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} diff --git a/version/version.go b/version/version.go index 596687a8..fd55a3be 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // VERSION is the current version of the agent -var VERSION = "2.11.30" +var VERSION = "2.11.33" From 2a286c98fedb5958b2941094ac295415b0b7a4f3 Mon Sep 17 00:00:00 2001 From: jdhudson3 <43144225+jdhudson3@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:34:14 -0500 Subject: [PATCH 16/28] updates --- kubernetes/kubernetes_test.go | 5 ++++- retrieval/k8s/k8s_stats.go | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/kubernetes/kubernetes_test.go b/kubernetes/kubernetes_test.go index 5d14e5f2..ac06b952 100644 --- a/kubernetes/kubernetes_test.go +++ b/kubernetes/kubernetes_test.go @@ -625,7 +625,10 @@ func getMockInformers(clusterVersion float64, stopCh chan struct{}) (map[string] Status: v1batch.JobStatus{CompletionTime: &oneDayAgo}}) // should not be exported as job was completed some time ago jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job3", Annotations: annotation}, - Status: v1batch.JobStatus{Failed: int32(1), StartTime: &oneDayAgo}}) + Status: v1batch.JobStatus{ + Failed: int32(1), + Conditions: []v1batch.JobCondition{{Type: v1batch.JobFailed, LastTransitionTime: oneDayAgo}}, + }}) if clusterVersion > 1.20 { cronJobs.Add(&v1batch.CronJob{ObjectMeta: metav1.ObjectMeta{Name: "cj1", Annotations: annotation}}) } diff --git a/retrieval/k8s/k8s_stats.go b/retrieval/k8s/k8s_stats.go index 69b668c7..1e02e1a3 100644 --- a/retrieval/k8s/k8s_stats.go +++ b/retrieval/k8s/k8s_stats.go @@ -129,16 +129,21 @@ func writeK8sResourceFile(workDir *os.File, resourceName string, //nolint:gocyclo func shouldSkipResource(k8Resource interface{}) bool { // safe buffer to allow for longer lived resources to be ingested correctly - previousHour := time.Now().Add(-1 * time.Hour) + previousHour := time.Now().UTC().Add(-1 * time.Hour) switch resource := k8Resource.(type) { case *v1batch.Job: if resource.Status.CompletionTime != nil && previousHour.After(resource.Status.CompletionTime.Time) { return true } - if resource.Status.Failed > 0 && resource.Status.StartTime != nil && - previousHour.After(resource.Status.StartTime.Time) { - return true + if resource.Status.Failed > 0 { + for _, condition := range resource.Status.Conditions { + if condition.Type == v1batch.JobFailed { + if previousHour.After(condition.LastTransitionTime.Time) { + return true + } + } + } } case *corev1.Pod: if resource.Status.Phase == corev1.PodSucceeded || resource.Status.Phase == corev1.PodFailed { @@ -151,9 +156,7 @@ func shouldSkipResource(k8Resource interface{}) bool { return canSkip } case *v1apps.ReplicaSet: - if resource.Status.Replicas == 0 && previousHour.After(resource.CreationTimestamp.Time) { - return true - } + return resource.Status.Replicas == 0 && previousHour.After(resource.CreationTimestamp.Time) } return false } From 7b5fa8a01bf53d6931256e61ee731a1987941c4c Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Wed, 13 Nov 2024 10:34:47 -0800 Subject: [PATCH 17/28] Update .snyk --- .snyk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.snyk b/.snyk index 30e4fbe3..19747c32 100644 --- a/.snyk +++ b/.snyk @@ -64,4 +64,11 @@ ignore: volume/volumeMount to their deployment expires: 2200-01-01T00:00:00.000Z created: 2024-07-23T00:43:23.074Z + SNYK-GOLANG-K8SIOAPIMACHINERYPKGUTILRUNTIME-8367153: + - '*': + reason: >- + When bumping this dependency to the recommended version several + critical vulnerabilities are introduced. Ignoring for 30 days. + expires: 2024-12-13T00:00:00.000Z + created: 2024-11-13T23:09:26.278Z patch: {} From d8d327d196ed5838a0ead10520418068632c921b Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 26 Nov 2024 11:18:05 -0800 Subject: [PATCH 18/28] Update .snyk --- .snyk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.snyk b/.snyk index 815a5278..ca17d925 100644 --- a/.snyk +++ b/.snyk @@ -78,11 +78,4 @@ ignore: temporarily until patch version is ready expires: 2024-11-30T00:00:00.000Z created: 2024-10-30T18:01:47.217Z - SNYK-GOLANG-K8SIOAPIMACHINERYPKGUTILRUNTIME-8367153: - - '*': - reason: >- - Ignoring vulnerability for 30 days as newer versions of k8s.io - contain several critical vulnerabilities and are still in alpha - expires: 2025-01-01T00:00:00.000Z - created: 2024-11-13T23:30:00.999Z patch: {} From 00d2dbab20a9abfb8cc0d57cc1aff8fa79a56fe2 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 24 Dec 2024 14:46:08 -0800 Subject: [PATCH 19/28] update for azure managed identity --- README.md | 2 +- go.mod | 16 ++++++++-------- go.sum | 31 +++++++++++++++---------------- kubernetes/kubernetes.go | 34 +++++++++++++++++++++++----------- 4 files changed, 47 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 7fdf8cc3..8f4979c6 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Cloudability Metrics Agent currently does not support Rancher or On Prem cluster | CLOUDABILITY_CUSTOM_S3_BUCKET | Optional: A custom S3 bucket the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. CLOUDABILITY_CUSTOM_S3_REGION is REQUIRED if this is set. | | CLOUDABILITY_CUSTOM_S3_REGION | Optional: The AWS region that the custom s3 bucket is in. This will initialize the correct region for the s3 client. CLOUDABILITY_CUSTOM_S3_BUCKET is REQUIRED if this is set. | | CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME | Optional: A custom Azure blob container name the metrics-agent will upload data to. If set, the metrics-agent will ONLY upload to this custom location. | -| CLOUDABILITY_CUSTOM_AZURE_BLOB_URL | Optional: The Azure storage account's URL. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | +| CLOUDABILITY_CUSTOM_AZURE_BLOB_URL | Optional: The Azure storage account's URL. This will be used to initialize the Azure client. | | CLOUDABILITY_CUSTOM_AZURE_TENANT_ID | Optional: The Azure Service account's Tenant ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | | CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID | Optional: The Azure Service account's Client ID. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | | CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET | Optional: The Azure Service account's Client Secret. This will be used to initialize the Azure client. All CUSTOM_AZURE ENV vars are REQUIRED if this is set | diff --git a/go.mod b/go.mod index 29548025..ec2db090 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,10 @@ module github.com/cloudability/metrics-agent go 1.22 require ( + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 - github.com/aws/aws-sdk-go v1.35.24 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0 + github.com/aws/aws-sdk-go v1.40.27 github.com/google/cadvisor v0.48.1 github.com/googleapis/gnostic v0.5.5 github.com/onsi/ginkgo v1.16.5 @@ -23,7 +24,6 @@ require ( ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/BurntSushi/toml v1.2.1 // indirect @@ -71,12 +71,12 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect @@ -101,7 +101,7 @@ replace ( github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.18 github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.14 - golang.org/x/crypto => golang.org/x/crypto v0.24.0 + golang.org/x/crypto => golang.org/x/crypto v0.31.0 golang.org/x/image => golang.org/x/image v0.10.0 golang.org/x/net => golang.org/x/net v0.23.0 google.golang.org/grpc => google.golang.org/grpc v1.56.3 diff --git a/go.sum b/go.sum index ab313fa7..3dfd7c5d 100644 --- a/go.sum +++ b/go.sum @@ -593,8 +593,8 @@ cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcP dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= @@ -603,8 +603,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xP github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 h1:cf+OIKbkmMHBaC3u78AXomweqM0oxQSgBXRZf3WH4yM= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1/go.mod h1:ap1dmS6vQKJxSMNiGJcq4QuUQkOynyD93gLw6MDF7ek= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0 h1:mlmW46Q0B79I+Aj4azKC6xDMFN9a9SyZWESlGWYXbFs= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0/go.mod h1:PXe2h+LKcWTX9afWdZoHyODqR4fBa5boUM/8uJfZ0Jo= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= @@ -631,8 +631,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/aws/aws-sdk-go v1.35.24 h1:U3GNTg8+7xSM6OAJ8zksiSM4bRqxBWmVwwehvOSNG3A= -github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= +github.com/aws/aws-sdk-go v1.40.27 h1:8fWW0CpmBZ8WWduNwl4vE9t07nMYFrhAsUHjPj81qUM= +github.com/aws/aws-sdk-go v1.40.27/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -1036,8 +1036,8 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1134,6 +1134,7 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1214,13 +1215,12 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1238,9 +1238,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index 8693a742..ddcd105c 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -271,15 +271,6 @@ func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { ka.CustomAzureClientSecret == "" && ka.CustomAzureTenantID == "" { return false } - if ka.CustomAzureTenantID == "" { - log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_TENANT_ID is not set.") - } - if ka.CustomAzureClientID == "" { - log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_CLIENT_ID is not set.") - } - if ka.CustomAzureClientSecret == "" { - log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_CLIENT_SECRET is not set.") - } if ka.CustomAzureUploadBlobContainerName == "" || ka.CustomAzureBlobURL == "" { log.Fatalf("Invalid agent configuration. CLOUDABILITY_CUSTOM_AZURE_BLOB_CONTAINER_NAME is set to %s. "+ "CLOUDABILITY_CUSTOM_AZURE_BLOB_URL is set to %s.", ka.CustomAzureUploadBlobContainerName, @@ -505,8 +496,15 @@ func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(ctx context.Context, agen log.Infof("Uploading Metrics to Custom S3 Bucket %s", ka.CustomS3UploadBucket) go ka.sendMetricsToCustomS3(metricSample) case azureProvider: - log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) - go ka.sendMetricsToCustomBlob(ctx, metricSample) + if ka.CustomAzureTenantID == "" && ka.CustomAzureClientID == "" { + log.Infof("Uploading Metrics to Custom Azure Blob %s with managed identity", + ka.CustomAzureUploadBlobContainerName) + ka.sendMetricsToCustomBlobManagedIdentity(ctx, metricSample) + } else { + log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) + go ka.sendMetricsToCustomBlob(ctx, metricSample) + } + default: log.Info("Uploading Metrics") go ka.sendMetrics(metricSample) @@ -569,6 +567,20 @@ func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSam ka.uploadBlob(ctx, azureClient, metricSample) } +func (ka KubeAgentConfig) sendMetricsToCustomBlobManagedIdentity(ctx context.Context, metricSample *os.File) { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("Could not establish Azure credentials with managed identity, "+ + "ensure Azure environment variables are set correctly: %s", err) + } + azureClient, err := azblob.NewClient(ka.CustomAzureBlobURL, cred, nil) + if err != nil { + log.Fatalf("Could not establish Azure Client with managed identity, "+ + "ensure Azure environment variables are set correctly: %s", err) + } + ka.uploadBlob(ctx, azureClient, metricSample) +} + func (ka KubeAgentConfig) uploadBlob(ctx context.Context, client *azblob.Client, metricSample *os.File) { file, err := os.Open(metricSample.Name()) if err != nil { From b496d97be4d0a7672ae3a3e30a04f9b9ee6c92d5 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 24 Dec 2024 15:08:24 -0800 Subject: [PATCH 20/28] snyk fix --- .snyk | 4 ++-- go.mod | 23 ++++++++++++----------- go.sum | 49 +++++++++++++++++++++++++------------------------ 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.snyk b/.snyk index ca17d925..af3fc71c 100644 --- a/.snyk +++ b/.snyk @@ -68,8 +68,8 @@ ignore: - '*': reason: >- When bumping this dependency to the recommended version several - critical vulnerabilities are introduced. Ignoring for 30 days. - expires: 2024-12-13T00:00:00.000Z + critical vulnerabilities are introduced. Ignoring for 60 days. + expires: 2025-02-13T00:00:00.000Z created: 2024-11-13T23:09:26.278Z SNYK-ALPINE320-OPENSSL-8235201: - '*': diff --git a/go.mod b/go.mod index ec2db090..2d5ee9a8 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/cadvisor v0.48.1 github.com/googleapis/gnostic v0.5.5 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.27.4 + github.com/onsi/gomega v1.29.0 github.com/prometheus/common v0.38.0 github.com/prometheus/prom2json v1.3.0 github.com/sirupsen/logrus v1.9.3 @@ -33,14 +33,15 @@ require ( github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.6.9 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect @@ -71,8 +72,8 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - golang.org/x/crypto v0.28.0 // indirect - golang.org/x/net v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect @@ -85,11 +86,11 @@ require ( gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect - k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) @@ -103,7 +104,7 @@ replace ( github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.14 golang.org/x/crypto => golang.org/x/crypto v0.31.0 golang.org/x/image => golang.org/x/image v0.10.0 - golang.org/x/net => golang.org/x/net v0.23.0 + golang.org/x/net => golang.org/x/net v0.33.0 google.golang.org/grpc => google.golang.org/grpc v1.56.3 google.golang.org/protobuf => google.golang.org/protobuf v1.33.0 ) diff --git a/go.sum b/go.sum index 05917570..9fcab8e3 100644 --- a/go.sum +++ b/go.sum @@ -703,20 +703,20 @@ github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2C github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -751,8 +751,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -762,6 +763,8 @@ github.com/google/cadvisor v0.48.1/go.mod h1:ZkYbiiVdyoqBmI2ahZI8GlmirT78OAOER0z github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -920,12 +923,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= -github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= -github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -1036,6 +1039,7 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1084,8 +1088,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1212,12 +1216,10 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1236,7 +1238,6 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1571,14 +1572,14 @@ k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.27.4 h1:vj2YTtSJ6J4KxaC88P4pMPEQECWMY8gqPqsTgUKzvjk= k8s.io/client-go v0.27.4/go.mod h1:ragcly7lUlN0SRPk5/ZkGnDjPknzb37TICq07WhI6Xc= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/kubelet v0.27.4 h1:P8+MoRx4ikcAc5eEa3k2A6kd8AXtoDRaoC8KX2HFZe4= k8s.io/kubelet v0.27.4/go.mod h1:2y4peCA57vKEhBcDL6Q5EkPuGP7FFxj9U41NV9hk1ac= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= @@ -1621,7 +1622,7 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.17.0 h1:CScmGz/wX66puA06Gj8OZb76Wmk7JIjgWf5JDvY7msM= sigs.k8s.io/kind v0.17.0/go.mod h1:Qqp8AiwOlMZmJWs37Hgs31xcbiYXjtXlRBSftcnZXQk= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From 9ce283c6ad323bd4361725a9b3a6b0b85733ddf2 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 30 Dec 2024 10:02:54 -0800 Subject: [PATCH 21/28] lint fix --- go.mod | 53 ++++++++++++++------------- go.sum | 111 ++++++++++++++++++++++++++++++++------------------------- 2 files changed, 88 insertions(+), 76 deletions(-) diff --git a/go.mod b/go.mod index 2d5ee9a8..e9a1b04b 100644 --- a/go.mod +++ b/go.mod @@ -10,16 +10,16 @@ require ( github.com/google/cadvisor v0.48.1 github.com/googleapis/gnostic v0.5.5 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.29.0 - github.com/prometheus/common v0.38.0 + github.com/onsi/gomega v1.35.1 + github.com/prometheus/common v0.55.0 github.com/prometheus/prom2json v1.3.0 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.6.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.13.0 - k8s.io/api v0.27.4 - k8s.io/apimachinery v0.27.4 - k8s.io/client-go v0.27.4 - k8s.io/kubelet v0.27.4 + k8s.io/api v0.32.0 + k8s.io/apimachinery v0.32.0 + k8s.io/client-go v0.32.0 + k8s.io/kubelet v0.32.0 sigs.k8s.io/kind v0.17.0 ) @@ -28,27 +28,25 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/alessio/shellescape v1.4.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.10.0 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/go-logr/logr v1.3.0 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic v0.6.9 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -66,32 +64,33 @@ require ( github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect + github.com/x448/float16 v0.8.4 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/time v0.7.0 // indirect + google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) //Some of our dependencies have not updated their dependency imports diff --git a/go.sum b/go.sum index 9fcab8e3..967bf002 100644 --- a/go.sum +++ b/go.sum @@ -637,7 +637,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -658,16 +657,18 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/emicklei/go-restful/v3 v3.10.0 h1:X4gma4HM7hFm6WMeAsTfqA0GOfdNoCzBIkHGoRLGXuM= -github.com/emicklei/go-restful/v3 v3.10.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= @@ -675,11 +676,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -688,6 +686,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= @@ -703,20 +703,23 @@ github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2C github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -761,8 +764,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/cadvisor v0.48.1 h1:eyYTxKBd+KxI1kh6rst4JSTLUhfHQM34qGpp+0AMlSg= github.com/google/cadvisor v0.48.1/go.mod h1:ZkYbiiVdyoqBmI2ahZI8GlmirT78OAOER0z4EQugkxQ= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -803,8 +804,9 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= @@ -843,11 +845,11 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -923,12 +925,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= +github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -947,8 +949,9 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -958,10 +961,14 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.38.0 h1:VTQitp6mXTdUoCmDMugDVOJ1opi6ADftKfp/yeqTR/E= github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= @@ -991,6 +998,8 @@ github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155 github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +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/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1016,9 +1025,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1116,8 +1124,9 @@ golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1245,8 +1254,9 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= +golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1311,8 +1321,9 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1391,7 +1402,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1456,7 +1466,6 @@ google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= @@ -1538,6 +1547,8 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -1555,7 +1566,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1566,20 +1576,22 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs= -k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y= -k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= -k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= -k8s.io/client-go v0.27.4 h1:vj2YTtSJ6J4KxaC88P4pMPEQECWMY8gqPqsTgUKzvjk= -k8s.io/client-go v0.27.4/go.mod h1:ragcly7lUlN0SRPk5/ZkGnDjPknzb37TICq07WhI6Xc= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= +k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= +k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= +k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8= +k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8= +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-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= k8s.io/kubelet v0.27.4 h1:P8+MoRx4ikcAc5eEa3k2A6kd8AXtoDRaoC8KX2HFZe4= k8s.io/kubelet v0.27.4/go.mod h1:2y4peCA57vKEhBcDL6Q5EkPuGP7FFxj9U41NV9hk1ac= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kubelet v0.32.0 h1:uLyiKlz195Wo4an/K2tyge8o3QHx0ZkhVN3pevvp59A= +k8s.io/kubelet v0.32.0/go.mod h1:lAwuVZT/Hm7EdLn0jW2D+WdrJoorjJL2rVSdhOFnegw= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= @@ -1618,11 +1630,12 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/kind v0.17.0 h1:CScmGz/wX66puA06Gj8OZb76Wmk7JIjgWf5JDvY7msM= sigs.k8s.io/kind v0.17.0/go.mod h1:Qqp8AiwOlMZmJWs37Hgs31xcbiYXjtXlRBSftcnZXQk= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 7ff04db4584e8dd3a8a695e7ad31de2a81d69fa3 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 30 Dec 2024 10:07:33 -0800 Subject: [PATCH 22/28] revert to master go.mod --- go.mod | 64 ++++++++++++++--------------- go.sum | 125 ++++++++++++++++++++++++++------------------------------- 2 files changed, 88 insertions(+), 101 deletions(-) diff --git a/go.mod b/go.mod index e9a1b04b..ec2db090 100644 --- a/go.mod +++ b/go.mod @@ -10,16 +10,16 @@ require ( github.com/google/cadvisor v0.48.1 github.com/googleapis/gnostic v0.5.5 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.35.1 - github.com/prometheus/common v0.55.0 + github.com/onsi/gomega v1.27.4 + github.com/prometheus/common v0.38.0 github.com/prometheus/prom2json v1.3.0 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.8.1 + github.com/spf13/cobra v1.6.0 github.com/spf13/viper v1.13.0 - k8s.io/api v0.32.0 - k8s.io/apimachinery v0.32.0 - k8s.io/client-go v0.32.0 - k8s.io/kubelet v0.32.0 + k8s.io/api v0.27.4 + k8s.io/apimachinery v0.27.4 + k8s.io/client-go v0.27.4 + k8s.io/kubelet v0.27.4 sigs.k8s.io/kind v0.17.0 ) @@ -28,25 +28,26 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/alessio/shellescape v1.4.1 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful/v3 v3.10.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -64,33 +65,32 @@ require ( github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - github.com/x448/float16 v0.8.4 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.7.0 // indirect - google.golang.org/protobuf v1.35.1 // indirect - gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) //Some of our dependencies have not updated their dependency imports @@ -103,7 +103,7 @@ replace ( github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.14 golang.org/x/crypto => golang.org/x/crypto v0.31.0 golang.org/x/image => golang.org/x/image v0.10.0 - golang.org/x/net => golang.org/x/net v0.33.0 + golang.org/x/net => golang.org/x/net v0.23.0 google.golang.org/grpc => google.golang.org/grpc v1.56.3 google.golang.org/protobuf => google.golang.org/protobuf v1.33.0 ) diff --git a/go.sum b/go.sum index 967bf002..3dfd7c5d 100644 --- a/go.sum +++ b/go.sum @@ -637,6 +637,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -657,18 +658,16 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.10.0 h1:X4gma4HM7hFm6WMeAsTfqA0GOfdNoCzBIkHGoRLGXuM= +github.com/emicklei/go-restful/v3 v3.10.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= @@ -676,8 +675,11 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -686,8 +688,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= -github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= @@ -703,23 +703,20 @@ github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2C github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -754,9 +751,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -764,8 +760,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/cadvisor v0.48.1 h1:eyYTxKBd+KxI1kh6rst4JSTLUhfHQM34qGpp+0AMlSg= github.com/google/cadvisor v0.48.1/go.mod h1:ZkYbiiVdyoqBmI2ahZI8GlmirT78OAOER0z4EQugkxQ= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= +github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -804,9 +800,8 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= -github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= @@ -845,11 +840,11 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -925,12 +920,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= -github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= -github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -949,9 +944,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -961,14 +955,10 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.38.0 h1:VTQitp6mXTdUoCmDMugDVOJ1opi6ADftKfp/yeqTR/E= github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= @@ -998,8 +988,6 @@ github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155 github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -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/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1025,8 +1013,9 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1096,8 +1085,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1124,9 +1113,8 @@ golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1225,10 +1213,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1247,6 +1237,7 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1254,9 +1245,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= -golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1321,9 +1311,8 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1402,6 +1391,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1466,6 +1456,7 @@ google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= @@ -1547,8 +1538,6 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= -gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -1566,6 +1555,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1576,22 +1566,20 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= -k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= -k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= -k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8= -k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8= -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-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs= +k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y= +k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= +k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.27.4 h1:vj2YTtSJ6J4KxaC88P4pMPEQECWMY8gqPqsTgUKzvjk= +k8s.io/client-go v0.27.4/go.mod h1:ragcly7lUlN0SRPk5/ZkGnDjPknzb37TICq07WhI6Xc= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kubelet v0.27.4 h1:P8+MoRx4ikcAc5eEa3k2A6kd8AXtoDRaoC8KX2HFZe4= k8s.io/kubelet v0.27.4/go.mod h1:2y4peCA57vKEhBcDL6Q5EkPuGP7FFxj9U41NV9hk1ac= -k8s.io/kubelet v0.32.0 h1:uLyiKlz195Wo4an/K2tyge8o3QHx0ZkhVN3pevvp59A= -k8s.io/kubelet v0.32.0/go.mod h1:lAwuVZT/Hm7EdLn0jW2D+WdrJoorjJL2rVSdhOFnegw= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= @@ -1630,12 +1618,11 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.17.0 h1:CScmGz/wX66puA06Gj8OZb76Wmk7JIjgWf5JDvY7msM= sigs.k8s.io/kind v0.17.0/go.mod h1:Qqp8AiwOlMZmJWs37Hgs31xcbiYXjtXlRBSftcnZXQk= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 04df1faf78341a88a1cc6f8065a384aeb928dd3c Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 30 Dec 2024 13:11:25 -0800 Subject: [PATCH 23/28] reverting changes introduced through beta branch --- kubernetes/kubernetes_test.go | 50 ++++++----------------------------- retrieval/k8s/k8s_stats.go | 39 +-------------------------- testdata/pods.jsonl | 2 -- 3 files changed, 9 insertions(+), 82 deletions(-) diff --git a/kubernetes/kubernetes_test.go b/kubernetes/kubernetes_test.go index ac06b952..248be8da 100644 --- a/kubernetes/kubernetes_test.go +++ b/kubernetes/kubernetes_test.go @@ -1,7 +1,6 @@ package kubernetes import ( - "bytes" "context" "encoding/json" "net/http" @@ -401,24 +400,6 @@ func TestCollectMetrics(t *testing.T) { return nil }) }) - t.Run("Ensure that resources are properly filtered out", func(t *testing.T) { - filepath.Walk(ka.msExportDirectory.Name(), func(path string, info os.FileInfo, err error) error { - if err != nil { - t.Error(err) - } - if strings.Contains(info.Name(), "jsonl") { - in, err := os.ReadFile(path) - if err != nil { - t.Error(err) - } - fileLen := strings.Count(string(in), "\n") - if fileLen != 1 { - t.Errorf("Expected 1 entry in file %s, got %d", info.Name(), fileLen) - } - } - return nil - }) - }) t.Run("Ensure collection occurs with parseMetrics enabled"+ "ensure sensitive data is stripped", func(t *testing.T) { err = kubeAgentParseMetrics.collectMetrics(context.TODO(), kubeAgentParseMetrics, cs, fns) @@ -613,40 +594,25 @@ func getMockInformers(clusterVersion float64, stopCh chan struct{}) (map[string] nodes.Add(&v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "n1", Annotations: annotation}}) persistentVolumes.Add(&v1.PersistentVolume{ObjectMeta: metav1.ObjectMeta{Name: "pv1", Annotations: annotation}}) persistentVolumeClaims.Add(&v1.PersistentVolumeClaim{ObjectMeta: metav1.ObjectMeta{Name: "pvc1", Annotations: annotation}}) - replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs1", Annotations: annotation}, - Status: v1apps.ReplicaSetStatus{Replicas: int32(1)}}) - // should not be exported as replicaset is empty - replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs2", Annotations: annotation}}) + replicaSets.Add(&v1apps.ReplicaSet{ObjectMeta: metav1.ObjectMeta{Name: "rs1", Annotations: annotation}}) daemonSets.Add(&v1apps.DaemonSet{ObjectMeta: metav1.ObjectMeta{Name: "ds1", Annotations: annotation}}) jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job1", Annotations: annotation}}) - oneDayAgo := metav1.NewTime(time.Now().Add(-24 * time.Hour)) - // should not be exported as job was completed some time ago - jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job2", Annotations: annotation}, - Status: v1batch.JobStatus{CompletionTime: &oneDayAgo}}) - // should not be exported as job was completed some time ago - jobs.Add(&v1batch.Job{ObjectMeta: metav1.ObjectMeta{Name: "job3", Annotations: annotation}, - Status: v1batch.JobStatus{ - Failed: int32(1), - Conditions: []v1batch.JobCondition{{Type: v1batch.JobFailed, LastTransitionTime: oneDayAgo}}, - }}) if clusterVersion > 1.20 { cronJobs.Add(&v1batch.CronJob{ObjectMeta: metav1.ObjectMeta{Name: "cj1", Annotations: annotation}}) } - // adds 3 pods, two of which completed long ago and will not be added to export sample + // pods is unique as we use this pod file for parseMetrics testing + // for parseMetricData testing, add a cldy metrics-agent pod to the mock informers podData, err := os.ReadFile("../testdata/pods.jsonl") if err != nil { return nil, err } - dec := json.NewDecoder(bytes.NewReader(podData)) - for dec.More() { - var pod v1.Pod - if err := dec.Decode(&pod); err != nil { - return nil, err - } - pods.Add(&pod) + var myPod *v1.Pod + err = json.Unmarshal(podData, &myPod) + if err != nil { + return nil, err } - + pods.Add(myPod) // namespace also used in testing namespaceData, err := os.ReadFile("../testdata/namespaces.jsonl") if err != nil { diff --git a/retrieval/k8s/k8s_stats.go b/retrieval/k8s/k8s_stats.go index 1e02e1a3..21ef53f5 100644 --- a/retrieval/k8s/k8s_stats.go +++ b/retrieval/k8s/k8s_stats.go @@ -96,9 +96,7 @@ func writeK8sResourceFile(workDir *os.File, resourceName string, datawriter := bufio.NewWriter(file) for _, k8Resource := range resourceList { - if shouldSkipResource(k8Resource) { - continue - } + if parseMetricData { k8Resource = sanitizeData(k8Resource) } @@ -126,41 +124,6 @@ func writeK8sResourceFile(workDir *os.File, resourceName string, return err } -//nolint:gocyclo -func shouldSkipResource(k8Resource interface{}) bool { - // safe buffer to allow for longer lived resources to be ingested correctly - previousHour := time.Now().UTC().Add(-1 * time.Hour) - switch resource := k8Resource.(type) { - case *v1batch.Job: - if resource.Status.CompletionTime != nil && - previousHour.After(resource.Status.CompletionTime.Time) { - return true - } - if resource.Status.Failed > 0 { - for _, condition := range resource.Status.Conditions { - if condition.Type == v1batch.JobFailed { - if previousHour.After(condition.LastTransitionTime.Time) { - return true - } - } - } - } - case *corev1.Pod: - if resource.Status.Phase == corev1.PodSucceeded || resource.Status.Phase == corev1.PodFailed { - canSkip := true - for _, v := range resource.Status.ContainerStatuses { - if v.State.Terminated != nil && v.State.Terminated.FinishedAt.After(previousHour) { - canSkip = false - } - } - return canSkip - } - case *v1apps.ReplicaSet: - return resource.Status.Replicas == 0 && previousHour.After(resource.CreationTimestamp.Time) - } - return false -} - // nolint: gocyclo func sanitizeData(to interface{}) interface{} { switch to.(type) { diff --git a/testdata/pods.jsonl b/testdata/pods.jsonl index d7f8d9b0..569ce016 100644 --- a/testdata/pods.jsonl +++ b/testdata/pods.jsonl @@ -1,3 +1 @@ {"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn2","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} -{"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn3","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Succeeded","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} -{"metadata":{"name":"cloudability-metrics-agent-6f978f966-64pn4","generateName":"cloudability-metrics-agent-6f978f966-","namespace":"cloudability","uid":"63edfc10-8ca7-462b-bbb7-1ba9c6929da2","resourceVersion":"6494382","creationTimestamp":"2022-08-04T19:01:15Z","labels":{"app":"cloudability-metrics-agent","pod-template-hash":"6f978f966"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"cloudability-metrics-agent-6f978f966","uid":"161e5990-fa30-4b8c-93c2-5efb8ab8a062","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:01:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"161e5990-fa30-4b8c-93c2-5efb8ab8a062\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"cloudability-metrics-agent\"}":{".":{},"f:args":{},"f:env":{".":{},"k:{\"name\":\"CLOUDABILITY_API_KEY\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_CLUSTER_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CLOUDABILITY_POLL_INTERVAL\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:livenessProbe":{".":{},"f:exec":{".":{},"f:command":{}},"f:failureThreshold":{},"f:initialDelaySeconds":{},"f:periodSeconds":{},"f:successThreshold":{},"f:timeoutSeconds":{}},"f:name":{},"f:resources":{".":{},"f:limits":{".":{},"f:cpu":{},"f:memory":{}},"f:requests":{".":{},"f:cpu":{},"f:memory":{}}},"f:securityContext":{".":{},"f:allowPrivilegeEscalation":{},"f:capabilities":{".":{},"f:drop":{}},"f:runAsNonRoot":{},"f:runAsUser":{}},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:imagePullSecrets":{".":{},"k:{\"name\":\"cldy-docker-auth\"}":{}},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-08-04T19:02:01Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"172.26.94.113\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]},"spec":{"volumes":[{"name":"kube-api-access-sx2nm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}],"defaultMode":420}}],"containers":[{"name":"cloudability-metrics-agent","image":"AMetricsAgentImage","args":["kubernetes"],"env":[{"name":"CLOUDABILITY_API_KEY","value":"ReallySecretStuff"},{"name":"CLOUDABILITY_CLUSTER_NAME","value":"testCluster"},{"name":"CLOUDABILITY_POLL_INTERVAL","value":"180"}],"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"kube-api-access-sx2nm","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"livenessProbe":{"exec":{"command":["touch","tmp/healthy"]},"initialDelaySeconds":120,"timeoutSeconds":1,"periodSeconds":600,"successThreshold":1,"failureThreshold":3},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","securityContext":{"capabilities":{"drop":["all"]},"runAsUser":10000,"runAsNonRoot":true,"allowPrivilegeEscalation":false}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"cloudability","serviceAccount":"cloudability","nodeName":"ip-172-26-95-214.ec2.internal","securityContext":{},"imagePullSecrets":[{"name":"cldy-docker-auth"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Failed","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"},{"type":"Ready","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"ContainersReady","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:02:01Z"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-08-04T19:01:15Z"}],"hostIP":"172.26.95.214","podIP":"172.26.94.113","podIPs":[{"ip":"172.26.94.113"}],"startTime":"2022-08-04T19:01:15Z","containerStatuses":[{"name":"cloudability-metrics-agent","state":{"running":{"startedAt":"2022-08-04T19:02:00Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"AMetricsagentimage","imageID":"38a6c80a3b283116803cccf0a64894f69d","containerID":"docker://ed1a1750c138ad51cce50f5aba6fef453ae332ec70bc277c716cd3449e5fecac","started":true}],"qosClass":"Burstable"}} From 2ba8f6a892cadb4b6317f136f482132f53e6b67d Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 31 Dec 2024 15:02:30 -0800 Subject: [PATCH 24/28] update version to 2.11.37 --- charts/metrics-agent/Chart.yaml | 4 ++-- version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/metrics-agent/Chart.yaml b/charts/metrics-agent/Chart.yaml index a85cc227..c76816dc 100644 --- a/charts/metrics-agent/Chart.yaml +++ b/charts/metrics-agent/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 2.11.36 +version: 2.11.37 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 2.11.36 +appVersion: 2.11.37 diff --git a/version/version.go b/version/version.go index 0df8b9bb..2fbc28b5 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // VERSION is the current version of the agent -var VERSION = "2.11.36" +var VERSION = "2.11.37" From 704a0dd5f51c6d72dd38ca659c327268a24a782b Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Mon, 6 Jan 2025 16:00:15 -0800 Subject: [PATCH 25/28] client connection test update --- kubernetes/kubernetes.go | 51 ++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/kubernetes/kubernetes.go b/kubernetes/kubernetes.go index ddcd105c..cbf38362 100644 --- a/kubernetes/kubernetes.go +++ b/kubernetes/kubernetes.go @@ -193,6 +193,8 @@ func CollectKubeMetrics(config KubeAgentConfig) { log.Warnf("WARNING: failed to retrieve S3 URL in connectivity test, agent will fail to "+ "upload metrics to Cloudability with error: %v", err) } + } else { + performCustomUploadTestConnection(&kubeAgent, agentProvider) } log.Info("Cloudability Metrics Agent successfully started.") @@ -282,7 +284,6 @@ func isCustomAzureUploadEnvsSet(ka *KubeAgentConfig) bool { } func performConnectionChecks(ka *KubeAgentConfig) error { - log.Info("Performing connectivity checks. Checking that the agent can retrieve S3 URL") cldyMetricClient, err := client.NewHTTPMetricClient(client.Configuration{ @@ -319,6 +320,27 @@ func performConnectionChecks(ka *KubeAgentConfig) error { return nil } +func performCustomUploadTestConnection(ka *KubeAgentConfig, provider string) { + log.Info("Performing Performing connectivity checks for custom upload.") + if provider == azureProvider { + azureTestConnection(ka) + } else { + log.Info("Checking that the agent can start aws client using custom s3" + + " configuration.") + ka.customS3AWSClient() + } +} + +func azureTestConnection(ka *KubeAgentConfig) { + if ka.CustomAzureTenantID == "" && ka.CustomAzureClientID == "" { + log.Info("Checking that the agent can start azure client using managed identity.") + ka.customBlobManagedIdentityClient() + } else { + log.Info("Checking that the agent can start azure client using service principal.") + ka.customBlobServicePrincipalClient() + } +} + func newKubeAgent(ctx context.Context, config KubeAgentConfig) KubeAgentConfig { config, err := createClusterConfig(config) if err != nil { @@ -499,7 +521,7 @@ func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(ctx context.Context, agen if ka.CustomAzureTenantID == "" && ka.CustomAzureClientID == "" { log.Infof("Uploading Metrics to Custom Azure Blob %s with managed identity", ka.CustomAzureUploadBlobContainerName) - ka.sendMetricsToCustomBlobManagedIdentity(ctx, metricSample) + go ka.sendMetricsToCustomBlobManagedIdentity(ctx, metricSample) } else { log.Infof("Uploading Metrics to Custom Azure Blob %s", ka.CustomAzureUploadBlobContainerName) go ka.sendMetricsToCustomBlob(ctx, metricSample) @@ -511,7 +533,7 @@ func (ka KubeAgentConfig) sendMetricsBasedOnUploadMode(ctx context.Context, agen } } -func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { +func (ka KubeAgentConfig) customS3AWSClient() *session.Session { sess, err := session.NewSession(&aws.Config{ Region: aws.String(ka.CustomS3Region), MaxRetries: aws.Int(3)}, @@ -520,6 +542,11 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { log.Fatalf("Could not establish AWS Session, "+ "ensure AWS environment variables are set correctly: %s", err) } + return sess +} + +func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { + sess := ka.customS3AWSClient() svc := s3.New(sess) uploader := s3manager.NewUploaderWithClient(svc) @@ -545,12 +572,12 @@ func (ka KubeAgentConfig) sendMetricsToCustomS3(metricSample *os.File) { util.SafeCloseLogger(fileReader) } -func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { +func (ka KubeAgentConfig) customBlobServicePrincipalClient() *azblob.Client { cred, err := azidentity.NewClientSecretCredential(ka.CustomAzureTenantID, ka.CustomAzureClientID, ka.CustomAzureClientSecret, nil) if err != nil { log.Fatalf("Could not establish Azure credentials, "+ - "ensure Azure environment variables are set correctly: %s", err) + "ensure all Azure environment variables are set correctly: %s", err) } retryConfig := azblob.ClientOptions{ ClientOptions: azcore.ClientOptions{ @@ -562,12 +589,17 @@ func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSam azureClient, err := azblob.NewClient(ka.CustomAzureBlobURL, cred, &retryConfig) if err != nil { log.Fatalf("Could not establish Azure Client, "+ - "ensure Azure environment variables are set correctly: %s", err) + "ensure all Azure environment variables are set correctly: %s", err) } + return azureClient +} + +func (ka KubeAgentConfig) sendMetricsToCustomBlob(ctx context.Context, metricSample *os.File) { + azureClient := ka.customBlobServicePrincipalClient() ka.uploadBlob(ctx, azureClient, metricSample) } -func (ka KubeAgentConfig) sendMetricsToCustomBlobManagedIdentity(ctx context.Context, metricSample *os.File) { +func (ka KubeAgentConfig) customBlobManagedIdentityClient() *azblob.Client { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("Could not establish Azure credentials with managed identity, "+ @@ -578,6 +610,11 @@ func (ka KubeAgentConfig) sendMetricsToCustomBlobManagedIdentity(ctx context.Con log.Fatalf("Could not establish Azure Client with managed identity, "+ "ensure Azure environment variables are set correctly: %s", err) } + return azureClient +} + +func (ka KubeAgentConfig) sendMetricsToCustomBlobManagedIdentity(ctx context.Context, metricSample *os.File) { + azureClient := ka.customBlobManagedIdentityClient() ka.uploadBlob(ctx, azureClient, metricSample) } From 030e045e576e4d4494611af5dd38a949e974df46 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 7 Jan 2025 09:50:53 -0800 Subject: [PATCH 26/28] snyk fix net version --- go.mod | 6 +++--- go.sum | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index ec2db090..11441494 100644 --- a/go.mod +++ b/go.mod @@ -71,8 +71,8 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - golang.org/x/crypto v0.28.0 // indirect - golang.org/x/net v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect @@ -103,7 +103,7 @@ replace ( github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.14 golang.org/x/crypto => golang.org/x/crypto v0.31.0 golang.org/x/image => golang.org/x/image v0.10.0 - golang.org/x/net => golang.org/x/net v0.23.0 + golang.org/x/net => golang.org/x/net v0.33.0 google.golang.org/grpc => google.golang.org/grpc v1.56.3 google.golang.org/protobuf => google.golang.org/protobuf v1.33.0 ) diff --git a/go.sum b/go.sum index 3dfd7c5d..5c321a70 100644 --- a/go.sum +++ b/go.sum @@ -1085,8 +1085,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1213,12 +1213,10 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1237,7 +1235,6 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 8ca145a67e5177b946a194ecf4fb41cbbfa45760 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Tue, 7 Jan 2025 13:53:47 -0800 Subject: [PATCH 27/28] Update values.yaml --- charts/metrics-agent/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/metrics-agent/values.yaml b/charts/metrics-agent/values.yaml index 5d5450f8..708d8d87 100644 --- a/charts/metrics-agent/values.yaml +++ b/charts/metrics-agent/values.yaml @@ -24,7 +24,7 @@ pollInterval: 180 image: name: cloudability/metrics-agent - tag: 2.11.36 + tag: 2.11.37 pullPolicy: Always imagePullSecrets: [] From a8dbc469067ec4870d184a5f9f7ea60e0b5cd5c2 Mon Sep 17 00:00:00 2001 From: Anthony Beaver Date: Thu, 16 Jan 2025 13:22:49 -0800 Subject: [PATCH 28/28] Update .snyk --- .snyk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.snyk b/.snyk index af3fc71c..7e121b51 100644 --- a/.snyk +++ b/.snyk @@ -33,7 +33,7 @@ ignore: SNYK-GOLANG-GOLANGORGXIMAGETIFF-7268348: - '*': reason: No fix available yet - expires: 2025-01-11T00:00:00.000Z + expires: 2025-03-01T00:00:00.000Z created: 2024-07-11T23:07:11.176Z SNYK-GOLANG-K8SIOCLIENTGOTRANSPORT-7538822: - '*': @@ -78,4 +78,9 @@ ignore: temporarily until patch version is ready expires: 2024-11-30T00:00:00.000Z created: 2024-10-30T18:01:47.217Z + SNYK-GOLANG-GITHUBCOMGOLANGJWTJWT-8341243: + - '*': + reason: No fix available + expires: 2025-03-01T00:00:00.000Z + created: 2025-01-16T21:14:33.951Z patch: {}