RunE runs the ResourceGroup CRD installation as a pre-step if an environment variable exists. Then the wrapped ApplyRunner is invoked. Returns an error if one happened. Swallows the "AlreadyExists" error for CRD installation.
(cmd *cobra.Command, args []string)
| 61 | // invoked. Returns an error if one happened. Swallows the |
| 62 | // "AlreadyExists" error for CRD installation. |
| 63 | func (w *ApplyRunnerWrapper) RunE(cmd *cobra.Command, args []string) error { |
| 64 | if _, exists := os.LookupEnv(resourceGroupEnv); exists { |
| 65 | klog.V(4).Infoln("wrapper applyRunner detected environment variable") |
| 66 | err := live.ApplyResourceGroupCRD(w.provider.Factory()) |
| 67 | if err != nil && !apierrors.IsAlreadyExists(err) { |
| 68 | return err |
| 69 | } |
| 70 | } |
| 71 | klog.V(4).Infoln("wrapper applyRunner run...") |
| 72 | if w.Command().Flag(flagutils.InventoryPolicyFlag).Value.String() == flagutils.InventoryPolicyStrict { |
| 73 | w.applyRunner.PreProcess = func(inv inventory.InventoryInfo, strategy common.DryRunStrategy) (inventory.InventoryPolicy, error) { |
| 74 | return preprocess.PreProcess(w.provider, inv, strategy) |
| 75 | } |
| 76 | } |
| 77 | return w.applyRunner.RunE(cmd, args) |
| 78 | } |
nothing calls this directly
no test coverage detected