diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index 6fe268c4d..f2114e466 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -1,5 +1,5 @@ /* -Copyright 2019-2023 The Tekton Authors +Copyright 2019-2024 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -35,7 +35,6 @@ var ( portNumber = flag.Int("port", 8080, "Dashboard port number") readOnly = flag.Bool("read-only", true, "Enable or disable read-only mode") logoutURL = flag.String("logout-url", "", "If set, enables logout on the frontend and binds the logout button to this url") - tenantNamespace = flag.String("namespace", "", "Deprecated: use --namespaces instead. If set, limits the scope of resources displayed to this namespace only") tenantNamespaces = flag.String("namespaces", "", "If set, limits the scope of resources displayed to this comma-separated list of namespaces only") logLevel = flag.String("log-level", "info", "Minimum log level output by the logger") logFormat = flag.String("log-format", "json", "Format for log output (json or console)") @@ -80,10 +79,6 @@ func main() { logging.Log.Errorf("Error building k8s clientset: %s", err.Error()) } - if *tenantNamespace != "" { - logging.Log.Warn("DEPRECATION NOTICE: --namespace arg is deprecated, use --namespaces instead") - } - // use FieldsFunc instead of Split as Split returns an array containing an empty string // instead of the desired empty array when there is no delimeter (i.e. empty string or single namespace) splitByComma := func(c rune) bool { @@ -95,7 +90,6 @@ func main() { InstallNamespace: installNamespace, PipelinesNamespace: *pipelinesNamespace, TriggersNamespace: *triggersNamespace, - TenantNamespace: *tenantNamespace, TenantNamespaces: tenants, ReadOnly: *readOnly, LogoutURL: *logoutURL, diff --git a/docs/dev/README.md b/docs/dev/README.md index a7470c43c..3359ec50b 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -104,14 +104,13 @@ These options are documented below: | `--port` | Dashboard port number | `int` | `8080` | | `--read-only` | Enable or disable read-only mode | `bool` | `true` | | `--logout-url` | If set, enables logout on the frontend and binds the logout button to this url | `string` | `""` | -| `--namespace` | Deprecated: use --namespaces instead. If set, limits the scope of resources displayed to this namespace only | `string` | `""` | | `--namespaces` | If set, limits the scope of resources displayed to this comma-separated list of namespaces only | `string` | `""` | | `--log-level` | Minimum log level output by the logger | `string` | `"info"` | | `--log-format` | Format for log output (json or console) | `string` | `"json"` | Run `dashboard --help` to show the supported command line arguments and their default values directly from the `dashboard` binary. -**Important note:** using `--namespace` or `--namespaces` provides this list of namespaces to the frontend, but does not limit actions that can be performed to just these namespaces. It's important when these flags are used that RBAC rules are setup accordingly. +**Important note:** using `--namespaces` provides this list of namespaces to the frontend, but does not limit actions that can be performed to just these namespaces. It's important when this flag is used that RBAC rules are setup accordingly. ## Build and deploy with the installer script diff --git a/docs/dev/installer.md b/docs/dev/installer.md index 51b1f8d0f..037dabab5 100644 --- a/docs/dev/installer.md +++ b/docs/dev/installer.md @@ -74,7 +74,6 @@ Accepted options: [--read-write] Will build manifests for a read/write deployment [--stream-logs false] Will disable log streaming and use polling instead [--tag ] Tag used for the image produced by ko - [--tenant-namespace ] [DEPRECATED: use tenant-namespaces instead] Will limit the visibility to the specified namespace only [--tenant-namespaces ] Will limit the visibility to the specified comma-separated namespaces only [--triggers-namespace ] Override the namespace where Tekton Triggers is installed (defaults to Dashboard install namespace) [--version ] Will download manifests for specified version or build everything using kustomize/ko @@ -131,16 +130,16 @@ To install the Dashboard add the `--read-write` option when calling the `install ./scripts/installer install --read-write ``` -### Installing for single namespace visibility +### Installing for limited namespace visibility -Single namespace visibility restricts the Tekton Dashboard actions scope and resources that can be seen to a single namespace in the cluster. +Limited namespace visibility restricts the Tekton Dashboard actions scope and resources that can be seen to a subset of namespaces in the cluster. -To install for single namespace visibility run the following command: +To install for limited namespace visibility run the following command: ```bash -TENANT_NAMESPACE=my-namespace +TENANT_NAMESPACES=my-namespace1,my-namespace2 -./scripts/installer install --tenant-namespace $TENANT_NAMESPACE +./scripts/installer install --tenant-namespaces $TENANT_NAMESPACES ``` ### Install ingress diff --git a/overlays/patches/installer/deployment-patch.yaml b/overlays/patches/installer/deployment-patch.yaml index 737864e57..92fdda19f 100644 --- a/overlays/patches/installer/deployment-patch.yaml +++ b/overlays/patches/installer/deployment-patch.yaml @@ -1,4 +1,4 @@ -# Copyright 2020-2023 The Tekton Authors +# Copyright 2020-2024 The Tekton Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,10 +37,6 @@ path: /spec/template/spec/containers/0/args/- value: --log-format=--log-format -- op: add - path: /spec/template/spec/containers/0/args/- - value: - --namespace=--tenant-namespace - op: add path: /spec/template/spec/containers/0/args/- value: diff --git a/pkg/endpoints/cluster.go b/pkg/endpoints/cluster.go index 1d1ab6d45..7da46be83 100644 --- a/pkg/endpoints/cluster.go +++ b/pkg/endpoints/cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2019-2023 The Tekton Authors +Copyright 2019-2024 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -30,7 +30,6 @@ type Properties struct { PipelineVersion string `json:"pipelinesVersion"` ReadOnly bool `json:"isReadOnly"` StreamLogs bool `json:"streamLogs"` - TenantNamespace string `json:"tenantNamespace,omitempty"` TenantNamespaces []string `json:"tenantNamespaces,omitEmpty"` TriggersNamespace string `json:"triggersNamespace,omitempty"` TriggersVersion string `json:"triggersVersion,omitempty"` @@ -52,7 +51,6 @@ func (r Resource) GetProperties(response http.ResponseWriter, _ *http.Request) { PipelineVersion: pipelineVersion, ReadOnly: r.Options.ReadOnly, LogoutURL: r.Options.LogoutURL, - TenantNamespace: r.Options.TenantNamespace, TenantNamespaces: r.Options.TenantNamespaces, StreamLogs: r.Options.StreamLogs, } diff --git a/pkg/endpoints/types.go b/pkg/endpoints/types.go index e692c3e5c..40ffbc8ba 100644 --- a/pkg/endpoints/types.go +++ b/pkg/endpoints/types.go @@ -1,5 +1,5 @@ /* -Copyright 2019-2023 The Tekton Authors +Copyright 2019-2024 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -23,7 +23,6 @@ type Options struct { InstallNamespace string PipelinesNamespace string TriggersNamespace string - TenantNamespace string TenantNamespaces []string ReadOnly bool LogoutURL string diff --git a/scripts/installer b/scripts/installer index a39556843..360d174e8 100755 --- a/scripts/installer +++ b/scripts/installer @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2021-2023 The Tekton Authors +# Copyright 2021-2024 The Tekton Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -172,7 +172,6 @@ patch() { replace "--log-format=--log-format" "--log-format=$LOG_FORMAT" replace "--logout-url=--logout-url" "--logout-url=$LOGOUT_URL" replace "--read-only=--read-only" "--read-only=$READONLY" - replace "--namespace=--tenant-namespace" "--namespace=" replace "--namespaces=--tenant-namespaces" "--namespaces=$TENANT_NAMESPACES" replace "--stream-logs=--stream-logs" "--stream-logs=$STREAM_LOGS" replace "--external-logs=--external-logs" "--external-logs=$EXTERNAL_LOGS" @@ -406,7 +405,6 @@ help () { echo -e "\t[--read-write]\t\t\t\tWill build manifests for a read/write deployment" echo -e "\t[--stream-logs false]\t\t\tWill disable log streaming and use polling instead" echo -e "\t[--tag ]\t\t\t\tTag used for the image produced by ko" - echo -e "\t[--tenant-namespace ]\t[DEPRECATED: use tenant-namespaces instead] Will limit the visibility to the specified namespace only" echo -e "\t[--tenant-namespaces ]\tWill limit the visibility to the specified comma-separated namespaces only" echo -e "\t[--triggers-namespace ]\tOverride the namespace where Tekton Triggers is installed (defaults to Dashboard install namespace)" echo -e "\t[--version ]\t\t\tWill download manifests for specified version or build everything using kustomize/ko" @@ -505,11 +503,6 @@ while [[ $# -gt 0 ]]; do shift OVERRIDE_TRIGGERS_NAMESPACE="${1}" ;; - '--tenant-namespace') - warning "--tenant-namespace is deprecated, use --tenant-namespaces instead" - shift - TENANT_NAMESPACES="${1}" - ;; '--tenant-namespaces') shift TENANT_NAMESPACES="${1}" diff --git a/src/api/index.js b/src/api/index.js index 8f01f0e56..a6b72c6f4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,5 @@ /* -Copyright 2019-2023 The Tekton Authors +Copyright 2019-2024 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -338,11 +338,5 @@ export function useLogoutURL() { export function useTenantNamespaces() { const { data } = useProperties(); - if (data.tenantNamespace) { - return [data.tenantNamespace]; - } - if (data.tenantNamespaces) { - return data.tenantNamespaces; - } - return []; + return data.tenantNamespaces || []; } diff --git a/src/api/index.test.js b/src/api/index.test.js index 233439fb5..820f754eb 100644 --- a/src/api/index.test.js +++ b/src/api/index.test.js @@ -1,5 +1,5 @@ /* -Copyright 2019-2023 The Tekton Authors +Copyright 2019-2024 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -516,7 +516,7 @@ it('other hooks that depend on useProperties', async () => { isReadOnly, logoutURL, streamLogs, - tenantNamespace, + tenantNamespaces: [tenantNamespace], triggersNamespace, triggersVersion };