Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for RemoveBrackets (0.15 sec)

  1. operator/pkg/util/path.go

    	return strconv.Atoi(v)
    }
    
    // RemoveBrackets removes the [] around pe and returns the resulting string. It returns false if pe is not surrounded
    // by [].
    func RemoveBrackets(pe string) (string, bool) {
    	if !strings.HasPrefix(pe, "[") || !strings.HasSuffix(pe, "]") {
    		return "", false
    	}
    	return pe[1 : len(pe)-1], true
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Dec 12 17:12:54 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  2. operator/pkg/util/path_test.go

    		},
    		{
    			desc:       "empty",
    			in:         "",
    			expect:     "",
    			expectStat: false,
    		},
    	}
    
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if got, stat := RemoveBrackets(tt.in); got != tt.expect || stat != tt.expectStat {
    				t.Errorf("%s: expect %v %v got %v %v", tt.desc, tt.expect, tt.expectStat, got, stat)
    			}
    		})
    	}
    }
    
    func errNilCheck(err1, err2 error) bool {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Aug 29 00:15:38 UTC 2020
    - 6.7K bytes
    - Viewed (0)
  3. operator/pkg/translate/translate.go

    					scope.Debugf("%s", o.HashNameKind())
    				}
    			}
    			om = objects.ToNameKindMap()
    		}
    
    		// After brackets are removed, the remaining "kind:name" is the same format as the keys in om.
    		pe, _ = util.RemoveBrackets(pe)
    		oo, ok := om[pe]
    		if !ok {
    			// skip to overlay the K8s settings if the corresponding resource doesn't exist.
    			scope.Infof("resource Kind:name %s doesn't exist in the output manifest, skip overlay.", pe)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Feb 12 19:43:09 UTC 2024
    - 36.3K bytes
    - Viewed (0)
Back to top