Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 370 for readFile (0.22 sec)

  1. cni/pkg/install/cniconfig_test.go

    		},
    	}
    
    	for _, c := range cases {
    		t.Run(c.name, func(t *testing.T) {
    			istioConf := testutils.ReadFile(t, filepath.Join("testdata", c.newConfFilename))
    			existingConfFilepath := filepath.Join("testdata", c.existingConfFilename)
    			existingConf := testutils.ReadFile(t, existingConfFilepath)
    
    			output, err := insertCNIConfig(istioConf, existingConf)
    			if err != nil {
    				if !c.expectedFailure {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed May 17 02:22:22 GMT 2023
    - 15.4K bytes
    - Viewed (0)
  2. operator/cmd/mesh/manifest_shared_test.go

    		for _, o := range objects.Items {
    			no := o.DeepCopy()
    			out = append(out, object.NewK8sObject(no, nil, nil))
    		}
    	}
    	return out
    }
    
    // readFile reads a file and returns the contents.
    func readFile(path string) (string, error) {
    	b, err := os.ReadFile(path)
    	return string(b), err
    }
    
    // writeFile writes a file and returns an error if operation is unsuccessful.
    func writeFile(path string, data []byte) error {
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  3. cni/test/install_cni.go

    // checkResult checks if resultFile is equal to expectedFile at each tick until timeout
    func checkResult(result, expected string) error {
    	resultFile, err := os.ReadFile(result)
    	if err != nil {
    		return fmt.Errorf("couldn't read result: %v", err)
    	}
    	expectedFile, err := os.ReadFile(expected)
    	if err != nil {
    		return fmt.Errorf("couldn't read expected: %v", err)
    	}
    	if !bytes.Equal(resultFile, expectedFile) {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. cmd/xl-storage-format-v2_test.go

    		if dataDir != tc.expectedDataDir {
    			t.Fatalf("Expected %s but got %s", tc.expectedDataDir, dataDir)
    		}
    		count++
    	}
    }
    
    func Benchmark_mergeXLV2Versions(b *testing.B) {
    	data, err := os.ReadFile("testdata/xl.meta-v1.2.zst")
    	if err != nil {
    		b.Fatal(err)
    	}
    	dec, _ := zstd.NewReader(nil)
    	data, err = dec.DecodeAll(data, nil)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	var xl xlMetaV2
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 08 17:50:48 GMT 2024
    - 36.4K bytes
    - Viewed (0)
  5. cmd/metacache-walk.go

    				meta.name = decodeDirObject(meta.name)
    
    				return send(meta)
    			}
    			// Check legacy.
    			if HasSuffix(entry, xlStorageFormatFileV1) && legacy {
    				var meta metaCacheEntry
    				meta.metadata, err = xioutil.ReadFile(pathJoinBuf(sb, volumeDir, current, entry))
    				diskHealthCheckOK(ctx, err)
    				if err != nil {
    					if !IsErrIgnored(err, io.EOF, io.ErrUnexpectedEOF) {
    						internalLogIf(ctx, err)
    					}
    					continue
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  6. cni/pkg/install/install_test.go

    			}
    
    			// check if conf file is deleted/conflist file is updated
    			if c.chainedCNIPlugin {
    				resultConfig := testutils.ReadFile(t, cniConfigFilePath)
    
    				goldenFilepath := filepath.Join("testdata", c.expectedConfigFilename)
    				goldenConfig := testutils.ReadFile(t, goldenFilepath)
    				testutils.CompareBytes(t, resultConfig, goldenConfig, goldenFilepath)
    			} else if file.Exists(cniConfigFilePath) {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 11.1K bytes
    - Viewed (0)
  7. cni/pkg/install/cniconfig.go

    	return writeCNIConfig(ctx, cniConfig, getPluginConfig(cfg))
    }
    
    func readCNIConfigTemplate(template cniConfigTemplate) ([]byte, error) {
    	if file.Exists(template.cniNetworkConfigFile) {
    		cniConfig, err := os.ReadFile(template.cniNetworkConfigFile)
    		if err != nil {
    			return nil, err
    		}
    		installLog.Infof("Using CNI config template from %s", template.cniNetworkConfigFile)
    		return cniConfig, nil
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  8. cmd/handler-api.go

    	cgroupV2MemLimitFile = "/sys/fs/cgroup/memory.max"
    	cgroupMemNoLimit     = 9223372036854771712
    )
    
    func cgroupMemLimit() (limit uint64) {
    	buf, err := os.ReadFile(cgroupV2MemLimitFile)
    	if err != nil {
    		buf, err = os.ReadFile(cgroupV1MemLimitFile)
    	}
    	if err != nil {
    		return 0
    	}
    	limit, err = strconv.ParseUint(strings.TrimSpace(string(buf)), 10, 64)
    	if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 08 09:22:27 GMT 2024
    - 10K bytes
    - Viewed (0)
  9. istioctl/pkg/workload/workload_test.go

    					ObjectMeta: metav1.ObjectMeta{Namespace: "istio-system", Name: "istio-rev-1"},
    					Data: map[string]string{
    						"mesh": string(util.ReadFile(t, path.Join(testdir, "meshconfig.yaml"))),
    					},
    				}, metav1.CreateOptions{})
    				client.Kube().CoreV1().Secrets("bar").Create(context.Background(), &v1.Secret{
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Mar 27 16:59:05 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  10. src/cmd/asm/internal/asm/endtoend_test.go

    	if !ok || failed {
    		t.Errorf("asm: %s assembly failed", goarch)
    		return
    	}
    	output := strings.Split(testOut.String(), "\n")
    
    	// Reconstruct expected output by independently "parsing" the input.
    	data, err := os.ReadFile(input)
    	if err != nil {
    		t.Error(err)
    		return
    	}
    	lineno := 0
    	seq := 0
    	hexByLine := map[string]string{}
    	lines := strings.SplitAfter(string(data), "\n")
    Diff:
    	for _, line := range lines {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Dec 07 18:42:59 GMT 2023
    - 11.6K bytes
    - Viewed (0)
Back to top