Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for NewSourceFile (0.57 sec)

  1. pkg/kubelet/config/file_test.go

    	err = os.WriteFile(fileName, []byte{1, 2, 3}, 0555)
    	if err != nil {
    		t.Fatalf("unable to write test file %#v", err)
    	}
    
    	ch := make(chan interface{}, 1)
    	lw := newSourceFile(fileName, "localhost", time.Millisecond, ch)
    	err = lw.listConfig()
    	if err == nil {
    		t.Fatalf("expected error, got nil")
    	}
    	expectEmptyChannel(t, ch)
    }
    
    func TestExtractFromEmptyDir(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jul 30 03:35:26 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  2. pkg/kubelet/config/file.go

    	watchEvents    chan *watchEvent
    }
    
    // NewSourceFile watches a config file for changes.
    func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, updates chan<- interface{}) {
    	// "github.com/sigma/go-inotify" requires a path without trailing "/"
    	path = strings.TrimRight(path, string(os.PathSeparator))
    
    	config := newSourceFile(path, nodeName, period, updates)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 01 07:19:44 UTC 2021
    - 6.2K bytes
    - Viewed (0)
  3. pkg/kubelet/config/file_linux_test.go

    )
    
    func TestExtractFromNonExistentFile(t *testing.T) {
    	ch := make(chan interface{}, 1)
    	lw := newSourceFile("/some/fake/file", "localhost", time.Millisecond, ch)
    	err := lw.doWatch()
    	if err == nil {
    		t.Errorf("Expected error")
    	}
    }
    
    func TestUpdateOnNonExistentFile(t *testing.T) {
    	ch := make(chan interface{})
    	NewSourceFile("random_non_existent_path", "localhost", time.Millisecond, ch)
    	select {
    	case got := <-ch:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 14 09:38:23 UTC 2022
    - 12.3K bytes
    - Viewed (0)
  4. pkg/kubelet/kubelet.go

    	ctx := context.TODO()
    
    	// define file config source
    	if kubeCfg.StaticPodPath != "" {
    		klog.InfoS("Adding static pod path", "path", kubeCfg.StaticPodPath)
    		config.NewSourceFile(kubeCfg.StaticPodPath, nodeName, kubeCfg.FileCheckFrequency.Duration, cfg.Channel(ctx, kubetypes.FileSource))
    	}
    
    	// define url config source
    	if kubeCfg.StaticPodURL != "" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 14 16:09:17 UTC 2024
    - 126.1K bytes
    - Viewed (0)
Back to top