krateoplatformops / azuredevops-provider-chart

0 stars 1 forks source link

CRDs using projectRef expect a namespace for the TeamProject resource, while the project is cluster-scoped #36

Open banh-gao opened 3 months ago

banh-gao commented 3 months ago

Describe the bug Resources such as Endpoints or GitRepositories that use a projectRef to reference a TeamProject resource expect a mandatory namespace parameter. However, the TeamProject CRD are cluster scoped.

To Reproduce Steps to reproduce the behavior:

  1. Create a TeamProject resource
  2. Create an Endpoint resource with projectRef containing the name of the TeamProject resource, but omitting the namespace attribute
  3. Check events for the composition. The composition fails with an error such as

    Endpoint.azuredevops.krateo.io "xyz" is invalid: spec.projectRef.namespace: Required value

Expected behavior ProjectRef blocks for CRDs must only accept the TeamProject resource name and not even allow a namespace attribute.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

banh-gao commented 3 months ago

Just discovered the same issue applies to pipelines and repositories references using the pipelineRef, resourceRef and repositoryRef blocks. All allow and require a namespace attribute.