Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewBuildInfoFromOldString (0.17 sec)

  1. pkg/version/version.go

    type DockerBuildInfo struct {
    	Hub  string
    	Tag  string
    	OS   string
    	Arch string
    }
    
    // NewBuildInfoFromOldString creates a BuildInfo struct based on the output
    // of previous Istio components '-- version' output
    func NewBuildInfoFromOldString(oldOutput string) (BuildInfo, error) {
    	res := BuildInfo{}
    
    	lines := strings.Split(oldOutput, "\n")
    	for _, line := range lines {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 29 14:15:26 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. pkg/version/version_test.go

    			BuildInfo{},
    		},
    		{
    			"Invalid input 2",
    			"Xuxa:Xuxo",
    			false,
    			BuildInfo{},
    		},
    	}
    
    	for _, v := range cases {
    		t.Run(v.name, func(t *testing.T) {
    			got, err := NewBuildInfoFromOldString(v.in)
    			if v.expectFail && err == nil {
    				t.Errorf("Expected failure, got success")
    			}
    			if !v.expectFail && err != nil {
    				t.Errorf("Got %v, expected success", err)
    			}
    
    			if got != v.want {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 3K bytes
    - Viewed (0)
Back to top