-
Couldn't load subscription status.
- Fork 26
add installer commands to kots channel inspect #149
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
Conversation
| ) | ||
|
|
||
| func (c *Client) ListChannels(appID string, appType string) ([]types.Channel, error) { | ||
| func (c *Client) ListChannels(appID string, appType string, appSlug string) ([]types.Channel, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're gonna start seeing appSlug passed in everywhere because the vendor/v3 endpoint uses it to list channels.
| } | ||
|
|
||
| func (c *Client) GetChannelByName(appID string, appType string, name string, description string, createIfAbsent bool) (*types.Channel, error) { | ||
| func (c *Client) GetOrCreateChannelByName(appID string, appType string, appSlug string, name string, description string, createIfAbsent bool) (*types.Channel, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is refactored from each individual Platform/Ship/KOTS client, because the logic is basically the same.
pkg/kotsclient/channel.go
Outdated
|
|
||
| return fmt.Sprintf(` curl -fsSL -o %s.tar.gz %s | ||
| tar xvf %s.tar.gz | ||
| sudo bash ./install.sh airgap`, slug, kurlURL, slug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just spitballin over here folks but this seems useful
pkg/kotsclient/channel.go
Outdated
| Channels []*KotsChannel `json:"channels"` | ||
| } | ||
|
|
||
| func (c *HTTPClient) ListChannels(appID string, appSlug string) ([]types.Channel, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's the new vendor v3 impl, it also attaches the install commands 🙂
2ba34c6 to
e39773d
Compare
this uses go template `with` to skip these on non-kots apps. I really want these install scripits to be sent down from the server side, but for now they are built by the client in vendor.replicated.com, so we'll build them in the client here as well.
```
$ replicated channel inspect dextestxxxxx
ID: _-0LiRWGjBG2-VtJIr0F127QPiuR7T6M
NAME: dextestxxxxx
DESCRIPTION:
RELEASE: 11
VERSION: 0.0.1
EXISTING:
curl -fsSL https://kots.io/install | bash
kubectl kots install kots-dex/dextestxxxxx
EMBEDDED:
curl -fsSL https://k8s.kurl.sh/kots-dex-dextestxxxxx | sudo bash
AIRGAP:
curl -fsSL -o kots-dex-dextestxxxxx.tar.gz https://k8s.kurl.sh/bundle/kots-dex-dextestxxxxx.tar.gz
tar xvf kots-dex-dextestxxxxx.tar.gz
sudo bash ./install.sh airgap
```
Other stuff
----------
- Move KOTS ListChannels call to vendor v3 API, this involved passing app slug down into a bunch of methods
- added appSlug to `*cmd.runner` during the Pre-Run function
- refactored the common "find channel by name" logic onto `Client` instead of duplicating it on each client impl
e39773d to
96b29b9
Compare
go.mod
Outdated
| golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de | ||
| golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 // indirect | ||
| gopkg.in/yaml.v2 v2.3.0 // indirect | ||
| github.com/ulikunitz/xz v0.5.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels improperly formatted
not really a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no it was bothering me too I'll fix it
this uses go template
withto skip these on non-kots apps. I really want these install scripits to be sent down from the server side, but for now they are built by the client in vendor.replicated.com, so we'll build them in the client here as well.Other stuff
*cmd.runnerduring the Pre-Run functionClientinstead of duplicating it on each client impl