Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Update kcp sync command to support global kubernetes APIExport #2164

Merged
merged 2 commits into from
Oct 17, 2022

Conversation

qiujian16
Copy link
Contributor

@qiujian16 qiujian16 commented Oct 11, 2022

  • do not add apiresourceschmea in synctarget's local APIExport
  • add exports flag in sync command
  • setup syncer's rbac on physical cluster based on synctarget status.

Signed-off-by: Jian Qiu jqiu@redhat.com

Summary

This is to introduce the export flag in sync command. After this fix, the fix includes

  • do not add apiresourceschmea in synctarget's local APIExport
  • add exports flag in sync command
  • setup syncer's rbac on physical cluster based on synctarget status.

After this change, the sync command will be changed:

  1. run kubectl kcp sync without resource flag will sync resources in kubernetes APIExport in root:compute workspace
  2. run kubectl kcp sync --resources xxx will sync both resources specified in the flag and kubernetes APIExport in root:compute workspace
  3. run kubectl kcp sync --apiexports workspace1|export1 will sync resources in specified export.
  4. run kubectl kcp sync --resources xxx --apiexports will sync resource xxx but not those in kubernetes APIExport in root:compute workspace.

Related issue(s)

Fixes #1960

@qiujian16 qiujian16 force-pushed the global-export branch 5 times, most recently from 2a0978e to af83817 Compare October 13, 2022 03:29
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2022
@qiujian16 qiujian16 changed the title ✨ [WIP] Update kcp sync command to support global kubernetes APIExport ✨ Update kcp sync command to support global kubernetes APIExport Oct 13, 2022
pkg/cliplugins/workload/plugin/sync.go Show resolved Hide resolved
pkg/cliplugins/workload/plugin/sync.go Outdated Show resolved Hide resolved
pkg/cliplugins/workload/plugin/sync.go Outdated Show resolved Hide resolved
pkg/cliplugins/workload/plugin/sync.go Outdated Show resolved Hide resolved
pkg/cliplugins/workload/plugin/sync.go Show resolved Hide resolved
test/e2e/virtual/syncer/virtualworkspace_test.go Outdated Show resolved Hide resolved
@qiujian16 qiujian16 force-pushed the global-export branch 2 times, most recently from 2b0501c to 1aa9bf2 Compare October 13, 2022 15:08
1. use global kubernetes APIExport to sync by default
2. user can add additional export or resource using --apiexport
and --resources flag
3. use "--resources deployment.apps --apiexport" keep the previous
behavior
1. create only when at least on synctarget support it
2. skip adding certain APIResourceSchema to local kubernetes APIExport
when at leat one synctarget supports global kubernetes APIExport
@qiujian16
Copy link
Contributor Author

@davidfestal I reorganize the commit, PTAL again. Thanks

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2022
@davidfestal
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidfestal

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

The pull request process is described here

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidfestal

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

The pull request process is described here

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-merge-robot openshift-merge-robot merged commit 8bc75b2 into kcp-dev:main Oct 17, 2022
@qiujian16 qiujian16 deleted the global-export branch October 17, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the global kubernetes APIExport by default in the SyncTarget supportedAPIExports
4 participants