Skip to content

Accurate doesn't create a new namespace after resolving an issue with conflicting namespaces #168

@bendikp

Description

@bendikp

Describe the bug
If you have two SubNamespaces with the same name, you get a conflict. When you delete the SubNamespace "owning" the namespace, the namespace is deleted, but a new namespace isn't created. And the remaining SubNamespace is left in "Stalled" status condition. A restart of the accurate controller fixes the issue and the namespace is created, but it would be nice that this happened without manually intervention (I guess I could have waited for the next reconcile loop, but I was impatient).

Environments

  • Version: accurate v1.7.1
  • OS: OpenShift v4.18/k8s v1.31

To Reproduce
Steps to reproduce the behavior:

  1. Create two SubNamespaces with the same name. One of the SubNamespaces gets a Stalled status condition.
$ k get subnamespaces -A -o custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,STALLED_MESSAGE:.status.conditions[?(@.type=='Stalled')].message"
NAMESPACE         NAME                        STALLED_MESSAGE
stas-acme-test    stas-bendik-test-accurate   <none>
stas-vault-test   stas-bendik-test-accurate   Conflicting namespace already exists
  1. Delete the SubNamespace that is not in a Stalled condition.
$ k delete subnamespace stas-bendik-test-accurate -n stas-acme-test
subnamespace.accurate.cybozu.com "stas-bendik-test-accurate" deleted
  1. Observe that the corresponding namespace is deleted and not created again by the SubNamespace i Stalled condition.
$ k get namespace stas-bendik-test-accurate
Error from server (NotFound): namespaces "stas-bendik-test-accurate" not found
$ k get subnamespaces -A -o custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,STALLED_MESSAGE:.status.conditions[?(@.type=='Stalled')].message"
NAMESPACE         NAME                        STALLED_MESSAGE
stas-vault-test   stas-bendik-test-accurate   Conflicting namespace already exists

Expected behavior
I would expect Accurate to immediately create the namespace again after deleting the SubNamespace that was not in a Stalled condition.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions