Skip to content

Conversation

@syedazeez337
Copy link

Add nested APIKeyConfig structure for ModelConfig CRD to provide consistent pattern with TLS configuration. This deprecates the flat apiKeySecret/apiKeySecretKey fields in favor of apiKey.secretRef and apiKey.secretKey.

Changes:

  • Add APIKeyConfig struct with SecretRef and SecretKey fields
  • Add APIKey field to ModelConfigSpec
  • Mark apiKeySecret and apiKeySecretKey as deprecated
  • Add validation rules to prevent mixed usage
  • Add helper methods GetAPIKeySecretRef() and IsUsingDeprecatedAPIKeyFields()
  • Update reconciler to log deprecation warning
  • Update translator and controller to use helper method
  • Update HTTP handlers for backwards compatibility
  • Add unit and golden tests for nested API key support

Closes #1130

Add nested APIKeyConfig structure for ModelConfig CRD to provide
consistent pattern with TLS configuration. This deprecates the flat
apiKeySecret/apiKeySecretKey fields in favor of apiKey.secretRef
and apiKey.secretKey.

Changes:
- Add APIKeyConfig struct with SecretRef and SecretKey fields
- Add APIKey field to ModelConfigSpec
- Mark apiKeySecret and apiKeySecretKey as deprecated
- Add validation rules to prevent mixed usage
- Add helper methods GetAPIKeySecretRef() and IsUsingDeprecatedAPIKeyFields()
- Update reconciler to log deprecation warning
- Update translator and controller to use helper method
- Update HTTP handlers for backwards compatibility
- Add unit and golden tests for nested API key support

Closes kagent-dev#1130

Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
Copy link
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there, thanks for the PR. I think this change makes sense, but I'm a little worried that the marginal benefit of the nesting isn't necessarily worth supporting 2 APIs for the near-term. What's the motivation for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE | API DESIGN] Use nested structure for ModelConfig ApiKey CRD

2 participants