(dag *graph.DAG, object client.Object, dependency ...client.Object)
| 162 | } |
| 163 | |
| 164 | func (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 | |
| 183 | func (r *realGraphClient) FindAll(dag *graph.DAG, obj interface{}, opts ...GraphOption) []client.Object { |
| 184 | graphOpts := &GraphOptions{} |
nothing calls this directly
no test coverage detected