From 14fa60f6e6b437f4469941bf38645e621afb5733 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Thu, 18 May 2023 10:21:07 +1200 Subject: [PATCH] fix(docker): fix extension spelling EE-5277 (#8956) --- api/datastore/init.go | 2 +- api/datastore/migrator/migrate_dbversion100.go | 6 +++--- api/datastore/test_data/output_24_to_latest.json | 2 +- api/http/handler/settings/settings_public.go | 4 ++-- api/jwt/jwt.go | 2 +- api/portainer.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/datastore/init.go b/api/datastore/init.go index ceffd29cb..4544fde07 100644 --- a/api/datastore/init.go +++ b/api/datastore/init.go @@ -60,7 +60,7 @@ func (store *Store) checkOrCreateDefaultSettings() error { KubeconfigExpiry: portainer.DefaultKubeconfigExpiry, KubectlShellImage: portainer.DefaultKubectlShellImage, - IsDockerDesktopExtention: isDDExtention, + IsDockerDesktopExtension: isDDExtention, } return store.SettingsService.UpdateSettings(defaultSettings) diff --git a/api/datastore/migrator/migrate_dbversion100.go b/api/datastore/migrator/migrate_dbversion100.go index d47947d3f..9108e24a3 100644 --- a/api/datastore/migrator/migrate_dbversion100.go +++ b/api/datastore/migrator/migrate_dbversion100.go @@ -9,9 +9,9 @@ import ( func (m *Migrator) migrateDockerDesktopExtentionSetting() error { log.Info().Msg("updating docker desktop extention flag in settings") - isDDExtention := false + isDDExtension := false if _, ok := os.LookupEnv("DOCKER_EXTENSION"); ok { - isDDExtention = true + isDDExtension = true } settings, err := m.settingsService.Settings() @@ -19,7 +19,7 @@ func (m *Migrator) migrateDockerDesktopExtentionSetting() error { return err } - settings.IsDockerDesktopExtention = isDDExtention + settings.IsDockerDesktopExtension = isDDExtension err = m.settingsService.UpdateSettings(settings) if err != nil { return err diff --git a/api/datastore/test_data/output_24_to_latest.json b/api/datastore/test_data/output_24_to_latest.json index a4a0e17e3..fcd628365 100644 --- a/api/datastore/test_data/output_24_to_latest.json +++ b/api/datastore/test_data/output_24_to_latest.json @@ -606,7 +606,7 @@ "InternalAuthSettings": { "RequiredPasswordLength": 12 }, - "IsDockerDesktopExtention": false, + "IsDockerDesktopExtension": false, "KubeconfigExpiry": "0", "KubectlShellImage": "portainer/kubectl-shell", "LDAPSettings": { diff --git a/api/http/handler/settings/settings_public.go b/api/http/handler/settings/settings_public.go index 4aea4a9a6..105fd5c68 100644 --- a/api/http/handler/settings/settings_public.go +++ b/api/http/handler/settings/settings_public.go @@ -50,7 +50,7 @@ type publicSettingsResponse struct { CheckinInterval int `example:"60"` } - IsDockerDesktopExtention bool `json:"IsDockerDesktopExtention" example:"false"` + IsDockerDesktopExtension bool `json:"IsDockerDesktopExtension" example:"false"` } // @id SettingsPublic @@ -91,7 +91,7 @@ func generatePublicSettings(appSettings *portainer.Settings) *publicSettingsResp publicSettings.Edge.CommandInterval = appSettings.Edge.CommandInterval publicSettings.Edge.CheckinInterval = appSettings.EdgeAgentCheckinInterval - publicSettings.IsDockerDesktopExtention = appSettings.IsDockerDesktopExtention + publicSettings.IsDockerDesktopExtension = appSettings.IsDockerDesktopExtension //if OAuth authentication is on, compose the related fields from application settings if publicSettings.AuthenticationMethod == portainer.AuthenticationOAuth { diff --git a/api/jwt/jwt.go b/api/jwt/jwt.go index 4eddf58c2..07819f0b9 100644 --- a/api/jwt/jwt.go +++ b/api/jwt/jwt.go @@ -173,7 +173,7 @@ func (service *Service) generateSignedToken(data *portainer.TokenData, expiresAt return "", fmt.Errorf("failed fetching settings from db: %w", err) } - if settings.IsDockerDesktopExtention { + if settings.IsDockerDesktopExtension { // Set expiration to 99 years for docker desktop extension. log.Info().Msg("detected docker desktop extension mode") expiresAt = time.Now().Add(time.Hour * 8760 * 99).Unix() diff --git a/api/portainer.go b/api/portainer.go index de2d0340a..2e521ca13 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -968,7 +968,7 @@ type ( AllowDeviceMappingForRegularUsers bool `json:"AllowDeviceMappingForRegularUsers"` AllowContainerCapabilitiesForRegularUsers bool `json:"AllowContainerCapabilitiesForRegularUsers"` - IsDockerDesktopExtention bool `json:"IsDockerDesktopExtention"` + IsDockerDesktopExtension bool `json:"IsDockerDesktopExtension"` } // SnapshotJob represents a scheduled job that can create environment(endpoint) snapshots