(dag *graph.DAG, objOld, objNew client.Object, action *Action, parent *ObjectVertex, opts ...GraphOption)
| 121 | } |
| 122 | |
| 123 | func (r *realGraphClient) Do(dag *graph.DAG, objOld, objNew client.Object, action *Action, parent *ObjectVertex, opts ...GraphOption) *ObjectVertex { |
| 124 | if dag.Root() == nil { |
| 125 | panic(fmt.Sprintf("root vertex not found. obj: %T, name: %s", objNew, objNew.GetName())) |
| 126 | } |
| 127 | |
| 128 | graphOpts := &GraphOptions{} |
| 129 | for _, opt := range opts { |
| 130 | opt.ApplyTo(graphOpts) |
| 131 | } |
| 132 | |
| 133 | vertex := &ObjectVertex{ |
| 134 | OriObj: objOld, |
| 135 | Obj: objNew, |
| 136 | Action: action, |
| 137 | ClientOpt: graphOpts.clientOpt, |
| 138 | PropagationPolicy: graphOpts.propagationPolicy, |
| 139 | } |
| 140 | switch { |
| 141 | case parent == nil: |
| 142 | dag.AddConnectRoot(vertex) |
| 143 | default: |
| 144 | dag.AddConnect(parent, vertex) |
| 145 | } |
| 146 | return vertex |
| 147 | } |
| 148 | |
| 149 | func (r *realGraphClient) IsAction(dag *graph.DAG, obj client.Object, action *Action) bool { |
| 150 | vertex := r.FindMatchedVertex(dag, obj) |
nothing calls this directly
no test coverage detected