Skip to content

Remove deprecated KubeAPIServer config fields#542

Closed
xuezhaojun wants to merge 2 commits intostolostron:mainfrom
xuezhaojun:cleanup/remove-deprecated-kubeapiserver-config
Closed

Remove deprecated KubeAPIServer config fields#542
xuezhaojun wants to merge 2 commits intostolostron:mainfrom
xuezhaojun:cleanup/remove-deprecated-kubeapiserver-config

Conversation

@xuezhaojun
Copy link
Copy Markdown

What this PR does

This PR removes deprecated code paths in the bootstrap package that were using the old HubKubeAPIServerURL and HubKubeAPIServerCABundle fields. These fields have been superseded by the HubKubeAPIServerConfig structure.

Changes

  • Remove deprecated code paths using HubKubeAPIServerURL and HubKubeAPIServerCABundle
  • Update error messages to be more specific about the required configuration using HubKubeAPIServerConfig

Why this PR is needed

This change improves code maintainability by removing deprecated code paths and making error messages more helpful for users configuring the hub KubeAPIServer.

The use of context.TODO() is generally discouraged in production code as it should only be used when it's unclear which context to use. In this case, we have a proper context available from the StartReconcileFlightCtlResources function parameter.

This change improves code quality by: 1. Using the proper context that can be cancelled when the manager stops 2. Following Go best practices for context propagation 3. Making the code more maintainable by removing temporary solutions

Signed-off-by: xuezhaojun <zxue@redhat.com>
Remove deprecated HubKubeAPIServerURL and HubKubeAPIServerCABundle fields in favor of using HubKubeAPIServerConfig. Update error messages to be more specific about the required configuration.

Signed-off-by: xuezhaojun <zxue@redhat.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xuezhaojun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 18, 2025

@xuezhaojun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/unit 89657de link true /test unit

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sonarqubecloud
Copy link
Copy Markdown

@xuezhaojun xuezhaojun closed this Mar 18, 2025
@xuezhaojun xuezhaojun deleted the cleanup/remove-deprecated-kubeapiserver-config branch March 28, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant