Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for ReadFile (0.2 sec)

  1. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (1)
  2. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 11.1K 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 May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Wed Mar 27 16:59:05 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  5. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  6. istioctl/pkg/describe/describe_test.go

    	wantException bool
    }
    
    // Tests Pilot /debug
    func TestDescribe(t *testing.T) {
    	productPageConfigPath := "testdata/describe/http_config.json"
    	config, err := os.ReadFile(productPageConfigPath)
    	if err != nil {
    		t.Fatalf("failed to read %s: %v", productPageConfigPath, err)
    	}
    	cases := []execAndK8sConfigTestCase{
    		{ // case 0
    			args:           []string{},
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Mar 28 09:54:01 GMT 2024
    - 30.4K bytes
    - Viewed (0)
  7. istioctl/pkg/proxyconfig/proxyconfig.go

    	debug, err := extractConfigDump(kubeClient, podName, podNamespace, includeEds)
    	if err != nil {
    		return nil, err
    	}
    	return setupConfigdumpEnvoyConfigWriter(debug, out)
    }
    
    func readFile(filename string) ([]byte, error) {
    	file := os.Stdin
    	if filename != "-" {
    		var err error
    		file, err = os.Open(filename)
    		if err != nil {
    			return nil, err
    		}
    	}
    	defer func() {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 16 03:28:36 GMT 2024
    - 48K bytes
    - Viewed (0)
  8. istioctl/pkg/kubeinject/kubeinject.go

    				return nil, nil, err
    			}
    		}
    	}
    
    	injector := &ExternalInjector{}
    	if injectConfigFile != "" {
    		injectionConfig, err := os.ReadFile(injectConfigFile) // nolint: vetshadow
    		if err != nil {
    			return nil, nil, err
    		}
    		injectConfig, err := readInjectConfigFile(injectionConfig)
    		if err != nil {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Mar 29 02:29:02 GMT 2024
    - 21.6K bytes
    - Viewed (0)
  9. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Wed May 17 02:22:22 GMT 2023
    - 15.4K bytes
    - Viewed (0)
  10. operator/cmd/mesh/manifest-generate_test.go

    	tmpDir := t.TempDir()
    	tmpCharts := chartSourceType(filepath.Join(tmpDir, operatorSubdirFilePath))
    	err := copyDir(string(liveCharts), string(tmpCharts))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	rs, err := readFile(filepath.Join(testDataDir, "input-extra-resources", testResourceFile+".yaml"))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Apr 18 18:16:49 GMT 2024
    - 43.5K bytes
    - Viewed (0)
Back to top