Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for NewRunner (0.1 sec)

  1. cmd/kubeadm/app/cmd/phases/workflow/doc_test.go

    limitations under the License.
    */
    
    package workflow
    
    import (
    	"fmt"
    
    	"github.com/pkg/errors"
    	"github.com/spf13/cobra"
    )
    
    var myWorkflowRunner = NewRunner()
    
    type myWorkflowData struct {
    	data string
    }
    
    func (c *myWorkflowData) Data() string {
    	return c.data
    }
    
    type myPhaseData interface {
    	Data() string
    }
    
    func ExamplePhase() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 10 07:27:25 UTC 2019
    - 2.7K bytes
    - Viewed (0)
  2. pkg/util/async/runner.go

    type Runner struct {
    	lock      sync.Mutex
    	loopFuncs []func(stop chan struct{})
    	stop      *chan struct{}
    }
    
    // NewRunner makes a runner for the given function(s). The function(s) should loop until
    // the channel is closed.
    func NewRunner(f ...func(stop chan struct{})) *Runner {
    	return &Runner{loopFuncs: f}
    }
    
    // Start begins running.
    func (r *Runner) Start() {
    	r.lock.Lock()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jul 29 06:37:00 UTC 2016
    - 1.4K bytes
    - Viewed (0)
  3. cmd/kubeadm/app/cmd/phases/init/certs_test.go

    		t.Run(test.Name, func(t *testing.T) {
    			pkiutiltesting.Reset()
    
    			tmpdir := testutil.SetupTempDir(t)
    			defer os.RemoveAll(tmpdir)
    
    			certstestutil.WritePKIFiles(t, tmpdir, test.Files)
    
    			r := workflow.NewRunner()
    			r.AppendPhase(NewCertsPhase())
    			r.SetDataInitializer(func(*cobra.Command, []string) (workflow.RunData, error) {
    				certsData := &testCertsData{
    					cfg: testutil.GetDefaultInternalConfig(t),
    				}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 17 14:40:46 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  4. pkg/util/async/runner_test.go

    			lock.Unlock()
    			<-c
    			lock.Lock()
    			events = append(events, fmt.Sprintf("%v stopping\n", iCopy))
    			lock.Unlock()
    			done <- struct{}{}
    		})
    	}
    
    	r := NewRunner(funcs...)
    	r.Start()
    	r.Stop()
    	for i := 0; i < 10; i++ {
    		<-done
    	}
    	if len(events) != 20 {
    		t.Errorf("expected 20 events, but got:\n%v\n", events)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jul 29 06:37:00 UTC 2016
    - 1.2K bytes
    - Viewed (0)
  5. cmd/kubeadm/app/cmd/phases/workflow/runner.go

    	// It corresponds to the relative path of the phase in the workflow managed by the Runner.
    	use string
    }
    
    // NewRunner return a new runner for composable kubeadm workflows.
    func NewRunner() *Runner {
    	return &Runner{
    		Phases: []Phase{},
    	}
    }
    
    // AppendPhase adds the given phase to the ordered sequence of phases managed by the runner.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 21 05:35:15 UTC 2022
    - 16K bytes
    - Viewed (0)
  6. tools/bug-report/pkg/kubectlcmd/kubectlcmd.go

    	runningTasks   sets.String
    	runningTasksMu sync.RWMutex
    
    	// runningTasksTicker is the report interval for running tasks.
    	runningTasksTicker *time.Ticker
    }
    
    func NewRunner(activeRqLimit int) *Runner {
    	if activeRqLimit <= 0 {
    		activeRqLimit = defaultActiveRequestLimit
    	}
    	return &Runner{
    		taskSem:            make(chan struct{}, activeRqLimit),
    		runningTasks:       sets.New[string](),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Nov 16 01:18:03 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  7. cmd/kubeadm/app/cmd/upgrade/node.go

    	outputWriter          io.Writer
    }
    
    // newCmdNode returns the cobra command for `kubeadm upgrade node`
    func newCmdNode(out io.Writer) *cobra.Command {
    	nodeOptions := newNodeOptions()
    	nodeRunner := workflow.NewRunner()
    
    	cmd := &cobra.Command{
    		Use:   "node",
    		Short: "Upgrade commands for a node in the cluster",
    		RunE: func(cmd *cobra.Command, args []string) error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 08:34:39 UTC 2024
    - 10K bytes
    - Viewed (0)
  8. cmd/kubeadm/app/cmd/reset.go

    func newCmdReset(in io.Reader, out io.Writer, resetOptions *resetOptions) *cobra.Command {
    	if resetOptions == nil {
    		resetOptions = newResetOptions()
    	}
    	resetRunner := workflow.NewRunner()
    
    	cmd := &cobra.Command{
    		Use:   "reset",
    		Short: "Performs a best effort revert of changes made to this host by 'kubeadm init' or 'kubeadm join'",
    		RunE: func(cmd *cobra.Command, args []string) error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 17 12:26:58 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  9. pkg/registry/core/rest/storage_core.go

    		// than 1 minute for backward compatibility of failing the whole
    		// apiserver if we can't repair them.
    		wg := sync.WaitGroup{}
    		wg.Add(2)
    		runner := async.NewRunner(
    			func(stopCh chan struct{}) { p.startServiceClusterIPRepair(wg.Done, stopCh) },
    			func(stopCh chan struct{}) { p.startServiceNodePortsRepair(wg.Done, stopCh) },
    		)
    		runner.Start()
    		go func() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:05 UTC 2023
    - 19.1K bytes
    - Viewed (0)
  10. tools/bug-report/pkg/bugreport/bugreport.go

    	// Aggregated errors for all fetch operations.
    	gErrors util.Errors
    	lock    = sync.RWMutex{}
    )
    
    func runBugReportCommand(ctx cli.Context, _ *cobra.Command, logOpts *log.Options) error {
    	runner := kubectlcmd.NewRunner(gConfig.RequestConcurrency)
    	runner.ReportRunningTasks()
    	if err := configLogs(logOpts); err != nil {
    		return err
    	}
    	config, err := parseConfig()
    	if err != nil {
    		return err
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 05 20:57:29 UTC 2024
    - 20.7K bytes
    - Viewed (0)
Back to top