MCPcopy
hub / github.com/apecloud/kubeblocks / DependOn

Method DependOn

pkg/controller/model/graph_client.go:164–181  ·  view source on GitHub ↗
(dag *graph.DAG, object client.Object, dependency ...client.Object)

Source from the content-addressed store, hash-verified

162}
163
164func (r *realGraphClient) DependOn(dag *graph.DAG, object client.Object, dependency ...client.Object) {
165 objectVertex := r.FindMatchedVertex(dag, object)
166 if objectVertex == nil {
167 return
168 }
169 for _, d := range dependency {
170 // d == nil can't tell if d is (*T)(nil)
171 // e.g. `var d *corev1.Pod`
172 value := reflect.ValueOf(d)
173 if d == nil || (value.Kind() == reflect.Ptr && value.IsNil()) {
174 continue
175 }
176 v := r.FindMatchedVertex(dag, d)
177 if v != nil {
178 dag.Connect(objectVertex, v)
179 }
180 }
181}
182
183func (r *realGraphClient) FindAll(dag *graph.DAG, obj interface{}, opts ...GraphOption) []client.Object {
184 graphOpts := &GraphOptions{}

Callers

nothing calls this directly

Calls 3

FindMatchedVertexMethod · 0.95
ConnectMethod · 0.80
KindMethod · 0.65

Tested by

no test coverage detected