diff --git a/cmd/consoleplugin/main.go b/cmd/consoleplugin/main.go index da97effc..4276e6a7 100644 --- a/cmd/consoleplugin/main.go +++ b/cmd/consoleplugin/main.go @@ -9,9 +9,7 @@ import ( "time" toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" - "github.com/codeready-toolchain/member-operator/pkg/consoleplugin" "github.com/codeready-toolchain/member-operator/pkg/klog" - membercfg "github.com/codeready-toolchain/toolchain-common/pkg/configuration/memberoperatorconfig" "go.uber.org/zap/zapcore" corev1 "k8s.io/api/core/v1" @@ -19,8 +17,6 @@ import ( klogv1 "k8s.io/klog" klogv2 "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) @@ -79,11 +75,6 @@ func main() { setupLog.Info("Configuring web console plugin server ...") runtimeScheme := runtime.NewScheme() - cfg, err := config.GetConfig() - if err != nil { - setupLog.Error(err, "getting config failed") - os.Exit(1) - } if err := toolchainv1alpha1.AddToScheme(runtimeScheme); err != nil { setupLog.Error(err, "adding toolchain api to scheme failed") @@ -94,30 +85,7 @@ func main() { os.Exit(1) } - cl, err := client.New(cfg, client.Options{ - Scheme: runtimeScheme, - }) - if err != nil { - setupLog.Error(err, "creating a new client failed") - os.Exit(1) - } - - config, err := membercfg.GetConfiguration(cl) - if err != nil { - setupLog.Error(err, "Error retrieving Configuration") - os.Exit(1) - } - - pluginServer := startConsolePluginService(config.WebConsolePlugin()) - - gracefulShutdown(gracefulTimeout, pluginServer) -} - -func startConsolePluginService(config membercfg.WebConsolePluginConfig) *consoleplugin.Server { - consolePluginServer := consoleplugin.NewConsolePluginServer(config, setupLog) - consolePluginServer.Start() - - return consolePluginServer + gracefulShutdown(gracefulTimeout) } func gracefulShutdown(timeout time.Duration, hs ...shutdown) { diff --git a/config/crd/bases/toolchain.dev.openshift.com_memberoperatorconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_memberoperatorconfigs.yaml index 9b4fd15b..3d7ea329 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_memberoperatorconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_memberoperatorconfigs.yaml @@ -146,23 +146,6 @@ spec: description: Defines the timeout for each health check type: string type: object - webConsolePlugin: - description: WebConsolePlugin is used to configure the Web Console - Plugin parameters - properties: - deploy: - description: Deploy determines whether the plugin will be deployed - or not - type: boolean - pendoHost: - description: PendoHost allows a host URL to be configured instead - of communicating directly with the Pendo domain - type: string - pendoKey: - description: PendoKey is the key value used to interact with the - Pendo API - type: string - type: object webhook: description: Keeps parameters concerned with the webhook properties: diff --git a/controllers/memberoperatorconfig/memberoperatorconfig_controller.go b/controllers/memberoperatorconfig/memberoperatorconfig_controller.go index fe0b2a43..0b7a20aa 100644 --- a/controllers/memberoperatorconfig/memberoperatorconfig_controller.go +++ b/controllers/memberoperatorconfig/memberoperatorconfig_controller.go @@ -5,7 +5,6 @@ import ( "os" "github.com/codeready-toolchain/member-operator/pkg/autoscaler" - consoledeploy "github.com/codeready-toolchain/member-operator/pkg/consoleplugin/deploy" "github.com/codeready-toolchain/member-operator/pkg/webhook/deploy" "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/builder" @@ -65,10 +64,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl. return reconcile.Result{}, err } - if err := r.handleWebConsolePluginDeploy(ctx, crtConfig, request.Namespace); err != nil { - return reconcile.Result{}, err - } - return reconcile.Result{}, nil } @@ -116,19 +111,3 @@ func (r *Reconciler) handleWebhookDeploy(ctx context.Context, cfg membercfg.Conf } return nil } - -func (r *Reconciler) handleWebConsolePluginDeploy(ctx context.Context, cfg membercfg.Configuration, namespace string) error { - logger := log.FromContext(ctx) - - if cfg.WebConsolePlugin().Deploy() { - webconsolepluginImage := os.Getenv("MEMBER_OPERATOR_WEBCONSOLEPLUGIN_IMAGE") - logger.Info("(Re)Deploying web console plugin") - if err := consoledeploy.ConsolePlugin(ctx, r.Client, r.Client.Scheme(), namespace, webconsolepluginImage); err != nil { - return err - } - logger.Info("(Re)Deployed web console plugin") - } else { - logger.Info("Skipping deployment of web console plugin") - } - return nil -} diff --git a/controllers/memberoperatorconfig/memberoperatorconfig_controller_test.go b/controllers/memberoperatorconfig/memberoperatorconfig_controller_test.go index 4c16a5d6..b66fbac7 100644 --- a/controllers/memberoperatorconfig/memberoperatorconfig_controller_test.go +++ b/controllers/memberoperatorconfig/memberoperatorconfig_controller_test.go @@ -13,7 +13,6 @@ import ( membercfg "github.com/codeready-toolchain/toolchain-common/pkg/configuration/memberoperatorconfig" "github.com/codeready-toolchain/toolchain-common/pkg/test" testconfig "github.com/codeready-toolchain/toolchain-common/pkg/test/config" - errs "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -318,68 +317,6 @@ func TestHandleWebhookDeploy(t *testing.T) { }) } -func TestHandleWebConsolePluginDeploy(t *testing.T) { - t.Run("deployment not created when webconsoleplugin deploy is false", func(t *testing.T) { - // given - config := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().Deploy(false)) - controller, cl := prepareReconcile(t, config) - - actualConfig, err := membercfg.GetConfiguration(cl) - require.NoError(t, err) - - ctx := log.IntoContext(context.TODO(), controller.Log) - - // when - err = controller.handleWebConsolePluginDeploy(ctx, actualConfig, test.MemberOperatorNs) - - // then - require.NoError(t, err) - actualDeployment := &appsv1.Deployment{} - err = cl.Get(context.TODO(), test.NamespacedName(test.MemberOperatorNs, "member-operator-console-plugin"), actualDeployment) - require.Error(t, err) - require.True(t, errors.IsNotFound(err)) - }) - - t.Run("deployment created when webconsoleplugin deploy is true", func(t *testing.T) { - // given - config := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().Deploy(true)) - controller, cl := prepareReconcile(t, config) - actualConfig, err := membercfg.GetConfiguration(cl) - require.NoError(t, err) - - ctx := log.IntoContext(context.TODO(), controller.Log) - - // when - err = controller.handleWebConsolePluginDeploy(ctx, actualConfig, test.MemberOperatorNs) - - // then - require.NoError(t, err) - actualDeployment := &appsv1.Deployment{} - err = cl.Get(context.TODO(), test.NamespacedName(test.MemberOperatorNs, "member-operator-console-plugin"), actualDeployment) - require.NoError(t, err) - }) - - t.Run("deployment error", func(t *testing.T) { - // given - config := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().Deploy(true)) - controller, cl := prepareReconcile(t, config) - actualConfig, err := membercfg.GetConfiguration(cl) - require.NoError(t, err) - - ctx := log.IntoContext(context.TODO(), controller.Log) - - // when - cl.(*test.FakeClient).MockGet = func(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { - return fmt.Errorf("client error") - } - err = controller.handleWebConsolePluginDeploy(ctx, actualConfig, test.MemberOperatorNs) - - // then - require.ErrorContains(t, err, "cannot deploy console plugin template") - require.ErrorContains(t, errs.Cause(err), "client error") - }) -} - func prepareReconcile(t *testing.T, initObjs ...runtime.Object) (*Reconciler, client.Client) { os.Setenv("WATCH_NAMESPACE", test.MemberOperatorNs) restore := test.SetEnvVarAndRestore(t, "MEMBER_OPERATOR_WEBHOOK_IMAGE", "webhookimage") diff --git a/go.mod b/go.mod index a1d49397..a208cca8 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,10 @@ require ( sigs.k8s.io/controller-runtime v0.13.0 ) +replace github.com/codeready-toolchain/api => github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e + +replace github.com/codeready-toolchain/toolchain-common => github.com/xcoulon/toolchain-common v0.0.0-20240725145759-056fcf98e945 + require ( github.com/google/uuid v1.6.0 github.com/prometheus/client_golang v1.12.2 diff --git a/go.sum b/go.sum index 4c586700..3c31982f 100644 --- a/go.sum +++ b/go.sum @@ -134,10 +134,6 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20240717145630-bb67a632867a h1:La7GOCysmkU+4vnN8lDzXFJwJiA1LWZ9YkX/yQXYnpw= -github.com/codeready-toolchain/api v0.0.0-20240717145630-bb67a632867a/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240716065433-8604fe46b96a h1:HcaJtZCLfYkWZCxIa3iTvq3zgn711JGqPLkunBTfGSc= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240716065433-8604fe46b96a/go.mod h1:8M9k7w2VSyRKSK6P08Jo2ddW3uyGgxCcSitnYa3HK9o= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -587,6 +583,10 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e h1:6rYzVUcLeuVHmFjd7BU/Oe1SMsPrwdQgak2EYMz+oxM= +github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E= +github.com/xcoulon/toolchain-common v0.0.0-20240725145759-056fcf98e945 h1:s7dhWL8+zBI8+bIFzk0EATb6ASGlkA59PHSRvhhxeBc= +github.com/xcoulon/toolchain-common v0.0.0-20240725145759-056fcf98e945/go.mod h1:7o3ZyfqhV16N2Hc3P6j9lx0x6sLhQ0gaVl2cpGAz3ZE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= diff --git a/pkg/consoleplugin/consolepluginserver.go b/pkg/consoleplugin/consolepluginserver.go deleted file mode 100644 index fe5ab586..00000000 --- a/pkg/consoleplugin/consolepluginserver.go +++ /dev/null @@ -1,71 +0,0 @@ -package consoleplugin - -import ( - "context" - "net/http" - "os" - - "github.com/codeready-toolchain/member-operator/pkg/consoleplugin/contentserver" - membercfg "github.com/codeready-toolchain/toolchain-common/pkg/configuration/memberoperatorconfig" - - "github.com/go-logr/logr" - "k8s.io/utils/strings/slices" -) - -const ( - ConsolePluginServerOptionNoTLS = ServerOption("notls") -) - -type ServerOption string - -type Server struct { - mux *http.ServeMux - svr *http.Server - log logr.Logger - options []string -} - -func NewConsolePluginServer(config membercfg.WebConsolePluginConfig, log logr.Logger, - options ...ServerOption) *Server { - s := &Server{ - log: log, - } - - for _, opt := range options { - s.options = append(s.options, string(opt)) - } - - s.mux = http.NewServeMux() - ss := contentserver.NewContentServer(config) - s.mux.HandleFunc("/", ss.HandleContentRequest) - s.svr = &http.Server{ //nolint:gosec - Addr: ":9443", - Handler: s.mux, - } - - s.log.Info("Web Console Plugin server configured.") - return s -} - -func (s *Server) Start() { - go func() { - s.log.Info("Listening console plugin endpoint...") - - if slices.Contains(s.options, string(ConsolePluginServerOptionNoTLS)) { - if err := s.svr.ListenAndServe(); err != nil { - s.log.Error(err, "Listening and serving console plugin endpoint failed") - os.Exit(1) - } - return - } - - if err := s.svr.ListenAndServeTLS("/etc/consoleplugin/certs/tls.crt", "/etc/consoleplugin/certs/tls.key"); err != nil { - s.log.Error(err, "Listening and serving console plugin endpoint failed") - os.Exit(1) - } - }() -} - -func (s *Server) Shutdown(ctx context.Context) error { - return s.svr.Shutdown(ctx) -} diff --git a/pkg/consoleplugin/consolepluginserver_test.go b/pkg/consoleplugin/consolepluginserver_test.go deleted file mode 100644 index cdcec26f..00000000 --- a/pkg/consoleplugin/consolepluginserver_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package consoleplugin - -import ( - "io" - "net/http" - "strings" - "testing" - "time" - - membercfg "github.com/codeready-toolchain/toolchain-common/pkg/configuration/memberoperatorconfig" - - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/wait" - ctrl "sigs.k8s.io/controller-runtime" -) - -const ( - DefaultRetryInterval = time.Millisecond * 100 // make it short because a "retry interval" is waited before the first test - DefaultTimeout = time.Second * 30 -) - -func TestConsolePluginServer(t *testing.T) { - - log := ctrl.Log.WithName("test") - - cfg := membercfg.WebConsolePluginConfig{} - - s := NewConsolePluginServer(cfg, log, ConsolePluginServerOptionNoTLS) - - s.Start() - waitForReady(t) - - cl := http.Client{} - - // Confirm we get a not found for a bad request - resp, err := cl.Get("http://localhost:9443/foo") - require.NoError(t, err) - defer resp.Body.Close() - require.Equal(t, http.StatusNotFound, resp.StatusCode) - - // Confirm that the script server correctly returns its resources - resp, err = cl.Get("http://localhost:9443/plugin-entry.js") - require.NoError(t, err) - defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.Len(t, body, 2970) - require.True(t, strings.HasPrefix(string(body), "window.loadPluginEntry(\"toolchain-member-web-console-plugin@0.0.1\"")) -} - -func waitForReady(t *testing.T) { - cl := http.Client{} - - err := wait.Poll(DefaultRetryInterval, DefaultTimeout, func() (done bool, err error) { - req, err := http.NewRequest("GET", "http://localhost:9443/status", nil) - if err != nil { - return false, err - } - - resp, err := cl.Do(req) - defer func() { - if resp != nil { - _, _ = io.Copy(io.Discard, resp.Body) - _ = resp.Body.Close() - } - }() - if err != nil { - // We will ignore and try again until we don't get any error or timeout. - return false, nil // nolint:nilerr - } - - if resp.StatusCode != 200 { - return false, nil - } - - return true, nil - }) - require.NoError(t, err) -} diff --git a/pkg/consoleplugin/contentserver/contentserver.go b/pkg/consoleplugin/contentserver/contentserver.go deleted file mode 100644 index ed02e77a..00000000 --- a/pkg/consoleplugin/contentserver/contentserver.go +++ /dev/null @@ -1,119 +0,0 @@ -package contentserver - -import ( - "bytes" - "embed" - "net/http" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "strings" - "sync" -) - -var ( - log = logf.Log.WithName("web_console_content_server") -) - -//go:embed static/* -var staticFiles embed.FS - -type ContentServer interface { - HandleContentRequest(w http.ResponseWriter, r *http.Request) -} - -type Config interface { - PendoKey() string - PendoHost() string -} - -type contentServer struct { - config Config - rw sync.RWMutex - cache map[string][]byte -} - -func NewContentServer(config Config) ContentServer { - return &contentServer{ - config: config, - cache: map[string][]byte{}, - } -} - -func (s *contentServer) HandleContentRequest(w http.ResponseWriter, r *http.Request) { - var path string - if r.RequestURI == "/status" { - // Health status check. Use plugin-manifest.json as our health status endpoint but do not log the request to reduce noise in the logs. - path = "/plugin-manifest.json" - } else { - path = r.RequestURI - log.Info("Requesting...", "URI", path, "Method", r.Method) - } - - data, err := s.loadResource(path) - if err != nil { - w.WriteHeader(http.StatusNotFound) - log.Error(err, "error while loading resource", "URI", path, "Method", r.Method) - } - - var contentType string - if strings.HasSuffix(path, ".js") { - contentType = "application/javascript" - } else if strings.HasSuffix(path, ".json") { - contentType = "application/json" - } - if contentType != "" { - w.Header().Set("Content-Type", contentType) // Has to be set before calling w.WriteHeader()! - } - - if _, err := w.Write(data); err != nil { - w.WriteHeader(http.StatusInternalServerError) - log.Error(err, "unable to write response", "URI", path, "Method", r.Method) - } - - if r.RequestURI != "/status" { - log.Info("OK", "URI", path, "Method", r.Method, "Content-Type", w.Header().Get("Content-Type")) - } -} - -func (s *contentServer) loadResource(path string) ([]byte, error) { - data := s.loadResourceFromCache(path) - if data != nil { - return data, nil - } - - return s.validateCachedResource(path) -} - -func (s *contentServer) loadResourceFromCache(path string) []byte { - s.rw.RLock() - defer s.rw.RUnlock() - - if val, ok := s.cache[path]; ok { - return val - } - - return nil -} - -func (s *contentServer) validateCachedResource(path string) ([]byte, error) { - s.rw.Lock() - defer s.rw.Unlock() - - fileData, err := staticFiles.ReadFile("static" + path) - if err != nil { - return nil, err - } - - transformed := s.insertPendoKey(fileData, s.config.PendoKey()) - transformed = s.insertPendoHost(transformed, s.config.PendoHost()) - s.cache[path] = transformed - - return transformed, nil -} - -func (s *contentServer) insertPendoKey(content []byte, key string) []byte { - return bytes.Replace(content, []byte("{PENDO_KEY}"), []byte(key), -1) -} - -func (s *contentServer) insertPendoHost(content []byte, host string) []byte { - return bytes.Replace(content, []byte("{PENDO_HOST}"), []byte(host), -1) -} diff --git a/pkg/consoleplugin/contentserver/contentserver_test.go b/pkg/consoleplugin/contentserver/contentserver_test.go deleted file mode 100644 index 15373a4c..00000000 --- a/pkg/consoleplugin/contentserver/contentserver_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package contentserver_test - -import ( - "github.com/codeready-toolchain/member-operator/pkg/consoleplugin/contentserver" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" -) - -var ( - DefaultConfig = NewContentServerTestConfig("ABC", "cdn.pendo.io") -) - -type ContentServerTestConfig struct { - pendoKey string - pendoHost string -} - -func (c *ContentServerTestConfig) PendoKey() string { - return c.pendoKey -} - -func (c *ContentServerTestConfig) PendoHost() string { - return c.pendoHost -} - -func NewContentServerTestConfig(pendoKey, pendoHost string) *ContentServerTestConfig { - return &ContentServerTestConfig{ - pendoKey: pendoKey, - pendoHost: pendoHost, - } -} - -func TestContentServer(t *testing.T) { - s := contentserver.NewContentServer(NewContentServerTestConfig("9473265123", "cdn.pendo.io")) - - body := handleScriptRequest(t, s, "/plugin-manifest.json") - require.Len(t, body, 397) - require.True(t, strings.HasPrefix(body, "{\n \"name\": \"toolchain-member-web-console-plugin\",")) - require.True(t, strings.HasSuffix(strings.TrimSpace(body), "}")) - - body = handleScriptRequest(t, s, "/plugin-entry.js") - require.Len(t, body, 2970) - require.True(t, strings.HasPrefix(body, "window.loadPluginEntry(")) -} - -func TestHealthStatusEndpoint(t *testing.T) { - s := contentserver.NewContentServer(DefaultConfig) - - status := handleScriptRequest(t, s, "/status") - pluginManifest := handleScriptRequest(t, s, "/plugin-manifest.json") - - assert.NotEmpty(t, status) - assert.Equal(t, status, pluginManifest) -} - -func handleScriptRequest(t *testing.T, server contentserver.ContentServer, path string) string { - req := httptest.NewRequest("GET", path, nil) - resp := httptest.NewRecorder() - - server.HandleContentRequest(resp, req) - - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - - assert.Equal(t, http.StatusOK, resp.Code) - return string(body) -} diff --git a/pkg/consoleplugin/contentserver/static/exposed-pendo-chunk-f2af9c769b1e3ced0c21.min.js b/pkg/consoleplugin/contentserver/static/exposed-pendo-chunk-f2af9c769b1e3ced0c21.min.js deleted file mode 100644 index e675ccc8..00000000 --- a/pkg/consoleplugin/contentserver/static/exposed-pendo-chunk-f2af9c769b1e3ced0c21.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunktoolchain_member_web_console_plugin=self.webpackChunktoolchain_member_web_console_plugin||[]).push([[484],{248:(n,t,e)=>{e.r(t),e.d(t,{default:()=>d}),function(n,t,e,i,o){var a,s,c,d,l;for((o=n[i]=n[i]||{})._q=o._q||[],s=0,c=(a=["initialize","identify","updateOptions","pageLoad","track"]).length;s{if("identify"===n){const{user:n}=t;if(n){const t=n.metadata.annotations?.[o],e=n.metadata.annotations?.[a],i=n.metadata.annotations?.[s],d=i?.match(/@(.+)/)?.[1];t&&window.pendo&&(window.pendo[c?"identify":"initialize"]({visitor:{id:t,...d?{email_domain:d}:{}},...e?{account:{id:e}}:null}),c=!0)}}}}}]); \ No newline at end of file diff --git a/pkg/consoleplugin/contentserver/static/plugin-entry.js b/pkg/consoleplugin/contentserver/static/plugin-entry.js deleted file mode 100644 index d40e4efd..00000000 --- a/pkg/consoleplugin/contentserver/static/plugin-entry.js +++ /dev/null @@ -1 +0,0 @@ -window.loadPluginEntry("toolchain-member-web-console-plugin@0.0.1",(()=>{"use strict";var e,r,o={58:(e,r,o)=>{var t={pendo:()=>o.e(484).then((()=>()=>o(248)))},n=(e,r)=>(o.R=r,r=o.o(t,e)?t[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),o.R=void 0,r),i=(e,r)=>{if(o.S){var t="default",n=o.S[t];if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return o.S[t]=e,o.I(t,r)}};o.d(r,{get:()=>n,init:()=>i})}},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var i=t[e]={exports:{}};return o[e](i,i.exports,n),i.exports}return n.m=o,n.c=t,n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,o)=>(n.f[o](e,r),r)),[])),n.u=e=>"exposed-pendo-chunk-f2af9c769b1e3ced0c21.min.js",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="toolchain-member-web-console-plugin:",n.l=(o,t,i,a)=>{if(e[o])e[o].push(t);else{var l,u;if(void 0!==i)for(var d=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[o];if(delete e[o],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(t))),r)return r(t)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{n.S={};var e={},r={};n.I=(o,t)=>{t||(t=[]);var i=r[o];if(i||(i=r[o]={}),!(t.indexOf(i)>=0)){if(t.push(i),e[o])return e[o];n.o(n.S,o)||(n.S[o]={}),n.S[o];var a=[];return e[o]=a.length?Promise.all(a).then((()=>e[o]=1)):1}}})(),n.p="/api/plugins/toolchain-member-web-console-plugin/",(()=>{var e={754:0};n.f.j=(r,o)=>{var t=n.o(e,r)?e[r]:void 0;if(0!==t)if(t)o.push(t[2]);else{var i=new Promise(((o,n)=>t=e[r]=[o,n]));o.push(t[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(o=>{if(n.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var i=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;l.message="Loading chunk "+r+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,t[1](l)}}),"chunk-"+r,r)}};var r=(r,o)=>{var t,i,[a,l,u]=o,d=0;if(a.some((r=>0!==e[r]))){for(t in l)n.o(l,t)&&(n.m[t]=l[t]);u&&u(n)}for(r&&r(o);d