diff --git a/artifacts-collector/entrypoint-collector.sh b/artifacts-collector/entrypoint-collector.sh index d70844b..9f32f88 100755 --- a/artifacts-collector/entrypoint-collector.sh +++ b/artifacts-collector/entrypoint-collector.sh @@ -51,6 +51,10 @@ ${UTIL_OC_BIN} login "${KUBE_API_INT}" \ PROGRESS=( ["completed"]=0 ["total"]=${CERT_TEST_COUNT} ["failures"]="" ["msg"]="starting..." ) watch_dependency_done() { os_log_info "[watch_dependency] Starting dependency check..." + if [[ -z "${PLUGIN_BLOCKED_BY}" ]]; then + os_log_info "[watch_dependency] No blocker plugins configured, skipping" + return + fi for blocker_plugin_name in "${PLUGIN_BLOCKED_BY[@]}"; do os_log_info "waiting for plugin [${blocker_plugin_name}]" diff --git a/openshift-tests-plugin/cmd/exec/wait-updater.go b/openshift-tests-plugin/cmd/exec/wait-updater.go index 98d3792..f686012 100644 --- a/openshift-tests-plugin/cmd/exec/wait-updater.go +++ b/openshift-tests-plugin/cmd/exec/wait-updater.go @@ -54,12 +54,25 @@ func NewCmdWaitUpdater() *cobra.Command { // Check the API and watch for done file. func StartWaitUpdater(opts *OptionsWaitUpdate) error { + if opts.BlockerPlugin == "" { + log.Infof("No blocker plugin specified, skipping dependency waiter for %s", opts.PluginName) + return nil + } + pl, err := plugin.NewPlugin(opts.PluginName) if err != nil { return fmt.Errorf("unable to create plugin %s: %w", opts.PluginName, err) } defer pl.Done() + // Override hardcoded BlockerPlugins with the --blocker flag value, + // so the OPCT CLI template controls which plugin to wait for. + blocker, err := plugin.NewPlugin(opts.BlockerPlugin) + if err != nil { + return fmt.Errorf("unable to create blocker plugin %s: %w", opts.BlockerPlugin, err) + } + pl.BlockerPlugins = []*plugin.Plugin{blocker} + if err = pl.Initialize(); err != nil { return fmt.Errorf("unable to initialize plugin %s: %w", opts.PluginName, err) } diff --git a/openshift-tests-plugin/pkg/plugin/plugin.go b/openshift-tests-plugin/pkg/plugin/plugin.go index c8c6e5f..3404f62 100644 --- a/openshift-tests-plugin/pkg/plugin/plugin.go +++ b/openshift-tests-plugin/pkg/plugin/plugin.go @@ -186,12 +186,22 @@ func (p *Plugin) PluginFullNameByName(name string) string { switch name { case PluginName05: id = PluginId05 + case PluginAlias05: + return PluginAlias05 case PluginName10: id = PluginId10 + case PluginAlias10: + return PluginAlias10 case PluginName20: id = PluginId20 + case PluginAlias20: + return PluginAlias20 case PluginName80: id = PluginId80 + case PluginAlias80: + return PluginAlias80 + case PluginAlias99: + return PluginAlias99 } return fmt.Sprintf("%s-%s", id, name) }