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

bug: Syncer namespace with label value exceeding 63 characters #1843

Closed
MatousJobanek opened this issue Aug 26, 2022 · 8 comments · Fixed by #2130
Closed

bug: Syncer namespace with label value exceeding 63 characters #1843

MatousJobanek opened this issue Aug 26, 2022 · 8 comments · Fixed by #2130
Assignees
Labels
area/transparent-multi-cluster Related to scheduling of workloads into pclusters. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@MatousJobanek
Copy link

Describe the bug

When generating the syncer namespace manifests, the kubectl kcp workload sync uses the current workspace path and the workspace name for workload.kcp.io/logical-cluster label. However, this can easily exceed 63 characters (mainly in home workspaces) which is the limit for label values.
Creating such a namespace fails with:

Error from server (Invalid): error when creating "/tmp/appstudio-controllers-compute-syncer.yaml": Namespace "kcp-syncer-appstudio-controllers-compute-29kuqsah" is invalid: metadata.labels: Invalid value: "root_users_qj_jc_rh-sso-mjobanek-kcp_redhat-appstudio-internal-compute": must be no more than 63 characters

This makes any testing in some home workspace almost impossible

Steps To Reproduce

  1. go to your home workspace
  2. if the path is not long enough, then create a sub-workspace with some longer name
  3. go to the sub-workspace
  4. run kubectl kcp workload sync
  5. try to apply the generated manifests to your cluster

Expected Behaviour

the sync command should not create a label with such a long value

Additional Context

No response

@MatousJobanek MatousJobanek added the kind/bug Categorizes issue or PR as related to a bug. label Aug 26, 2022
@csams csams added this to kcp Aug 26, 2022
@csams csams moved this to New in kcp Aug 26, 2022
@stevekuznetsov stevekuznetsov added the area/transparent-multi-cluster Related to scheduling of workloads into pclusters. label Aug 26, 2022
@stevekuznetsov
Copy link
Contributor

cc @davidfestal @jmprusi

@ncdc
Copy link
Member

ncdc commented Aug 30, 2022

/help
/good-first-issue

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2022

@ncdc:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/help
/good-first-issue

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/test-infra repository.

@openshift-ci openshift-ci bot added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Aug 30, 2022
@ncdc ncdc added this to the TBD milestone Aug 30, 2022
@openshift-ci openshift-ci bot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Aug 30, 2022
@apoorvajagtap
Copy link
Contributor

Hi @ncdc if no one has started with this one yet, can I work on this?

@ncdc
Copy link
Member

ncdc commented Sep 6, 2022

@apoorvajagtap sure thing, thanks!

/assign @apoorvajagtap

@apoorvajagtap
Copy link
Contributor

Hello @ncdc @MatousJobanek I was able to reproduce the issue. In order to proceed, I would like to have your inputs on a preferred value for workload.kcp.io/logical-cluster. As per the current design, it basically concatenates the name of parent workspaces with the current one, and assigns the same string as value:

$ bin/kubectl-kcp workspace current                                                                 
Current workspace is "root:telcops:kcp-syncer-appstudio-controllers-compute-trial1-trial2-trial2".
---
apiVersion: v1
kind: Namespace
metadata:
  name: kcpsyncbd40dcd9607bfa1554233fb41af30c96314b56c285044d0616ae8637
  labels:
    workload.kcp.io/logical-cluster: root_telcops_kcp-syncer-appstudio-controllers-compute-trial1-trial2-trial2
    workload.kcp.io/workload-cluster: mycluster2

So, what should be the preferred pattern to opt for a unique value?

  1. Should we truncate/remove the parent workspace names? (If we follow this, then the value might not be unique for the workspaces that belong to separate parent workspaces but has the same name)
  2. Should we limit the number of characters for a workspace itself (a value that is less than 63)?
  3. Or, can we use a combination of parent workspaces & name of workload_cluster, instead of just the workspaces? (for e.g., in the current scenario, assigning the value as "root_telcops_mycluster2")

@ncdc
Copy link
Member

ncdc commented Sep 12, 2022

Neither workload.kcp.io/logical-cluster nor workload.kcp.io/sync-target is currently used by our code for anything. Maybe we should make these annotations instead?

@ncdc
Copy link
Member

ncdc commented Oct 4, 2022

Discussed in community call today. Let's remove these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transparent-multi-cluster Related to scheduling of workloads into pclusters. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants