Skip to content

Download kubeseal via faas-cli cloud seal command #730

Merged
alexellis merged 4 commits intomasterfrom
openfaasltd/download-kubeseal
Nov 28, 2019
Merged

Download kubeseal via faas-cli cloud seal command #730
alexellis merged 4 commits intomasterfrom
openfaasltd/download-kubeseal

Conversation

@alexellis
Copy link
Copy Markdown
Member

Description

Download kubeseal via faas-cli cloud seal command

Motivation and Context

  • I have raised an issue to propose this change (required)

Closes: #722 and closes: #724 by @utsavanand2 💪 🙏

This is the combination of the approach taken by @utsavanand2 and
the guidance offered by @rgee0 and @LucasRoesler combined into
a single PR. It also uses the GitHub HTTP website instead of the
GitHub API - the GitHub API has a rate-limit of 50 requests per
hour and is likely to get exhausted quickly, so this approach
removes the issue in #724.

Given that there is only one executable needed at this stage, the
download command idea was removed in favour of a simple flag. The
flag will be updated in the README.md and documentation after
the merge and release.

How Has This Been Tested?

Tested with --download and --download-version with an override
on MacOS.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Closes: #722 and closes: #724 by @utsavanand2

This is the combination of the approach taken by @utsavanand2 and
the guidance offered by @rgee0 and @LucasRoesler combined into
a single PR. It also uses the GitHub HTTP website instead of the
GitHub API - the GitHub API has a rate-limit of 50 requests per
hour and is likely to get exhausted quickly, so this approach
removes the issue in #724.

Given that there is only one executable needed at this stage, the
download command idea was removed in favour of a simple flag. The
flag will be updated in the README.md and documentation after
the merge and release.

Tested with --download and --download-version with an override
on MacOS.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@alexellis
Copy link
Copy Markdown
Member Author

./faas-cli cloud seal --download
Starting download of kubeseal v0.9.5, this could take a few moments.
Download completed, please run:

  chmod +x /var/folders/kk/7ds650y150j3b5q_t_k3q8gc0000gn/T/kubeseal
  sudo install /var/folders/kk/7ds650y150j3b5q_t_k3q8gc0000gn/T/kubeseal /usr/local/bin/

kosmos:faas-cli alex$ sudo install /var/folders/kk/7ds650y150j3b5q_t_k3q8gc0000gn/T/kubeseal /usr/local
/bin/
kosmos:faas-cli alex$ kubeseal --version
kubeseal version: v0.9.5
kosmos:faas-cli alex$ 

Prints version before install command so that the pasted value
does not get entered as a password. Corrects typo in the flag.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@alexellis
Copy link
Copy Markdown
Member Author

I did consider adding a command for this, but given that the command is already very nested I decided to try a flag.

return nil
}

func findRelease(url string) (string, error) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This approach can be used to inform users when there is an update for the faas-cli itself. It also doesn't count towards the rate limiting.

Given that the code now exists to check for the release of
kubeseal, this can be used to detect version drift of the faas-cli
itself.

Tested on MacOS with "go build"

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@alexellis alexellis merged commit 8f825f6 into master Nov 28, 2019
@alexellis alexellis deleted the openfaasltd/download-kubeseal branch November 28, 2019 16:00
@alexellis
Copy link
Copy Markdown
Member Author

If folks have comments please feel free to shout and I'd be happy to take them into consideration.

@alexellis
Copy link
Copy Markdown
Member Author

@Waterdrips cc

@alexellis
Copy link
Copy Markdown
Member Author

This might be better than using bash in ofc-bootstrap when we download kubeseal in the same way

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Download kubeseal using Golang

1 participant