You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ Update CSR interfaces to support enhanced context and error handling (#333)
* Update CSRSign interface to support cluster and addon context
Changes CSRSignerFunc signature to include ManagedCluster and ManagedClusterAddOn parameters and return error, enabling CSR signers to make context-aware decisions based on cluster and addon information.
Migration guide:
- Old: CSRSign: func(csr *certificatesv1.CertificateSigningRequest) []byte
- New: CSRSign: func(cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn, csr *certificatesv1.CertificateSigningRequest) ([]byte, error)
Update your CSRSign implementations to:
1. Add cluster and addon parameters (can be ignored if not needed)
2. Return ([]byte, error) instead of just []byte
3. Handle errors properly in your signing logic
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: zhujian <[email protected]>
* Update CSRConfigurations interface to return error
Changes CSRConfigurationsFunc signature to return ([]RegistrationConfig, error) instead of just []RegistrationConfig, enabling better error handling in CSR configuration generation.
Migration guide:
- Old: CSRConfigurations: func(cluster *clusterv1.ManagedCluster) []addonapiv1alpha1.RegistrationConfig
- New: CSRConfigurations: func(cluster *clusterv1.ManagedCluster) ([]addonapiv1alpha1.RegistrationConfig, error)
Update your CSRConfigurations implementations to:
1. Return ([]RegistrationConfig, error) instead of just []RegistrationConfig
2. Return nil error for successful cases
3. Return appropriate errors when configuration generation fails
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: zhujian <[email protected]>
* Update CSRConfigurations to include addon parameter and improve error handling
Enhances CSRConfigurationsFunc to accept ManagedClusterAddOn parameter alongside ManagedCluster, enabling addon-specific CSR configuration decisions. Also improves error message formatting in CSR signing.
Migration guide:
- Old: CSRConfigurations: func(cluster *clusterv1.ManagedCluster) ([]RegistrationConfig, error)
- New: CSRConfigurations: func(cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) ([]RegistrationConfig, error)
Update your CSRConfigurations implementations to:
1. Accept both cluster and addon parameters
2. Use addon parameter for addon-specific configuration logic when needed
3. Ignore addon parameter if not needed for your use case
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: zhujian <[email protected]>
---------
Signed-off-by: zhujian <[email protected]>
Co-authored-by: Claude <[email protected]>
0 commit comments