feat: support virtual workspace URL path in --config-workspace#19
feat: support virtual workspace URL path in --config-workspace#19ifdotpy wants to merge 1 commit intokcp-dev:mainfrom
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ifdotpy. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
b004ff4 to
351ab5a
Compare
cd8efc5 to
c69aa64
Compare
Allow --config-workspace to accept a direct URL path (starting with /) in addition to logical cluster paths. This enables init-agent to watch InitTarget/InitTemplate resources via an APIExport virtual workspace, which aggregates resources from multiple provider workspaces. When the value starts with /, it is used as a direct URL path appended to the base KCP host. Otherwise, existing behavior is preserved (appending /clusters/<path>). Ref: kcp-dev#18 Signed-off-by: Igor Fominykh <ifdotpy@gmail.com>
c69aa64 to
951b765
Compare
Summary
Allow
--config-workspaceto accept a direct URL path (starting with/) in addition to logical cluster paths. This enables init-agent to watch InitTarget/InitTemplate resources via an APIExport virtual workspace.Changes
internal/kcp/rest.go: AddRetargetRestConfigToPathhelper for direct URL path retargeting. FixStripClusterto handle trailing slashes before regex match.cmd/init-agent/main.go: UseRetargetRestConfigToPathwhen config workspace starts with/. Preserve base config for leader election to avoid sending lease requests to virtual workspace URLs.cmd/init-agent/options.go: Update flag description and comment.internal/kcp/rest_test.go: Table-driven tests forRetargetRestConfig,RetargetRestConfigToPath, andStripCluster.How it works
When the value starts with
/, it is appended directly to the base KCP host URL. Otherwise, existing behavior is preserved (/clusters/<path>).The ClusterClient (used for fetching WorkspaceTypes and InitTemplates) is initialized separately from the manager config, so it continues to use the base KCP URL regardless of the config workspace format.
Leader election uses a copy of the pre-retarget config, so lease operations always target the original KCP workspace.
Backward compatibility
Fully backward compatible. Existing
--config-workspace=root:init-agentcontinues to work unchanged.Fixes #18
```release-note
Support virtual workspace URL path in --config-workspace flag for self-service provider initialization.
```