1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

refactor(api): remove CLI deprecation related code (#1602)

This commit is contained in:
Anthony Lapenna 2018-01-24 21:58:58 +01:00 committed by GitHub
parent 0ff0c3ed0d
commit 672819f3af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 25 deletions

View file

@ -1,7 +1,6 @@
package cli package cli
import ( import (
"log"
"time" "time"
"github.com/portainer/portainer" "github.com/portainer/portainer"
@ -48,7 +47,6 @@ func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) {
SyncInterval: kingpin.Flag("sync-interval", "Duration between each synchronization via the external endpoints source").Default(defaultSyncInterval).String(), SyncInterval: kingpin.Flag("sync-interval", "Duration between each synchronization via the external endpoints source").Default(defaultSyncInterval).String(),
AdminPassword: kingpin.Flag("admin-password", "Hashed admin password").String(), AdminPassword: kingpin.Flag("admin-password", "Hashed admin password").String(),
AdminPasswordFile: kingpin.Flag("admin-password-file", "Path to the file containing the password for the admin user").String(), AdminPasswordFile: kingpin.Flag("admin-password-file", "Path to the file containing the password for the admin user").String(),
// Deprecated flags
Labels: pairs(kingpin.Flag("hide-label", "Hide containers with a specific label in the UI").Short('l')), Labels: pairs(kingpin.Flag("hide-label", "Hide containers with a specific label in the UI").Short('l')),
Logo: kingpin.Flag("logo", "URL for the logo displayed in the UI").String(), Logo: kingpin.Flag("logo", "URL for the logo displayed in the UI").String(),
Templates: kingpin.Flag("templates", "URL to the templates (apps) definitions").Short('t').String(), Templates: kingpin.Flag("templates", "URL to the templates (apps) definitions").Short('t').String(),
@ -97,8 +95,6 @@ func (*Service) ValidateFlags(flags *portainer.CLIFlags) error {
return errAdminPassExcludeAdminPassFile return errAdminPassExcludeAdminPassFile
} }
displayDeprecationWarnings(*flags.Templates, *flags.Logo, *flags.Labels)
return nil return nil
} }
@ -142,15 +138,3 @@ func validateSyncInterval(syncInterval string) error {
} }
return nil return nil
} }
func displayDeprecationWarnings(templates, logo string, labels []portainer.Pair) {
if templates != "" {
log.Println("Warning: the --templates / -t flag is deprecated and will be removed in future versions.")
}
if logo != "" {
log.Println("Warning: the --logo flag is deprecated and will be removed in future versions.")
}
if labels != nil {
log.Println("Warning: the --hide-label / -l flag is deprecated and will be removed in future versions.")
}
}

View file

@ -12,12 +12,17 @@ type (
// CLIFlags represents the available flags on the CLI. // CLIFlags represents the available flags on the CLI.
CLIFlags struct { CLIFlags struct {
Addr *string Addr *string
AdminPassword *string
AdminPasswordFile *string
Assets *string Assets *string
Data *string Data *string
Endpoint *string Endpoint *string
ExternalEndpoints *string ExternalEndpoints *string
Labels *[]Pair
Logo *string
NoAuth *bool NoAuth *bool
NoAnalytics *bool NoAnalytics *bool
Templates *string
TLSVerify *bool TLSVerify *bool
TLSCacert *string TLSCacert *string
TLSCert *string TLSCert *string
@ -26,12 +31,6 @@ type (
SSLCert *string SSLCert *string
SSLKey *string SSLKey *string
SyncInterval *string SyncInterval *string
AdminPassword *string
AdminPasswordFile *string
// Deprecated fields
Labels *[]Pair
Logo *string
Templates *string
} }
// Status represents the application status. // Status represents the application status.