Skip to content

Usages between ClusterScope Compositions and Namespaces resources #114

@jkroepke

Description

@jkroepke

What happened?

If a Composition is closter scoped and created a namespaces scoped resource, a ClusterUsage will be created (thats correct), but the spec.by resources is missing a namespace. This results into unready usages, because of the missing namespace field for namespace scoped resources.

Ref: Missing check, if resource is namespaced:

function-sequencer/fn.go

Lines 233 to 255 in 7759428

usage := map[string]any{
"apiVersion": ProtectionGroupVersion,
"kind": usageType,
"metadata": usageMeta,
"spec": map[string]any{
"by": map[string]any{
"apiVersion": by.GetAPIVersion(),
"kind": by.GetKind(),
"resourceRef": map[string]any{
"name": by.GetName(),
},
},
"of": map[string]any{
"apiVersion": of.GetAPIVersion(),
"kind": of.GetKind(),
"resourceRef": map[string]any{
"name": of.GetName(),
},
},
"reason": DependencyReason,
"replayDeletion": rd,
},
}

How can we reproduce it?

Create a composition (cluster-scoped) which created namespace scoped resource and configure a sequence between it. (create cluster scoped namespace first, than a namesapce scoped configmap)

What environment did it happen in?

Function version: 0.5.0

Metadata

Metadata

Assignees

No one assigned

    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