Skip to content

Commit 296e68d

Browse files
committed
Remove secretLabels option from k8sSearch backend (#123)
## Description This never had any real purpose, since we always add the name of the `SecretClass` as a required label anyway.
1 parent 5c48098 commit 296e68d

File tree

9 files changed

+14
-34
lines changed

9 files changed

+14
-34
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ All notable changes to this project will be documented in this file.
1010

1111
### Changed
1212

13-
- autoTls CA generation now requires opt-in ([#77]).
13+
- `autoTls` CA generation now requires opt-in ([#77]).
1414
- The default `tls` `SecretClass` now has this opt-in by default.
15+
16+
### Removed
17+
18+
- `k8sSearch` backend's option `secretLabels` has been removed ([#123]).
1519

1620
[#77]: https://github.com/stackabletech/secret-operator/pull/77
1721
[#114]: https://github.com/stackabletech/secret-operator/pull/114
22+
[#123]: https://github.com/stackabletech/secret-operator/pull/123
1823
[commons-#20]: https://github.com/stackabletech/commons-operator/pull/20
1924

2025
## [0.2.0] - 2022-02-14

deploy/helm/secret-operator/crds/crds.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ spec:
6868
pod:
6969
type: object
7070
type: object
71-
secretLabels:
72-
additionalProperties:
73-
type: string
74-
default: {}
75-
type: object
7671
required:
7772
- searchNamespace
7873
type: object

deploy/manifests/crds.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ spec:
6969
pod:
7070
type: object
7171
type: object
72-
secretLabels:
73-
additionalProperties:
74-
type: string
75-
default: {}
76-
type: object
7772
required:
7873
- searchNamespace
7974
type: object

docs/modules/ROOT/examples/secretclass-tls.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ spec:
1717
pod: {}
1818
# or...
1919
name: my-namespace
20-
secretLabels:
21-
type: custom-secret

docs/modules/ROOT/pages/secretclass.adoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ spec:
7979
pod: {}
8080
# or...
8181
name: my-namespace
82-
secretLabels:
83-
type: custom-secret
8482
----
8583

8684
`k8sSearch`:: Declares that the `k8sSearch` backend is used.
@@ -89,7 +87,6 @@ spec:
8987
for secrets that are provisioned by the application administrator.
9088
`k8sSearch.searchNamespace.name`:: The `Secret` objects are located in a single global namespace. Should be used for secrets
9189
that are provisioned by the cluster administrator.
92-
`k8sSearch.secretLabels`:: Extra labels that are required for a `Secret` to be bound.
9390

9491
[#format]
9592
== Format

examples/simple-consumer-shell.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ spec:
4343
k8sSearch:
4444
searchNamespace:
4545
pod: {}
46-
secretLabels:
47-
type: custom-secret
4846
---
4947
# A Secret that matches SecretClass/secret, for the Node kind-control-plane
5048
apiVersion: v1

rust/operator-binary/src/backend/dynamic.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ pub async fn from_class(
6868
class: SecretClass,
6969
) -> Result<Box<Dynamic>, FromClassError> {
7070
Ok(match class.spec.backend {
71-
crd::SecretClassBackend::K8sSearch(crd::K8sSearchBackend {
72-
search_namespace,
73-
secret_labels,
74-
}) => from(super::K8sSearch {
75-
client: client.clone(),
76-
search_namespace,
77-
secret_labels,
78-
}),
71+
crd::SecretClassBackend::K8sSearch(crd::K8sSearchBackend { search_namespace }) => {
72+
from(super::K8sSearch {
73+
client: client.clone(),
74+
search_namespace,
75+
})
76+
}
7977
crd::SecretClassBackend::AutoTls(crd::AutoTlsBackend {
8078
ca:
8179
crd::AutoTlsCa {

rust/operator-binary/src/backend/k8s_search.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ impl SecretBackendError for Error {
4343
pub struct K8sSearch {
4444
pub client: stackable_operator::client::Client,
4545
pub search_namespace: SearchNamespace,
46-
pub secret_labels: BTreeMap<String, String>,
4746
}
4847

4948
#[async_trait]
@@ -55,11 +54,10 @@ impl SecretBackend for K8sSearch {
5554
selector: &SecretVolumeSelector,
5655
pod_info: PodInfo,
5756
) -> Result<SecretContents, Self::Error> {
58-
let mut label_selector = self.secret_labels.clone();
59-
label_selector.insert(
57+
let mut label_selector = BTreeMap::from([(
6058
"secrets.stackable.tech/class".to_string(),
6159
selector.class.to_string(),
62-
);
60+
)]);
6361
for scope in &selector.scope {
6462
match scope {
6563
SecretScope::Node => {

rust/operator-binary/src/crd.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::collections::BTreeMap;
2-
31
use serde::{Deserialize, Serialize};
42
use stackable_operator::k8s_openapi::api::core::v1::SecretReference;
53
use stackable_operator::kube::CustomResource;
@@ -32,8 +30,6 @@ pub enum SecretClassBackend {
3230
#[serde(rename_all = "camelCase")]
3331
pub struct K8sSearchBackend {
3432
pub search_namespace: SearchNamespace,
35-
#[serde(default)]
36-
pub secret_labels: BTreeMap<String, String>,
3733
}
3834

3935
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]

0 commit comments

Comments
 (0)