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

init - add option to select branch/tag #5391

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

lsviben
Copy link
Contributor

@lsviben lsviben commented Feb 14, 2024

Description of your changes

Noticed during the creation of the configuration-template that its annoying that the init command just clones the main branch without any options to change. It makes it difficult to test the init commands NOTES.txt and init.sh script during development.

With this option, you can choose a tag or branch name to clone from. It should make developing templates easier.

Example:

~/go/crossplane/_output/bin/darwin_arm64/crank beta xpkg init conf-temp https://github.com/lsviben/configuration-template -d conf12 --ref-name v0.1.0
Initialized package "conf-temp" in directory "/Users/lsviben/test/t/conf12" from https://github.com/lsviben/configuration-template/tree/2b121e1a57b4e8b9a0ca4907b2ed2cb6a829ccff (HEAD)

A template for writing a Configuration (https://docs.crossplane.io/v1.14/concepts/packages).

To use this template:
1. Replace the name, metadata in crossplane.yaml to reflect your Configuration.
2. Add dependencies in crossplane.yaml.
3. Update the sample CompositeResourceDefinition and Composition in the `apis/`
   directory to reflect the API you're designing for your platform, and optionally add more if needed.
4. Add/Update examples in the `examples/` directory.
5. Update the `README.md`, to be about your Configuration!

To build and push your Configuration to a registry, run the following commands
using the Crossplane CLI:

`crossplane xpkg build`
(Optionally) `crossplane xpkg login`
`crossplane xpkg push your-org/your-repo:v1.0.0`

Check the README.md for more information and have fun building your Configuration!
~/go/crossplane/_output/bin/darwin_arm64/crank beta xpkg init conf-temp https://github.com/lsviben/configuration-template -d conf13 --ref-name skelly
Initialized package "conf-temp" in directory "/Users/lsviben/test/t/conf13" from https://github.com/lsviben/configuration-template/tree/2b121e1a57b4e8b9a0ca4907b2ed2cb6a829ccff (skelly)

A template for writing a Configuration (https://docs.crossplane.io/v1.14/concepts/packages).

To use this template:
1. Replace the name, metadata in crossplane.yaml to reflect your Configuration.
2. Add dependencies in crossplane.yaml.
3. Update the sample CompositeResourceDefinition and Composition in the `apis/`
   directory to reflect the API you're designing for your platform, and optionally add more if needed.
4. Add/Update examples in the `examples/` directory.
5. Update the `README.md`, to be about your Configuration!

To build and push your Configuration to a registry, run the following commands
using the Crossplane CLI:

`crossplane xpkg build`
(Optionally) `crossplane xpkg login`
`crossplane xpkg push your-org/your-repo:v1.0.0`

Check the README.md for more information and have fun building your Configuration!

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • [] Added or updated unit tests.
  • [] Added or updated e2e tests.
  • Linked a PR or a docs tracking issue to document this change.
  • [] Added backport release-x.y labels to auto-backport this PR.

Need help with this checklist? See the cheat sheet.

Signed-off-by: lsviben <sviben.lovro@gmail.com>
@lsviben lsviben requested review from phisco and a team as code owners February 14, 2024 11:10
@lsviben lsviben requested a review from turkenh February 14, 2024 11:10
@lsviben lsviben changed the title add option to select branch/tag on init init - add option to select branch/tag Feb 14, 2024
@lsviben
Copy link
Contributor Author

lsviben commented Feb 14, 2024

I know its late, but I wonder if its worth including this in v1.15 as it would help folks working on template post-init hooks.

Copy link
Contributor

@phisco phisco left a comment

Choose a reason for hiding this comment

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

I would be fine having this back-ported, @jbw976 I'll leave to you the last call.

Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Cool, this functionality seems to work when I just tested, and it would have been nice to have yesterday while testing the new content you were adding to https://github.com/lsviben/configuration-template/tree/skelly that wasn't in the main branch yet 😂

This is very low risk, so I'm not against backporting it too.

@jbw976 jbw976 merged commit 489ccab into crossplane:master Feb 14, 2024
17 of 20 checks passed
Copy link

Successfully created backport PR for release-1.15:

@lsviben
Copy link
Contributor Author

lsviben commented Feb 14, 2024

Cool, this functionality seems to work when I just tested, and it would have been nice to have yesterday while testing the new content you were adding to https://github.com/lsviben/configuration-template/tree/skelly that wasn't in the main branch yet 😂

My pain yesterday made me do this, actually did it during working on that. You could say its first-hand dev experience improvements 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants