[controller,api] Refactor tenant resource label

This patch refactors the secret selectors to use the
`internal.cozystack.io/tenantresource` label for managing secret
visibility and removes any selectors based on it or the previous
`apps.cozystack.io/tenantresource` label, the idea being that this label
will only ever be set by the controller.

```
[controller,api] Refactor labels for the secret selector.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin
2025-10-01 13:24:37 +03:00
parent 66004c83e2
commit c16e37e079
11 changed files with 17 additions and 22 deletions

View File

@@ -0,0 +1,4 @@
package v1alpha1
const TenantResourceLabelKey = "internal.cozystack.io/tenantresource"
const TenantResourceLabelValue = "true"

View File

@@ -55,7 +55,7 @@ var (
// Define constants for label filtering
const (
TenantModuleLabelKey = "apps.cozystack.io/tenantmodule"
TenantModuleLabelKey = "internal.cozystack.io/tenantmodule"
TenantModuleLabelValue = "true"
singularName = "tenantmodule"
)

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// TenantSecret registry namespaced view over Secrets labelled
// "internal.cozystack.io/tenantsecret=true". Internal tenant secret labels are hidden.
// "internal.cozystack.io/tenantresource=true". Internal tenant secret labels are hidden.
package tenantsecret
@@ -35,8 +35,8 @@ import (
// -----------------------------------------------------------------------------
const (
tsLabelKey = "apps.cozystack.io/tenantresource"
tsLabelValue = "true"
tsLabelKey = corev1alpha1.TenantResourceLabelKey
tsLabelValue = corev1alpha1.TenantResourceLabelValue
singularName = "tenantsecret"
kindTenantSecret = "TenantSecret"
kindTenantSecretList = "TenantSecretList"

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// TenantSecretsTable registry namespaced, read-only flattened view over
// Secrets labelled "internal.cozystack.io/tenantsecret=true". Each data key is a separate object.
// Secrets labelled "internal.cozystack.io/tenantresource=true". Each data key is a separate object.
package tenantsecretstable
@@ -29,8 +29,8 @@ import (
)
const (
tsLabelKey = "apps.cozystack.io/tenantresource"
tsLabelValue = "true"
tsLabelKey = corev1alpha1.TenantResourceLabelKey
tsLabelValue = corev1alpha1.TenantResourceLabelValue
kindObj = "TenantSecretsTable"
kindObjList = "TenantSecretsTableList"
singularName = "tenantsecretstable"