From 36b7c9e80dbb4f430f9576e900060ac4437eb931 Mon Sep 17 00:00:00 2001 From: smithers1221 Date: Tue, 17 Sep 2019 14:59:35 -0700 Subject: [PATCH] messaging for kots users trying to create/ls collectors (#63) messaging for kots users trying to create/ls collectors --- client/collector.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/client/collector.go b/client/collector.go index 96abc673b..b59906ac8 100644 --- a/client/collector.go +++ b/client/collector.go @@ -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" ) @@ -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 @@ -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) }