Skip to content

Commit

Permalink
azure.msi-resource is now deprecated
Browse files Browse the repository at this point in the history
Removed in upstream Azure library and marked as deprecated in
thanos-io/objstore, so lint fails if we use it.
  • Loading branch information
bboreham committed Aug 30, 2022
1 parent e92a469 commit 2125765
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [CHANGE] Ingester: removed deprecated `-blocks-storage.tsdb.isolation-enabled` option. TSDB-level isolation is now always disabled in Mimir. #2782
* [CHANGE] Compactor: `-compactor.partial-block-deletion-delay` must either be set to 0 (to disable partial blocks deletion) or a value higher than `4h`. #2787
* [CHANGE] Query-frontend: CLI flag `-query-frontend.align-querier-with-step` has been deprecated. Please use `-query-frontend.align-queries-with-step` instead. #2840
* [CHANGE] Flag `-azure.msi-resource` no longer works. This setting is now made automatically by Azure. #???
* [FEATURE] Introduced an experimental anonymous usage statistics tracking (disabled by default), to help Mimir maintainers make better decisions to support the open source community. The tracking system anonymously collects non-sensitive, non-personally identifiable information about the running Mimir cluster, and is disabled by default. #2643 #2662 #2685 #2732 #2733 #2735
* [FEATURE] Introduced an experimental deployment mode called read-write and running a fully featured Mimir cluster with three components: write, read and backend. The read-write deployment mode is a trade-off between the monolithic mode (only one component, no isolation) and the microservices mode (many components, high isolation). #2754 #2838
* [ENHANCEMENT] Distributor: Add `cortex_distributor_query_ingester_chunks_deduped_total` and `cortex_distributor_query_ingester_chunks_total` metrics for determining how effective ingester chunk deduplication at query time is. #2713
Expand Down
1 change: 0 additions & 1 deletion pkg/storage/bucket/azure/bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func NewBucketClient(cfg Config, name string, logger log.Logger) (objstore.Bucke
bucketConfig.ContainerName = cfg.ContainerName
bucketConfig.Endpoint = cfg.Endpoint
bucketConfig.MaxRetries = cfg.MaxRetries
bucketConfig.MSIResource = cfg.MSIResource
bucketConfig.UserAssignedID = cfg.UserAssignedID

// Thanos currently doesn't support passing the config as is, but expects a YAML,
Expand Down
11 changes: 6 additions & 5 deletions pkg/storage/bucket/azure/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package azure
import (
"flag"

"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
)

Expand All @@ -18,22 +19,22 @@ type Config struct {
ContainerName string `yaml:"container_name"`
Endpoint string `yaml:"endpoint_suffix"`
MaxRetries int `yaml:"max_retries" category:"advanced"`
MSIResource string `yaml:"msi_resource" category:"advanced"`
MSIResource string `yaml:"msi_resource" category:"advanced"` // deprecated
UserAssignedID string `yaml:"user_assigned_id" category:"advanced"`
}

// RegisterFlags registers the flags for Azure storage
func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
cfg.RegisterFlagsWithPrefix("", f)
func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
cfg.RegisterFlagsWithPrefix("", f, logger)
}

// RegisterFlagsWithPrefix registers the flags for Azure storage
func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet, logger log.Logger) {
f.StringVar(&cfg.StorageAccountName, prefix+"azure.account-name", "", "Azure storage account name")
f.Var(&cfg.StorageAccountKey, prefix+"azure.account-key", "Azure storage account key")
f.StringVar(&cfg.ContainerName, prefix+"azure.container-name", "", "Azure storage container name")
f.StringVar(&cfg.Endpoint, prefix+"azure.endpoint-suffix", "", "Azure storage endpoint suffix without schema. The account name will be prefixed to this value to create the FQDN. If set to empty string, default endpoint suffix is used.")
f.IntVar(&cfg.MaxRetries, prefix+"azure.max-retries", 20, "Number of retries for recoverable errors")
f.StringVar(&cfg.MSIResource, prefix+"azure.msi-resource", "", "If set, this URL is used instead of https://<storage-account-name>.<endpoint-suffix> for obtaining ServicePrincipalToken from MSI.")
flagext.DeprecatedFlag(f, prefix+"azure.msi-resource", "Deprecated: this setting was used for obtaining ServicePrincipalToken from MSI. The Azure SDK now chooses the address.", logger)
f.StringVar(&cfg.UserAssignedID, prefix+"azure.user-assigned-id", "", "User assigned identity. If empty, then System assigned identity is used.")
}

0 comments on commit 2125765

Please sign in to comment.