Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for IsFilePath (0.13 sec)

  1. operator/pkg/util/common.go

    package util
    
    import (
    	"fmt"
    	"net/url"
    	"strings"
    
    	"istio.io/istio/pkg/log"
    )
    
    var scope = log.RegisterScope("util", "util")
    
    // IsFilePath reports whether the given URL is a local file path.
    func IsFilePath(path string) bool {
    	return strings.Contains(path, "/") || strings.Contains(path, ".")
    }
    
    // IsHTTPURL checks whether the given URL is a HTTP URL.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  2. operator/pkg/util/common_test.go

    			want: true,
    		},
    		{
    			desc: "with-period",
    			in:   "istio.go",
    			want: true,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if got, want := IsFilePath(tt.in), tt.want; !(got == want) {
    				t.Errorf("%s: got %v, want: %v", tt.desc, got, want)
    			}
    		})
    	}
    }
    
    func TestIsHTTPURL(t *testing.T) {
    	tests := []struct {
    		desc string
    		in   string
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 29 20:42:01 UTC 2020
    - 2.2K bytes
    - Viewed (0)
  3. operator/pkg/helm/helm.go

    // profile format (compiled-in, file, HTTP, etc.).
    func ReadProfileYAML(profile, manifestsPath string) (string, error) {
    	var err error
    	var globalValues string
    
    	// Get global values from profile.
    	switch {
    	case util.IsFilePath(profile):
    		if globalValues, err = readFile(profile); err != nil {
    			return "", err
    		}
    	default:
    		if globalValues, err = LoadValues(profile, manifestsPath); err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jan 10 05:10:03 UTC 2024
    - 8K bytes
    - Viewed (0)
Back to top