Draft
Conversation
61d8fbb to
8e22a6d
Compare
Replace direct CredHelperImpl and DefaultCustomMetricsCredentialType assignments with the new CustomMetricsAuthConfig struct in test setup code, analogous to the change in broker_suite_test.go.
Replace the string-based credential helper dispatch with a type-switch on config.BasicAuthHandlingImplConfig. This removes the need for separate credHelperImpl string and StoredProcedureConfig pointer parameters. The API server now only creates a credential provider when CustomMetricsAuthConfig is present (non-nil).
…ig parser Move the sealed interface BasicAuthHandlingImplConfig and its implementations (BasicAuthHandlingNative, BasicAuthHandlingStoredProc) from api/config to the models package so both api/config and metricsforwarder/config can use them without circular imports. Introduce metricsforwarder/config/parser.go with rawConfig/toConfig pattern (analog to api/config/parser.go). The metricsforwarder Config uses its own CredentialHelperConfig field (models.BasicAuthHandlingImplConfig) instead of reusing the apiserver CustomMetricsAuthConfig.
Replace the string+pointer parameters (credHelperImpl, StoredProcedureConfig) with a single *models.BasicAuthHandlingImplConfig parameter. Update all callers in api/config, metricsforwarder/config, operator/config, and the shared test helper ExpectConfigureDatabasesCalledOnce. Regenerated fakes.
Replace conf.CredHelperImpl assignments and assertions with the new typed CredentialHelperConfig field (models.BasicAuthHandlingNative) in metricsforwarder test setup and config validation tests.
Update ConfigureDatabases test calls to use the new *models.BasicAuthHandlingImplConfig parameter instead of the old (storedProcedureConfig, credHelperImpl) pair.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR allows operators of app-autoscaler to control how "Basic Authentication" for sending custom metrics to the
metricsforwarderis handled.