From 91f4ccf0874c198c3c5701f9a47358851ebf8c37 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 13 Jun 2022 11:04:08 +0200 Subject: [PATCH] Add Traefik Hub button and deprecate Pilot Co-authored-by: Tom Moulard --- cmd/traefik/traefik.go | 2 +- docs/content/migration/v2.md | 5 + pkg/config/static/pilot.go | 1 + pkg/config/static/static_config.go | 1 + pkg/pilot/pilot.go | 2 - pkg/version/version.go | 11 +- webui/Dockerfile | 2 - webui/quasar.conf.js | 6 +- webui/src/App.vue | 11 +- webui/src/_helpers/APP.js | 3 +- webui/src/components/_commons/NavBar.vue | 13 +- .../platform/PlatformActionButton.vue | 20 ---- .../components/platform/PlatformAuthState.vue | 82 ------------- .../src/components/platform/PlatformPanel.vue | 112 ------------------ 14 files changed, 21 insertions(+), 250 deletions(-) delete mode 100644 webui/src/components/platform/PlatformActionButton.vue delete mode 100644 webui/src/components/platform/PlatformAuthState.vue delete mode 100644 webui/src/components/platform/PlatformPanel.vue diff --git a/cmd/traefik/traefik.go b/cmd/traefik/traefik.go index 47f409a0b..0a77dd7d2 100644 --- a/cmd/traefik/traefik.go +++ b/cmd/traefik/traefik.go @@ -216,7 +216,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err } if staticConfiguration.Pilot != nil { - version.PilotEnabled = staticConfiguration.Pilot.Dashboard + log.WithoutContext().Warn("Traefik Pilot is deprecated and will be removed soon. Please check our Blog for migration instructions later this year.") } // Plugins diff --git a/docs/content/migration/v2.md b/docs/content/migration/v2.md index 822828145..2461c4ac6 100644 --- a/docs/content/migration/v2.md +++ b/docs/content/migration/v2.md @@ -468,3 +468,8 @@ This option available in the ForwardAuth middleware, as well as in the HTTP, Con ### Consul Enterprise Namespaces In `v2.8`, the `namespace` option of Consul and Consul Catalog providers is deprecated, please use the `namespaces` options instead. + +### Traefik Pilot + +In `v2.8`, the `pilot.token` and `pilot.dashboard` options are deprecated. +Please check our Blog for migration instructions later this year. diff --git a/pkg/config/static/pilot.go b/pkg/config/static/pilot.go index 147c8917b..f3699a729 100644 --- a/pkg/config/static/pilot.go +++ b/pkg/config/static/pilot.go @@ -1,6 +1,7 @@ package static // Pilot Configuration related to Traefik Pilot. +// Deprecated. type Pilot struct { Token string `description:"Traefik Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` Dashboard bool `description:"Enable Traefik Pilot in the dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty"` diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go index 4cc699f22..5eb8130d6 100644 --- a/pkg/config/static/static_config.go +++ b/pkg/config/static/static_config.go @@ -78,6 +78,7 @@ type Configuration struct { CertificatesResolvers map[string]CertificateResolver `description:"Certificates resolvers configuration." json:"certificatesResolvers,omitempty" toml:"certificatesResolvers,omitempty" yaml:"certificatesResolvers,omitempty" export:"true"` + // Deprecated. Pilot *Pilot `description:"Traefik Pilot configuration." json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty" export:"true"` Hub *hub.Provider `description:"Traefik Hub configuration." json:"hub,omitempty" toml:"hub,omitempty" yaml:"hub,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` diff --git a/pkg/pilot/pilot.go b/pkg/pilot/pilot.go index 2cf03326f..71a256eb9 100644 --- a/pkg/pilot/pilot.go +++ b/pkg/pilot/pilot.go @@ -194,8 +194,6 @@ func (c *client) SendInstanceInfo(ctx context.Context, pilotMetrics []metrics.Pi if err != nil { return fmt.Errorf("failed to create UUID: %w", err) } - - version.UUID = c.uuid } info := instanceInfo{ diff --git a/pkg/version/version.go b/pkg/version/version.go index ec31b4365..e53d106d0 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -23,9 +23,6 @@ var ( // StartDate holds the start date of traefik. StartDate = time.Now() // UUID instance uuid. - UUID string - // PilotEnabled activate integration of pilot into the dashboard. - PilotEnabled bool ) // Handler expose version routes. @@ -46,11 +43,9 @@ func (v Handler) Append(router *mux.Router) { UUID string `json:"uuid,omitempty"` PilotEnabled bool `json:"pilotEnabled"` }{ - Version: Version, - Codename: Codename, - StartDate: StartDate, - UUID: UUID, - PilotEnabled: PilotEnabled, + Version: Version, + Codename: Codename, + StartDate: StartDate, } if err := templatesRenderer.JSON(response, http.StatusOK, v); err != nil { diff --git a/webui/Dockerfile b/webui/Dockerfile index 643f12f8e..edb9593bc 100644 --- a/webui/Dockerfile +++ b/webui/Dockerfile @@ -2,8 +2,6 @@ FROM node:14.16 # Current Active LTS release according to (https://nodejs.org/en/about/releases/) ENV WEBUI_DIR /src/webui -ARG ARG_PLATFORM_URL=https://pilot.traefik.io -ENV PLATFORM_URL=${ARG_PLATFORM_URL} RUN mkdir -p $WEBUI_DIR COPY package.json $WEBUI_DIR/ diff --git a/webui/quasar.conf.js b/webui/quasar.conf.js index c7dc90513..07eec1a8d 100644 --- a/webui/quasar.conf.js +++ b/webui/quasar.conf.js @@ -118,13 +118,11 @@ module.exports = function (ctx) { env: process.env.APP_ENV === 'development' ? { // staging: APP_ENV: JSON.stringify(process.env.APP_ENV), - APP_API: JSON.stringify(process.env.APP_API || '/api'), - PLATFORM_URL: JSON.stringify(process.env.PLATFORM_URL || 'https://pilot.traefik.io') + APP_API: JSON.stringify(process.env.APP_API || '/api') } : { // production: APP_ENV: JSON.stringify(process.env.APP_ENV), - APP_API: JSON.stringify(process.env.APP_API || '/api'), - PLATFORM_URL: JSON.stringify(process.env.PLATFORM_URL || 'https://pilot.traefik.io') + APP_API: JSON.stringify(process.env.APP_API || '/api') }, uglifyOptions: { compress: { diff --git a/webui/src/App.vue b/webui/src/App.vue index bb6e93e60..d655741b1 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,26 +1,17 @@ - - diff --git a/webui/src/components/platform/PlatformAuthState.vue b/webui/src/components/platform/PlatformAuthState.vue deleted file mode 100644 index 9d4bfea21..000000000 --- a/webui/src/components/platform/PlatformAuthState.vue +++ /dev/null @@ -1,82 +0,0 @@ -