From d61e2c18b78f4c95e546fb8805be017f026c94cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 12 Aug 2024 16:53:56 +0200 Subject: [PATCH] remove runtime changes for OCIS_ENABLE_OCM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 1 + .vscode/launch.json | 1 + changelog/unreleased/add-enable-ocm-variable.md | 2 +- docs/ocis/development/testing.md | 5 ++++- ocis-pkg/config/config.go | 1 - ocis/pkg/runtime/service/service.go | 5 ----- tests/config/drone/.env-federation | 1 + 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.drone.star b/.drone.star index 97df8b23f..a93145542 100644 --- a/.drone.star +++ b/.drone.star @@ -145,6 +145,7 @@ config = { "skip": False, "federationServer": True, "extraServerEnvironment": { + "OCIS_ADD_RUN_SERVICES": "ocm", "OCIS_ENABLE_OCM": True, "OCM_OCM_INVITE_MANAGER_INSECURE": True, "OCM_OCM_SHARE_PROVIDER_INSECURE": True, diff --git a/.vscode/launch.json b/.vscode/launch.json index b98f49c6b..cbe767ab9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -94,6 +94,7 @@ "OCIS_LDAP_URI": "ldaps://localhost:10235", "OCIS_RUNTIME_PORT": "10250", "OCIS_URL": "https://federation-ocis-server:10200", + "OCIS_ADD_RUN_SERVICES": "ocm", "OCIS_ENABLE_OCM": "true", "APP_PROVIDER_DEBUG_ADDR": "127.0.0.1:10165", "APP_PROVIDER_GRPC_ADDR": "127.0.0.1:10164", diff --git a/changelog/unreleased/add-enable-ocm-variable.md b/changelog/unreleased/add-enable-ocm-variable.md index 409abdbb8..70e7ad709 100644 --- a/changelog/unreleased/add-enable-ocm-variable.md +++ b/changelog/unreleased/add-enable-ocm-variable.md @@ -1,5 +1,5 @@ Enhancement: Add OCIS_ENABLE_OCM env var -We added a new `OCIS_ENABLE_OCM` env var that will enable all ocm flags and add `ocm` to the services started by the runtime. +We added a new `OCIS_ENABLE_OCM` env var that will enable all ocm flags. https://github.com/owncloud/ocis/pull/9784 diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md index 97eabe459..7955b9b2d 100644 --- a/docs/ocis/development/testing.md +++ b/docs/ocis/development/testing.md @@ -558,6 +558,7 @@ OCIS_URL="https://ocis-server:9200" \ PROXY_ENABLE_BASIC_AUTH=true \ OCIS_ENABLE_OCM=true \ OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE="${workspaceFolder}/tests/config/drone/providers.json" \ +OCIS_ADD_RUN_SERVICES="ocm" \ ocis/bin/ocis server ``` @@ -579,7 +580,9 @@ ocis/bin/ocis server The second oCIS instance should be available at: https://federation-ocis-server:10200/ {{< hint info >}} -To enable ocm in the web interface, you need to set `OCIS_ENABLE_OCM=true`. It will enable all ocm flags and start the ocm service when running `ocis server`. +To enable ocm in the web interface, you need to set the following envs: +`OCIS_ENABLE_OCM="true"` +`OCIS_ADD_RUN_SERVICES="ocm"` {{< /hint>}} #### Run the Acceptance Test diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index a5cd63f3d..79926807f 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -56,7 +56,6 @@ type Runtime struct { Services []string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"A comma-separated list of service names. Will start only the listed services." introductionVersion:"pre5.0"` Disabled []string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"A comma-separated list of service names. Will start all default services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set." introductionVersion:"pre5.0"` Additional []string `yaml:"add_services" env:"OCIS_ADD_RUN_SERVICES" desc:"A comma-separated list of service names. Will add the listed services to the default configuration. Has no effect when OCIS_RUN_SERVICES is set. Note that one can add services not started by the default list and exclude services from the default list by using both envvars at the same time." introductionVersion:"pre5.0"` - EnableOCM bool `yaml:"enable_ocm" env:"OCIS_ENABLE_OCM" desc:"Enable all OCM config flags and start the ocm service." introductionVersion:"%%NEXT%%"` } // Config combines all available configuration parts. diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 89edf1a8b..311d6f7c1 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -473,11 +473,6 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) { runset[name] = struct{}{} } - // add ocm service if explicitly enabled by config - if cfg.Runtime.EnableOCM { - runset[cfg.OCM.Service.Name] = struct{}{} - } - // remove services if explicitly excluded by config for _, name := range cfg.Runtime.Disabled { delete(runset, name) diff --git a/tests/config/drone/.env-federation b/tests/config/drone/.env-federation index ca69c3554..760aed4cb 100644 --- a/tests/config/drone/.env-federation +++ b/tests/config/drone/.env-federation @@ -8,6 +8,7 @@ export OCIS_EVENTS_ENDPOINT=127.0.0.1:10233 export OCIS_LDAP_URI=ldaps://localhost:10235 export OCIS_RUNTIME_PORT=10250 export OCIS_URL=https://federation-ocis-server:10200 +export OCIS_ADD_RUN_SERVICES=ocm export OCIS_ENABLE_OCM=true export APP_PROVIDER_DEBUG_ADDR=127.0.0.1:10165 export APP_PROVIDER_GRPC_ADDR=127.0.0.1:10164