Skip to content

Commit ddfd855

Browse files
Merge pull request #2702 from kasturinarra/fix_resource_sync
📖 Add example on how resource name should be provided for syncing
2 parents e7bc282 + 9b885e3 commit ddfd855

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/content/en/main/concepts/syncer.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ To sync resources that the KCP server does not have an APIExport to support yet,
8989
kubectl kcp workload sync <mycluster> --syncer-image <image name> --resources foo.bar -o syncer.yaml
9090
```
9191

92+
Make sure to have the resource name in the form of `resourcename.<gvr_of_the_resource>` to be able to
93+
sync succesfully to the physical cluster.
94+
95+
For example to sync resource `routes` to physical cluster run the command below
96+
97+
```sh
98+
kubectl kcp workload sync <mycluster> --syncer-image <image name> --resources routes.route.openshift.io -o syncer.yaml
99+
```
100+
92101
And apply the generated manifests to the physical cluster. The syncer will then import the API schema of foo.bar
93102
to the workspace of the synctarget, following up with an auto generated kubernetes APIExport/APIBinding in the same workspace.
94103
You can then create foo.bar in this workspace, or create an APIBinding in another workspace to bind this APIExport.

pkg/cliplugins/workload/plugin/sync.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ func NewSyncOptions(streams genericclioptions.IOStreams) *SyncOptions {
123123
func (o *SyncOptions) BindFlags(cmd *cobra.Command) {
124124
o.Options.BindFlags(cmd)
125125

126-
cmd.Flags().StringSliceVar(&o.ResourcesToSync, "resources", o.ResourcesToSync, "Resources to synchronize with kcp.")
126+
cmd.Flags().StringSliceVar(&o.ResourcesToSync, "resources", o.ResourcesToSync, "Resources to synchronize with kcp, each resource should be in the format of resourcename.<gvr_of_the_resource>,"+
127+
"e.g. to sync routes to physical cluster the resource name should be given as --resource routes.route.openshift.io")
127128
cmd.Flags().StringSliceVar(&o.APIExports, "apiexports", o.APIExports,
128129
"APIExport to be supported by the syncer, each APIExport should be in the format of <absolute_ref_to_workspace>:<apiexport>, "+
129130
"e.g. root:compute:kubernetes is the kubernetes APIExport in root:compute workspace")

0 commit comments

Comments
 (0)