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

Selector not available in the GenericSyncer's Import #1896

Open
ajithcnambiar opened this issue Jun 30, 2024 · 0 comments
Open

Selector not available in the GenericSyncer's Import #1896

ajithcnambiar opened this issue Jun 30, 2024 · 0 comments
Labels

Comments

@ajithcnambiar
Copy link

What happened?

The selector won't work for the generic synced's import.

What did you expect to happen?

As per the docs, the selector is supposed to be accepted.
https://www.vcluster.com/docs/vcluster/configure/vcluster-yaml/experimental/generic-sync#:~:text=limit%20which%20resources%20to%20sync%20from%20the%20host%20cluster

How can we reproduce it (as minimally and precisely as possible)?

try vcluster create command with the below config:

experimental:
  multiNamespaceMode:
    enabled: true

  genericSync:
    import:
      - kind: ServiceAccount
        apiVersion: v1
        selector:
          labelSelector:
            app: "curler"
vcluster create my-vcluster --values vcluster-config/vvv.yaml  --chart-version 0.20.0-beta.9
23:36:16 info Creating namespace vcluster-my-vcluster
23:36:17 fatal invalid config: error unmarshaling JSON: while decoding JSON: json: unknown field "selector"

Anything else we need to know?

As compared to exporter's selector implementation, importer misses these:

1/ selector field doesn't exist in importer
https://github.com/loft-sh/vcluster/blob/main/config/config.go#L1803

2/ exclude based on the selector
exporter checks selector https://github.com/loft-sh/vcluster/blob/main/pkg/controllers/generic/export_syncer.go#L136-L140
where importer doesn't https://github.com/loft-sh/vcluster/blob/main/pkg/controllers/generic/import_syncer.go#L182

If this is a miss, happy to contribute, if you prefer :)

Host cluster Kubernetes version

$ kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.0

vcluster version

$ vcluster --version
vcluster version 0.20.0-beta.9

VCluster Config

experimental:
  multiNamespaceMode:
    enabled: true

  genericSync:
    import:
      - kind: ServiceAccount
        apiVersion: v1
        selector:
          labelSelector:
            app: "curler"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant