Skip to content

Commit

Permalink
Add NamedObjectRef resource to common API (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
aupadhyay3 authored Nov 19, 2024
1 parent 5e1a2d7 commit 630889c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ func (t TypedObjectRef) ToCoreV1ObjectReference() *corev1.ObjectReference {
func (t TypedObjectRef) String() string {
return fmt.Sprintf("%s: %s", t.GroupVersionKind(), t.ObjectKey())
}

// NamedObjectRef references an object by name and optionally by namespace.
type NamedObjectRef struct {
// Name of the object. Required.
Name string `json:"name"`

// Namespace of the object. Optional. Defaulting behavior is determined by the parent API.
Namespace string `json:"namespace,omitempty"`
}

0 comments on commit 630889c

Please sign in to comment.