alexellis / arkade

Open Source Marketplace For Developer Tools
https://blog.alexellis.io/kubernetes-marketplace-two-year-update/
MIT License
4.2k stars 287 forks source link

Add operator-sdk to arkade #547

Closed xshyamx closed 8 months ago

xshyamx commented 2 years ago

Add the operator-sdk CLI as a tool candidate for arkade

Expected Behaviour

Install operator-sdk

arkade get operator-sdk

Current Behaviour

Not available as a candidate

Are you a GitHub Sponsor (Yes/No?)

Check at https://github.com/sponsors/alexellis

Possible Solution

Add operator-sdk as a tool candidate

Context

The operator-sdk CLI is not available as part of any of the default APT/Yum repositories and does not require any special privileges to run. So, it is a good candidate for an arkade tool.

Your Environment

alexellis commented 2 years ago

Hi @xshyamx thanks for this suggestion, the app sounds fine to me.

For future suggestions, please can you follow the contribution guide and wait for approval before sending PRs? This is to avoid you spending unnecessary time and effort before we have agreement on a change.

The same approach applies to OpenFaaS/k3sup/inlets etc.

Alex

xshyamx commented 2 years ago

Sure. Will do that 👍🏽

xshyamx commented 2 years ago

Hi @alexellis ,

I'm encountering a special case with operator-sdk where there is no windows binary. There are a couple of options on how to handle it

  1. Return empty URL for BinaryTemplate or URLTemplate both will fail with the following error messages

    # empty BinaryTemplate
    Downloading: https://github.com/operator-framework/operator-sdk/releases/download/v1.22.0/
    Error: incorrect status for downloading tool: 404
    
    # empty URLTemplate
    Downloading: 
    Error: Get "": unsupported protocol scheme ""
  2. Check for empty string from tool.GetURL and throw an error

    dlURL, err := tool.GetURL(os, arch, ver, quiet)
    if err != nil {
        return "", err
    }
    if dlURL == "" {
        return "", errors.New("No available download for this environment")
    }

    Which results in

    $ ./arkade get --os ming  operator-sdk
    Downloading: operator-sdk
    2022/06/18 13:31:15 Looking up version for operator-sdk
    2022/06/18 13:31:16 Found: v1.22.0
    Error: No available download for this environment

I prefer option 2 but, would like your opinion on how to handle it

alexellis commented 2 years ago

I'd say that you should allow then URL to be generated so that it's a valid URL but returns a 404. That's the approach we've taken elsewhere. Try it and see the message that you get.

xshyamx commented 2 years ago

Updated PR with suggested changes

alexellis commented 2 years ago

Thank you. Can you check if you need to rebase? We are currently merging multiple PRs.

xshyamx commented 2 years ago

Yes. Have already rebased

Shikachuu commented 8 months ago

/close

548 already merged