cluster-api
                                
                                 cluster-api copied to clipboard
                                
                                    cluster-api copied to clipboard
                            
                            
                            
                        🐛 `clusterctl init --list-images` should not need an initialized cluster
- Add ProviderCRDInstalled field in InitOptions
- In setupInstaller check if ProviderCRDInstalled is installed or not
- If yes return normal error
- If not return empty provider list
 
Signed-off-by: Aniruddha Basak [email protected]
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #6986
Welcome @aniruddha2000! 
It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval. 
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation. 
You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines. 
You may want to refer to our testing guide if you run into trouble with your tests not passing. 
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs! 
Thank you, and welcome to Kubernetes. :smiley:
Hi @aniruddha2000. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign neolit123 for approval by writing /assign @neolit123 in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/cc @ykakarap
Sure I will add the tests for the same.
@aniruddha2000 Is this ready for final review?
@ykakarap yes I have added the test file as well
Thanks. I will take a look tomorrow.
we need CI singal! /ok-to-test
we need CI singal! /ok-to-test
I didn't catch this 😅 . Thanks @fabriziopandini
The test signal is green. @fabriziopandini for approval.
Thanks for fixing this, @aniruddha2000!
Since I can't reproduce this bug with clusterctl 1.1, I think it was introduced in 1.2. I think this merits a backport.
/cherry-pick release-1.2
@dlipovetsky: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you.
In response to this:
Thanks for fixing this, @aniruddha2000!
Since I can't reproduce this bug with clusterctl 1.1, I think it was introduced in 1.2. I think this merits a backport.
/cherry-pick release-1.2
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.
@fabriziopandini This looks ready to be approved :pray:
sorry for getting late at this, great work /lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: fabriziopandini
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [fabriziopandini]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@dlipovetsky: #7111 failed to apply on top of branch "release-1.2":
Applying: Return empty providerList is provider CRD is not installed
Using index info to reconstruct a base tree...
M	cmd/clusterctl/client/init.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/clusterctl/client/init.go
CONFLICT (content): Merge conflict in cmd/clusterctl/client/init.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Return empty providerList is provider CRD is not installed
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
Thanks for fixing this, @aniruddha2000!
Since I can't reproduce this bug with clusterctl 1.1, I think it was introduced in 1.2. I think this merits a backport.
/cherry-pick release-1.2
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.