@@ -101,6 +101,17 @@ type PolicyConfiguration interface {
101
101
GetMissingNamespacesPolicy () reconciler.MissingNamespacesPolicy
102
102
}
103
103
104
+ // The TypeConfiguration interface is meant to be implemented by compoments (or their spec) which allow
105
+ // to specify additional managed types.
106
+ type TypeConfiguration interface {
107
+ // Get additional managed types; instances of these types are handled differently during
108
+ // apply and delete; foreign instances of these types will block deletion of the component.
109
+ // The fields of the returned TypeInfo structs can be concrete api groups, kinds,
110
+ // or wildcards ("*"); in addition, groups can be specified as a pattern of the form "*.<suffix>"",
111
+ // where the wildcard matches one or multiple dns labels.
112
+ GetAdditionalManagedTypes () []reconciler.TypeInfo
113
+ }
114
+
104
115
// +kubebuilder:object:generate=true
105
116
106
117
// Legacy placement spec. Components may include this into their spec.
@@ -201,6 +212,16 @@ var _ PolicyConfiguration = &PolicySpec{}
201
212
202
213
// +kubebuilder:object:generate=true
203
214
215
+ // TypeSpec allows to specify additional managed types, which are not explicitly part of the component's manifests.
216
+ // Components providing TypeConfiguration may include this into their spec.
217
+ type TypeSpec struct {
218
+ AdditionalManagedTypes []reconciler.TypeInfo `json:"additionalManagedTypes,omitempty"`
219
+ }
220
+
221
+ var _ TypeConfiguration = & TypeSpec {}
222
+
223
+ // +kubebuilder:object:generate=true
224
+
204
225
// Component Status. Components must include this into their status.
205
226
type Status struct {
206
227
ObservedGeneration int64 `json:"observedGeneration"`
0 commit comments