Skip to content

Commit

Permalink
fmt, fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dexhorthy committed Mar 30, 2020
1 parent 51348e6 commit 9ac76eb
Show file tree
Hide file tree
Showing 66 changed files with 193 additions and 208 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/channel_adoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitChannelAdoption(parent *cobra.Command) {
Short: "Print channel adoption statistics by license type",
Long: "Print channel adoption statistics by license type",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.channelAdoption
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/channel_counts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitChannelCounts(parent *cobra.Command) {
Short: "Print channel license counts",
Long: "Print channel license counts",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.channelCounts
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/channel_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (r *runners) InitChannelCreate(parent *cobra.Command) {
Example:
replicated channel create --name Beta --description 'New features subject to change'`,
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.Flags().StringVar(&r.args.channelCreateName, "name", "", "The name of this channel")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/channel_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (r *runners) InitChannelInspect(parent *cobra.Command) {
Short: "Show full details for a channel",
Long: "Show full details for a channel",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.channelInspect
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/channel_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitChannelReleases(parent *cobra.Command) {
Short: "List all releases in a channel",
Long: "List all releases in a channel",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.channelReleases
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/channel_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitChannelRemove(parent *cobra.Command) {
Short: "Remove (archive) a channel",
Long: "Remove (archive) a channel",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.channelRemove
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collector_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitCollectorCreate(parent *cobra.Command) {
Short: "Create a new collector",
Long: "Create a new collector by providing a name and YAML configuration",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.Flags().StringVar(&r.args.createCollectorYaml, "yaml", "", "The YAML config for this collector. Use '-' to read from stdin. Cannot be used with the `yaml-file` falg.")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collector_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (r *runners) InitCollectorInspect(parent *cobra.Command) {
Short: "Print the YAML config for a collector",
Long: "Print the YAML config for a collector",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.collectorInspect
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collector_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (r *runners) InitCollectorList(parent *cobra.Command) {
Short: "List all of an app's collectors",
Long: "List all of an app's collectors",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.collectorList
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collector_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (r *runners) InitCollectorPromote(parent *cobra.Command) {
Example: replicated collectors promote skd204095829040 fe4901690971757689f022f7a460f9b2`,
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.RunE = r.collectorPromote
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collector_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (r *runners) InitCollectorUpdate(parent *cobra.Command) {
Short: "Update a collector's name or yaml config",
Long: "Update a collector's name or yaml config",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.Flags().StringVar(&r.args.updateCollectorYaml, "yaml", "", "The new YAML config for this collector. Use '-' to read from stdin. Cannot be used with the `yaml-file` flag.")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/collectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func (r *runners) InitCollectorsCommand(parent *cobra.Command) *cobra.Command {
Short: "Manage customer collectors",
Long: `The collector command allows vendors to create, display, modify entitlement values for end customer licensing.`,
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

var tmp bool
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/customer_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (r *runners) InitCustomersLSCommand(parent *cobra.Command) *cobra.Command {
Use: "ls",
Short: "list customers",
Long: `list customers`,
RunE: r.listCustomers,
RunE: r.listCustomers,
}
parent.AddCommand(customersCmd)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func (r *runners) InitEntitlementsCommand(parent *cobra.Command) *cobra.Command
Short: "Manage customer entitlements",
Long: `The entitlements command allows vendors to create, display, modify entitlement values for end customer licensing.`,
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.PersistentFlags().StringVar(&r.args.entitlementsAPIServer, "replicated-api-server", "https://g.replicated.com/graphql", "upstream g. address")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/entitlements_definefields.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ basis and delivered securely to your on-prem application`,

cmd.Flags().StringVar(&r.args.entitlementsDefineFieldsFile, "file", "entitlements.yaml", "definitions file to promote")
cmd.Flags().StringVar(&r.args.entitlementsDefineFieldsName, "name", "", "name for this definition")
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/entitlements_getcustomerrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (r *runners) InitEntitlementsGetCustomerReleaseCommand(parent *cobra.Comman
cmd.Flags().StringVar(&r.args.entitlementsGetReleaseInstallationID, "installation-id", "", "installation id")
// change the default from g.replicated.com to pg.replicated.com
cmd.Flags().StringVar(&r.args.entitlementsGetReleaseAPIServer, "replicated-api-server", "https://pg.replicated.com/graphql", "Upstream api server")
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/entitlements_setvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (r *runners) InitEntitlementsSetValueCommand(parent *cobra.Command) {
Long: `Set a customer value for an entitlement field defined via 'replicated entitlements define-fields'`,
RunE: r.entitlementsSetValue,
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)

cmd.Flags().StringVar(&r.args.entitlementsSetValueDefinitionsID, "definitions-id", "", "definitions id created with define-fields command")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/release_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (r *runners) InitReleaseInspect(parent *cobra.Command) {
Short: "Print the YAML config for a release",
Long: "Print the YAML config for a release",
}
cmd.Hidden=true; // Not supported in KOTS
cmd.Hidden = true // Not supported in KOTS
parent.AddCommand(cmd)
cmd.RunE = r.releaseInspect
}
Expand Down
11 changes: 5 additions & 6 deletions cli/cmd/release_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import (
"github.com/spf13/cobra"
)


var (
validFailOnValues = map[string]interface{}{
"error": nil,
"warn": nil,
"info": nil,
"none": nil,
"": nil,
"warn": nil,
"info": nil,
"none": nil,
"": nil,
}
)

Expand All @@ -38,7 +37,7 @@ func (r *runners) releaseLint(cmd *cobra.Command, args []string) error {
return errors.Errorf("yaml is required")
}

if _, ok := validFailOnValues[r.args.lintReleaseFailOn]; !ok {
if _, ok := validFailOnValues[r.args.lintReleaseFailOn]; !ok {
return errors.Errorf("fail-on value %q not supported, supported values are [info, warn, error, none]", r.args.lintReleaseFailOn)
}

Expand Down
4 changes: 2 additions & 2 deletions client/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func (c *Client) CreateInstaller(appId string, appType string, yaml string) (*ty
if appType == "platform" {
return nil, errors.Errorf("Kubernetes Installers are not supported for platform applications")
} else if appType == "ship" {
return nil, errors.Errorf("Kubernetes Installers are not supported for platfrom applications")
return nil, errors.Errorf("Kubernetes Installers are not supported for ship applications")
} else if appType == "kots" {
return c.KotsClient.CreateInstaller(appId, yaml)
}
Expand All @@ -22,7 +22,7 @@ func (c *Client) ListInstallers(appId string, appType string) ([]types.Installer
if appType == "platform" {
return nil, errors.Errorf("Kubernetes Installers are not supported for platform applications")
} else if appType == "ship" {
return nil, errors.Errorf("Kubernetes Installers are not supported for platform applications")
return nil, errors.Errorf("Kubernetes Installers are not supported for ship applications")
} else if appType == "kots" {
return c.KotsClient.ListInstallers(appId)
}
Expand Down
8 changes: 4 additions & 4 deletions gen/go/v1/model_app_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
)

type AppRelease struct {
Config string `json:"Config,omitempty"`
Config string `json:"Config,omitempty"`
CreatedAt time.Time `json:"CreatedAt,omitempty"`
Editable bool `json:"Editable,omitempty"`
EditedAt time.Time `json:"EditedAt,omitempty"`
Sequence int64 `json:"Sequence,omitempty"`
Editable bool `json:"Editable,omitempty"`
EditedAt time.Time `json:"EditedAt,omitempty"`
Sequence int64 `json:"Sequence,omitempty"`
}
8 changes: 4 additions & 4 deletions gen/go/v1/model_body_10.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package swagger

type BodyPromoteRelease struct {
Channels []string `json:"channels"`
Label string `json:"label"`
ReleaseNotes string `json:"release_notes"`
Required bool `json:"required"`
Channels []string `json:"channels"`
Label string `json:"label"`
ReleaseNotes string `json:"release_notes"`
Required bool `json:"required"`
}
4 changes: 2 additions & 2 deletions gen/go/v1/model_body_11.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ package swagger

type Body11 struct {
// If activation is required this is the email the code will be sent to.
ActivationEmail string `json:"activation_email"`
AirgapDownloadEnabled bool `json:"airgap_download_enabled"`
ActivationEmail string `json:"activation_email"`
AirgapDownloadEnabled bool `json:"airgap_download_enabled"`
// App Id that this license will be associated with.
AppId string `json:"app_id"`
// License Label name, ie name of customer who is using license.
Expand Down
8 changes: 4 additions & 4 deletions gen/go/v1/model_body_12.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ package swagger

type Body12 struct {
// If activation is required this is the email the code will be sent to.
ActivationEmail string `json:"activation_email"`
AirgapDownloadEnabled bool `json:"airgap_download_enabled"`
ActivationEmail string `json:"activation_email"`
AirgapDownloadEnabled bool `json:"airgap_download_enabled"`
// License Label name, ie name of customer who is using license.
Assignee string `json:"assignee"`
AssistedSetupEnabled bool `json:"assisted_setup_enabled"`
Assignee string `json:"assignee"`
AssistedSetupEnabled bool `json:"assisted_setup_enabled"`
// Channel id that the license will be associated with.
ChannelId string `json:"channel_id"`
// Date that the license will expire, can be null for no expiration or formated by year-month-day ex. 2016-02-02.
Expand Down
8 changes: 4 additions & 4 deletions gen/go/v1/model_body_14.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
package swagger

type Body14 struct {
Amount int64 `json:"amount"`
Description string `json:"description"`
VendorDueFromCustomerDate string `json:"vendor_due_from_customer_date"`
Amount int64 `json:"amount"`
Description string `json:"description"`
VendorDueFromCustomerDate string `json:"vendor_due_from_customer_date"`
VendorInvoiceToCustomerDate string `json:"vendor_invoice_to_customer_date"`
VendorPaidByCustomerDate string `json:"vendor_paid_by_customer_date"`
VendorPaidByCustomerDate string `json:"vendor_paid_by_customer_date"`
}
8 changes: 4 additions & 4 deletions gen/go/v1/model_body_15.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
package swagger

type Body15 struct {
Amount int64 `json:"amount"`
Description string `json:"description"`
VendorDueFromCustomerDate string `json:"vendor_due_from_customer_date"`
Amount int64 `json:"amount"`
Description string `json:"description"`
VendorDueFromCustomerDate string `json:"vendor_due_from_customer_date"`
VendorInvoiceToCustomerDate string `json:"vendor_invoice_to_customer_date"`
VendorPaidByCustomerDate string `json:"vendor_paid_by_customer_date"`
VendorPaidByCustomerDate string `json:"vendor_paid_by_customer_date"`
}
6 changes: 3 additions & 3 deletions gen/go/v1/model_body_3.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package swagger

type BodyCreateChannel struct {
AirgapEnabled bool `json:"airgap_enabled,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name"`
AirgapEnabled bool `json:"airgap_enabled,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name"`
}
8 changes: 4 additions & 4 deletions gen/go/v1/model_body_4.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package swagger

type Body4 struct {
AirgapEnabled bool `json:"airgap_enabled,omitempty"`
Description string `json:"description,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
Name string `json:"name"`
AirgapEnabled bool `json:"airgap_enabled,omitempty"`
Description string `json:"description,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
Name string `json:"name"`
}
4 changes: 2 additions & 2 deletions gen/go/v1/model_body_5.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ package swagger

type Body5 struct {
ReleaseNotes string `json:"release_notes"`
Required bool `json:"required"`
Version string `json:"version"`
Required bool `json:"required"`
Version string `json:"version"`
}
10 changes: 5 additions & 5 deletions gen/go/v1/model_body_6.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ package swagger

type Body6 struct {
Default_ string `json:"default"`
Hidden bool `json:"hidden"`
Name string `json:"name"`
Required bool `json:"required"`
Title string `json:"title"`
Type_ string `json:"type"`
Hidden bool `json:"hidden"`
Name string `json:"name"`
Required bool `json:"required"`
Title string `json:"title"`
Type_ string `json:"type"`
}
8 changes: 4 additions & 4 deletions gen/go/v1/model_branding.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

type Branding struct {
Created time.Time `json:"created,omitempty"`
Css string `json:"css,omitempty"`
Default_ bool `json:"default,omitempty"`
Updated time.Time `json:"updated,omitempty"`
Created time.Time `json:"created,omitempty"`
Css string `json:"css,omitempty"`
Default_ bool `json:"default,omitempty"`
Updated time.Time `json:"updated,omitempty"`
}
10 changes: 5 additions & 5 deletions gen/go/v1/model_channel_adoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ package swagger

// ChannelAdoption represents the versions that licenses are on in the channel
type ChannelAdoption struct {
CurrentVersionCountActive map[string]int64 `json:"current_version_count_active,omitempty"`
CurrentVersionCountAll map[string]int64 `json:"current_version_count_all,omitempty"`
OtherVersionCountActive map[string]int64 `json:"other_version_count_active,omitempty"`
OtherVersionCountAll map[string]int64 `json:"other_version_count_all,omitempty"`
CurrentVersionCountActive map[string]int64 `json:"current_version_count_active,omitempty"`
CurrentVersionCountAll map[string]int64 `json:"current_version_count_all,omitempty"`
OtherVersionCountActive map[string]int64 `json:"other_version_count_active,omitempty"`
OtherVersionCountAll map[string]int64 `json:"other_version_count_all,omitempty"`
PreviousVersionCountActive map[string]int64 `json:"previous_version_count_active,omitempty"`
PreviousVersionCountAll map[string]int64 `json:"previous_version_count_all,omitempty"`
PreviousVersionCountAll map[string]int64 `json:"previous_version_count_all,omitempty"`
}
20 changes: 10 additions & 10 deletions gen/go/v1/model_channel_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
)

type ChannelRelease struct {
AirgapBuildError string `json:"airgap_build_error,omitempty"`
AirgapBuildStatus string `json:"airgap_build_status,omitempty"`
ChannelId string `json:"channel_id,omitempty"`
ChannelSequence int64 `json:"channel_sequence,omitempty"`
Created time.Time `json:"created,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
ReleaseSequence int64 `json:"release_sequence,omitempty"`
Required bool `json:"required,omitempty"`
Updated time.Time `json:"updated,omitempty"`
Version string `json:"version,omitempty"`
AirgapBuildError string `json:"airgap_build_error,omitempty"`
AirgapBuildStatus string `json:"airgap_build_status,omitempty"`
ChannelId string `json:"channel_id,omitempty"`
ChannelSequence int64 `json:"channel_sequence,omitempty"`
Created time.Time `json:"created,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
ReleaseSequence int64 `json:"release_sequence,omitempty"`
Required bool `json:"required,omitempty"`
Updated time.Time `json:"updated,omitempty"`
Version string `json:"version,omitempty"`
}
2 changes: 1 addition & 1 deletion gen/go/v1/model_inline_response_200.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ package swagger

type InlineResponse200 struct {
Branding map[string]Branding `json:"branding,omitempty"`
Channels []AppChannel `json:"channels,omitempty"`
Channels []AppChannel `json:"channels,omitempty"`
}
Loading

0 comments on commit 9ac76eb

Please sign in to comment.