arkade icon indicating copy to clipboard operation
arkade copied to clipboard

Add operator-sdk to arkade

Open xshyamx opened this issue 3 years ago • 7 comments

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

  • [ ] Yes
  • [x] No

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

  • Operating System and version (e.g. Linux, Windows, MacOS):

    • Amazon Linux
    • Ubuntu
    • MacOS
  • What arkade version is this? 0.8.5

xshyamx avatar Oct 20 '21 21:10 xshyamx

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

alexellis avatar Oct 21 '21 07:10 alexellis

Sure. Will do that 👍🏽

xshyamx avatar Oct 21 '21 07:10 xshyamx

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

xshyamx avatar Jun 18 '22 08:06 xshyamx

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.

alexellis avatar Jun 19 '22 07:06 alexellis

Updated PR with suggested changes

xshyamx avatar Jun 22 '22 14:06 xshyamx

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

alexellis avatar Jun 29 '22 06:06 alexellis

Yes. Have already rebased

xshyamx avatar Jun 29 '22 15:06 xshyamx

/close

#548 already merged

Shikachuu avatar Jan 02 '24 20:01 Shikachuu