Skip to content

feat: Add custom project name option - #334

Closed
yamaceay wants to merge 1 commit into
crossplane-contrib:mainfrom
yamaceay:custom-proj-name
Closed

feat: Add custom project name option#334
yamaceay wants to merge 1 commit into
crossplane-contrib:mainfrom
yamaceay:custom-proj-name

Conversation

@yamaceay

@yamaceay yamaceay commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Description of your changes

Fixes #325 by introducing a new project name field in project API, which is set optional and modifies the naming logic so that the metadata name is used as a fallback if project name not set.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

After running the provider successfully, we can run in another terminal kubectl apply -f examples/projects/project.yaml to create a new project. The reconciliation of project works as before, successfully updating and deleting. To see the results, we can authenticate as described in hack/local-argocd-setup.sh. The following command lists the projects successfully:

> argocd proj list

NAME                  DESCRIPTION                          DESTINATIONS  SOURCES  CLUSTER-RESOURCE-WHITELIST  NAMESPACE-RESOURCE-BLACKLIST  SIGNATURE-KEYS  ORPHANED-RESOURCES  DESTINATION-SERVICE-ACCOUNTS
default                                                    *,*           *        */*                         <none>                        <none>          disabled            <none>
example-project-name  Example Project with specified name  <none>        <none>   <none>                      <none>                        <none>          disabled            <none>

@yamaceay yamaceay changed the title feat: add custom name option feat: Add custom project name option Sep 12, 2025
@yamaceay
yamaceay marked this pull request as draft September 12, 2025 14:45

@maximilianbraun maximilianbraun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@maximilianbraun

Copy link
Copy Markdown
Contributor

@MisterMX Wdyt?

@MisterMX

Copy link
Copy Markdown
Collaborator

Usually in Crossplane external name annotation is used to store IDs / names of external resources. I'm wondering why are we using metadata.name here and not the annotation? I would rather use the annotation than a custom property.

Signed-off-by: Yamac Ay <yamac.ay@sap.com>
@yamaceay

Copy link
Copy Markdown
Contributor Author

Hi @MisterMX , before this PR, I actually had tested using external annotation name as the primary name field (and metadata.name as the fallback option, done same as in this PR).

After being told that other providers usually have a name field that we can pass, I sticked to using a custom name field. What would be your preferred option?

@yamaceay

Copy link
Copy Markdown
Contributor Author

Just for reference, here is the link for the alternative approach: #341

@MisterMX

Copy link
Copy Markdown
Collaborator

Replaced by #341

@MisterMX MisterMX closed this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Custom Project Name in Project CRD

3 participants