Skip to content

Cumbersome usage of getResourceCondition due to 'Unknown' vs 'Unspecified' condition status values #461

@olvesh

Description

@olvesh

What happened?

I am trying to set the status via an annotation, like:

gotemplating.fn.crossplane.io/ready: {{ ( getResourceCondition "Ready" $resource).Status }}

but the status returned from the condition in Kubernetes is one of these legal values:

const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

while the legal values in funtion-go-templating is:

const (
	ReadyUnspecified Ready = "Unspecified"
	ReadyTrue        Ready = "True"
	ReadyFalse       Ready = "False"
)

This means we cannot easily "transport" values from the resource to the annotation, but have to have conditionals to map between Unknown and Unspecified, resulting in invalid function input: invalid "gotemplating.fn.crossplane.io/ready" annotation value "Unknown": must be True, False, or Unspecified

What environment did it happen in?

Function version: v0.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