Skip to content

Commit

Permalink
messaging for kots users trying to create/ls collectors (#63)
Browse files Browse the repository at this point in the history
messaging for kots users trying to create/ls collectors
  • Loading branch information
smithers1221 authored Sep 17, 2019
1 parent c320725 commit 36b7c9e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions client/collector.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package client

import (
"errors"

"github.com/pkg/errors"
collectors "github.com/replicatedhq/replicated/gen/go/v1"
"github.com/replicatedhq/replicated/pkg/types"
)
Expand All @@ -14,6 +13,10 @@ func (c *Client) ListCollectors(appID string) ([]types.CollectorInfo, error) {
return nil, err
}

if appType == "kots" {
return nil, errors.New("On a kots application, users must modify the support-bundle.yaml file in the release")
}

shipappCollectors, err := c.ShipClient.ListCollectors(appID, appType)
if err != nil {
return nil, err
Expand Down Expand Up @@ -58,6 +61,14 @@ func (c *Client) UpdateCollectorName(appID string, specID string, name string) (
// func (c *Client) CreateCollector(appID string, name string, yaml string) (*collectors.AppCollectorInfo, error) {
func (c *Client) CreateCollector(appID string, name string, yaml string) (*collectors.AppCollectorInfo, error) {

appType, err := c.GetAppType(appID)
if err != nil {
return nil, err
}

if appType == "kots" {
return nil, errors.New("On a kots application, users must modify the support-bundle.yaml file in the release")
}
return c.ShipClient.CreateCollector(appID, name, yaml)

}
Expand Down

0 comments on commit 36b7c9e

Please sign in to comment.