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
// SchemaReference is a reference to another schema in the registry
40
+
// SchemaReference is a reference to another schema in the registry.
41
+
// Exactly one of {subject+version} or kafkaSchemaRef must be set.
42
+
// +kubebuilder:validation:XValidation:rule="(has(self.subject) && has(self.version) && !has(self.kafkaSchemaRef)) || (!has(self.subject) && !has(self.version) && has(self.kafkaSchemaRef))",message="set both subject and version, or set kafkaSchemaRef, but not both"
36
43
typeSchemaReferencestruct {
37
44
// +kubebuilder:validation:MinLength=1
45
+
// +kubebuilder:validation:MaxLength=512
38
46
// Name used to reference the schema (e.g., the import path in Protobuf)
39
47
Namestring`json:"name"`
40
48
41
49
// +kubebuilder:validation:MinLength=1
42
-
// Subject name of the referenced schema in the registry
43
-
Subjectstring`json:"subject"`
50
+
// +kubebuilder:validation:MaxLength=512
51
+
// Subject name of the referenced schema in the registry. Mutually exclusive with kafkaSchemaRef.
52
+
// +optional
53
+
Subjectstring`json:"subject,omitempty"`
44
54
45
55
// +kubebuilder:validation:Minimum=1
46
-
// Version of the referenced schema
47
-
Versionint`json:"version"`
56
+
// Version of the referenced schema. Mutually exclusive with kafkaSchemaRef.
57
+
// +optional
58
+
Versionint`json:"version,omitempty"`
59
+
60
+
// Reference to another KafkaSchema resource in the same namespace.
61
+
// Mutually exclusive with subject/version.
62
+
//
63
+
// Cleanup order matters: delete the dependent before the referent.
// +kubebuilder:validation:XValidation:rule="!has(self.spec.references) || self.spec.references.all(r, !has(r.kafkaSchemaRef) || r.kafkaSchemaRef.name != self.metadata.name)",message="kafkaSchemaRef cannot point to the KafkaSchema itself"
71
106
typeKafkaSchemastruct {
72
107
metav1.TypeMeta`json:",inline"`
73
108
metav1.ObjectMeta`json:"metadata,omitempty"`
@@ -94,6 +129,25 @@ func (in *KafkaSchema) GetObjectMeta() *metav1.ObjectMeta {
94
129
return&in.ObjectMeta
95
130
}
96
131
132
+
// GetRefs returns ResourceReferenceObjects for any kafkaSchemaRef entries in Spec.References.
133
+
// The namespace is always the owner's namespace; refs are same-namespace only by design.
0 commit comments