stackabletech / stackabletech/secret-operator

k8sSearch with a fixed searchNamespace doesn't separate services and pods by namespace

Open
#307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Rust
Stars
13
Forks
8
Avg merge
1d 8h
Merged PRs (30d)
10

Description

Affected version

23.7

Current and expected behavior

When using a SecretClass with a fixed searchNamespace, such as the following:

apiVersion: secrets.stackable.tech/v1alpha1
kind: SecretClass
metadata:
  name: tls-manual
spec:
  backend:
    k8sSearch:
      searchNamespace:
        name: foo

then the service=bar scope will always search for a secret with the label secrets.stackable.tech/service=bar, with no way for the user to separate which namespace the secret should apply to.

This technically applies to all scopes, but node doesn't imply any namespaced behaviour.

Possible solution
  1. Change the format of namespace-specific labels to <name>.<namespace>.
  2. Add a new label secrets.stackable.tech/namespace=<namespace>.

Either change would be breaking. We could mitigate this by adding an opt-in property to SecretClass that enables the namespace. It could be made opt-out in v1alpha2.

Alternatively, we could declare that fixed searchNs was always unusably broken, and that it isn't worth maintaining the old behaviour at all.

Additional context

No response

Environment

No response

Would you like to work on fixing this bug?

None

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the SecretClass k8sSearch behavior for fixed searchNamespace and the service and pod scopes. Compare the two proposed namespace-label formats and determine how SecretClass compatibility or migration would work. Done means namespaces are separated reliably without leaving the breaking behavior unresolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, rust
Domain
infrastructure, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.