Skip to content

Commit

Permalink
Change native to platform (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Nov 15, 2024
1 parent 5957df4 commit c1b51df
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
6 changes: 5 additions & 1 deletion cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ func Execute(rootCmd *cobra.Command, stdin io.Reader, stdout io.Writer, stderr i
}

if app != nil {
runCmds.appType = app.Scheduler
if app.Scheduler == "native" {
runCmds.appType = "platform"
} else {
runCmds.appType = app.Scheduler
}
runCmds.appID = app.ID
runCmds.appSlug = app.Slug
}
Expand Down
10 changes: 5 additions & 5 deletions client/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (c *Client) ListChannels(appID string, appType string, channelName string)
return c.KotsClient.ListChannels(appID, channelName)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) GetChannel(appID string, appType string, channelID string) (*types.Channel, error) {
Expand All @@ -55,7 +55,7 @@ func (c *Client) GetChannel(appID string, appType string, channelID string) (*ty
} else if appType == "kots" {
return c.KotsClient.GetChannel(appID, channelID)
}
return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) ArchiveChannel(appID string, appType string, channelID string) error {
Expand All @@ -64,7 +64,7 @@ func (c *Client) ArchiveChannel(appID string, appType string, channelID string)
} else if appType == "kots" {
return c.KotsClient.ArchiveChannel(appID, channelID)
}
return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)

}

Expand All @@ -82,7 +82,7 @@ func (c *Client) CreateChannel(appID string, appType string, name string, descri
return c.KotsClient.ListChannels(appID, name)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

type GetOrCreateChannelOptions struct {
Expand Down Expand Up @@ -162,5 +162,5 @@ func (c *Client) UpdateSemanticVersioningForChannel(appType string, appID string
return err
}

return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)
}
2 changes: 1 addition & 1 deletion client/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ func (c *Client) PromoteCollector(appID string, appType string, specID string, c
return c.PlatformClient.PromoteCollector(appID, specID, channelIDs...)
}

return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)
}
6 changes: 3 additions & 3 deletions client/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (c *Client) CreateInstaller(appId string, appType string, yaml string) (*ty
return c.KotsClient.CreateInstaller(appId, yaml)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) ListInstallers(appId string, appType string) ([]types.InstallerSpec, error) {
Expand All @@ -23,7 +23,7 @@ func (c *Client) ListInstallers(appId string, appType string) ([]types.Installer
return c.KotsClient.ListInstallers(appId)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)

}

Expand All @@ -34,6 +34,6 @@ func (c *Client) PromoteInstaller(appId string, appType string, sequence int64,
return c.KotsClient.PromoteInstaller(appId, sequence, channelID, versionLabel)
}

return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)

}
15 changes: 7 additions & 8 deletions client/release.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package client

import (
"errors"

"github.com/pkg/errors"
"github.com/replicatedhq/replicated/pkg/types"
)

Expand Down Expand Up @@ -44,7 +43,7 @@ func (c *Client) ListReleases(appID string, appType string) ([]types.ReleaseInfo
return c.KotsClient.ListReleases(appID)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) CreateRelease(appID string, appType string, yaml string) (*types.ReleaseInfo, error) {
Expand Down Expand Up @@ -78,7 +77,7 @@ func (c *Client) CreateRelease(appID string, appType string, yaml string) (*type
return c.KotsClient.CreateRelease(appID, yaml)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) UpdateRelease(appID string, appType string, sequence int64, yaml string) error {
Expand All @@ -88,7 +87,7 @@ func (c *Client) UpdateRelease(appID string, appType string, sequence int64, yam
} else if appType == "kots" {
return c.KotsClient.UpdateRelease(appID, sequence, yaml)
}
return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)
}

func (c *Client) TestRelease(appID string, appType string, sequence int64) (string, error) {
Expand Down Expand Up @@ -116,7 +115,7 @@ func (c *Client) GetRelease(appID string, appType string, sequence int64) (*type
} else if appType == "kots" {
return c.KotsClient.GetRelease(appID, sequence)
}
return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

func (c *Client) PromoteRelease(appID string, appType string, sequence int64, label string, notes string, required bool, channelIDs ...string) error {
Expand All @@ -126,7 +125,7 @@ func (c *Client) PromoteRelease(appID string, appType string, sequence int64, la
} else if appType == "kots" {
return c.KotsClient.PromoteRelease(appID, sequence, label, notes, required, channelIDs...)
}
return errors.New("unknown app type")
return errors.Errorf("unknown app type %q", appType)
}

// data is a []byte describing a tarred yaml-dir, created by tarYAMLDir()
Expand All @@ -138,5 +137,5 @@ func (c *Client) LintRelease(appType string, data []byte, isBuildersRelease bool
return c.KotsClient.LintRelease(data, isBuildersRelease, contentType)
}

return nil, errors.New("unknown app type")
return nil, errors.Errorf("unknown app type %q", appType)
}

0 comments on commit c1b51df

Please sign in to comment.