An external object reference can be used to reference an object that is not part of the Bundle being processed.
When using plugins, sometimes it is necessary to invoke the plugin with an object that is not part of the Bundle being processed. A reference can be used to make Smith fetch an external object and pass it to the plugin.
References can only reference objects inside of the same namespace (namespaced references) or non-namespaced objects (cluster references).
To reference an object in the same namespace, its name, group, version and kind are needed. Example:
apiVersion: smith.atlassian.com/v1
kind: Bundle
metadata:
name: b1
namespace: namespace123
spec:
resources:
- name: extra-ref
spec:
reference:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
name: binding1
To reference a non-namespaced object, its name, group, version and kind are needed. Example:
apiVersion: smith.atlassian.com/v1
kind: Bundle
metadata:
name: b2
namespace: namespace123
spec:
resources:
- name: cluster-extra-ref
spec:
clusterReference:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
name: binding2