You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: staging/src/k8s.io/api/core/v1/types.go
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6779,13 +6779,23 @@ type ObjectReference struct {
6779
6779
6780
6780
// LocalObjectReference contains enough information to let you locate the
6781
6781
// referenced object inside the same namespace.
6782
+
// ---
6783
+
// New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs.
6784
+
// 1. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular
6785
+
// restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted".
6786
+
// Those cannot be well described when embedded.
6787
+
// 2. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen.
6788
+
// 3. We cannot easily change it. Because this type is embedded in many locations, updates to this type
6789
+
// will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control.
6790
+
//
6791
+
// Instead of using this type, create a locally provided and used type that is well-focused on your reference.
6792
+
// For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
6782
6793
// +structType=atomic
6783
6794
typeLocalObjectReferencestruct {
6784
6795
// Name of the referent.
6785
6796
// This field is effectively required, but due to backwards compatibility is
6786
6797
// allowed to be empty. Instances of this type with an empty value here are
6787
6798
// almost certainly wrong.
6788
-
// TODO: Add other useful fields. apiVersion, kind, uid?
6789
6799
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
6790
6800
// +optional
6791
6801
// +default=""
@@ -6796,6 +6806,20 @@ type LocalObjectReference struct {
6796
6806
6797
6807
// TypedLocalObjectReference contains enough information to let you locate the
6798
6808
// typed referenced object inside the same namespace.
6809
+
// ---
6810
+
// New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs.
6811
+
// 1. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular
6812
+
// restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted".
6813
+
// Those cannot be well described when embedded.
6814
+
// 2. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen.
6815
+
// 3. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity
6816
+
// during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple
6817
+
// and the version of the actual struct is irrelevant.
6818
+
// 4. We cannot easily change it. Because this type is embedded in many locations, updates to this type
6819
+
// will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control.
6820
+
//
6821
+
// Instead of using this type, create a locally provided and used type that is well-focused on your reference.
6822
+
// For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .
6799
6823
// +structType=atomic
6800
6824
typeTypedLocalObjectReferencestruct {
6801
6825
// APIGroup is the group for the resource being referenced.
0 commit comments