-
Notifications
You must be signed in to change notification settings - Fork 933
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
Can't import code.cloudfoundry.org/cli v8.4.0 #2291
Comments
Hi @olyakrasnozhon. Thanks for pointing our attention, this issue seems similar to #2228 where @alex-gilin reported that the latest version of CF CLI that was published to https://pkg.go.dev/github.com/cloudfoundry/cli?tab=versions is 7.1.0 The fastest workaround for you to start using V3 would be |
Hi @a-b, do you know how we can be added to the slack channel? It seems you have to be invited; you can only sign up by contacting some unknown administrator... Looking at the guide (https://pkg.go.dev/about#adding-a-package), adding a package should be straight forward. However, there seems to be some sort of prerequisite that is not met with newer versions and https://proxy.golang.org/code.cloudfoundry.org/cli/@v/v8.4.0.info only gives an error response. Edit: Most likely this is because with 7.2.0, a move to go modules was done (9f5601b), and that requires things to be different to work on pkg.go.dev... Unfortunately, I'm no go expert, so I'm a bit clueless as to what a fix might look like... |
Looking at https://go.dev/doc/modules/release-workflow#breaking, the fix seems to be a change to https://github.com/cloudfoundry/cli/blob/v8.4.0/go.mod#L1 - module code.cloudfoundry.org/cli
+ module code.cloudfoundry.org/cli/v8
As you never import the module anywhere else during your development, I assume this would be an easy fix without breaking much on your end. Consumers could then go on to import on their end without problems: require (
code.cloudfoundry.org/cli/v8 v8.4.1
) Unfortunately, this will only work if a tag (v8.4.1 in the consuming example below) is created that includes this minimal change. Can this be done from your side? |
Showcased via the a quick fork: https://github.com/LukasHeimann/cloudfoundrycli/blob/v8/go.mod This is really a minimal change, so please consider adding it and releasing a fresh version. If I shall contribute a PR, please let me know, but, as said, this is really minimal and more of an organizational topic. Thank you again for considering! Kind regards Edit: a bunch of modules use absolute imports, so this might need to be changed as well, you will need to run a global string replace |
This relates to #2318 as well |
@LukasHeimann did you open a PR on this ? |
Not yet, as I haven't heard back from the maintainers. This would be a really huge change: 2,193 changed files with 9,192 additions and 9,192 deletions. This is nothing you can't just simply do, honestly... |
TBH, if you open a PR it at least starts the process. Considering its mostly mostly search and replace and should be validated by the compiler this could be easy to review. |
@LukasHeimann If not Ill have a quick look at opening a PR. |
Ok the biggest issue to migrate to a |
This is not possible because there was no mod file so the versions of its deps are not the same anymore and we get This means that no one can import any of this cli code for re-use |
Hello, and sorry for the long reply. We're open for PRs. |
I'm bumping the issue as it becomes a bit of a hassle to develop plugins in case we do want to use the v8 cli. I couldn't find a PR for it, is there one or is this actively being looked at? thanks. |
As an extra information, this becomes an actual issue, instead of just a hassle, as since the latest importable version is v7.1.0, which doesn't have a go.mod, all the dependencies will be taken from their latest versions, which will cause issues due to breaking changes. As an example, if I simply import github.com/cloudfoundry/cli, I will get github.com/cloudfoundry/cli v7.1.0+incompatible (the incompatible part pointing out that it's not a go module) and when resolving the dependencies you end up getting:
making it impossible to develop the plugin without individually going to each dependency failing, tracing back the last compatible version for that dependency and manually adding it to your go.mod. A bit less than desirable and perhaps not occurring to everyone. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed. |
Hello.. At this time we are not able to support client libraries for CLI. We would be happy to support any PRs submitted. |
Please fill out the issue checklist below and provide ALL the requested information.
CF_TRACE=1
to help debug the issue.Describe the bug and the command you saw an issue with
I need to start using v3 client instead of v2 in my terraform-provider-cf. After some investigation I see that the new resources and their CRUD APIs I need are placed in code.cloudfoundry.org/cli v8.4.0.
I can't import this library directly, the error is -
"go get: code.cloudfoundry.org/cli@v8.4.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v8".
I went over another libraries that I probably could use:
But they don't contains the newest APIs: for instance, go-cfclient contains the resource we need v3ServiceCredentialsBinding, but doesn't contain Create/Delete APIs for it.
What happened
I need your help to find the way to import appropriate library to my terraform-provider-cloudfoundry in order to be able to use all the resources and APIs that implemented in code.cloudfoundry.org/cli@v8.4.0.
Exact Steps To Reproduce
Notes regarding V6 and V7 CLI support:
The text was updated successfully, but these errors were encountered: