Merge "Remove unused kubernetes String functions"
This commit is contained in:
commit
b5c7167094
@ -1010,35 +1010,3 @@ func ValidClusterType(clusterType string) error {
|
||||
}
|
||||
return fmt.Errorf("cluster type must be one of %v", AllClusterTypes)
|
||||
}
|
||||
|
||||
/* ______________________________
|
||||
PLACEHOLDER UNTIL I IDENTIFY if CLIENTADM
|
||||
HAS SOMETHING LIKE THIS
|
||||
*/
|
||||
|
||||
func KClusterString(cluster *clientcmdapi.Cluster) string {
|
||||
yamlData, err := yaml.Marshal(&cluster)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(yamlData)
|
||||
}
|
||||
|
||||
func KContextString(context *clientcmdapi.Context) string {
|
||||
yamlData, err := yaml.Marshal(&context)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(yamlData)
|
||||
}
|
||||
|
||||
func KAuthInfoString(authInfo *clientcmdapi.AuthInfo) string {
|
||||
yamlData, err := yaml.Marshal(&authInfo)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(yamlData)
|
||||
}
|
||||
|
@ -416,37 +416,6 @@ func TestPurge(t *testing.T) {
|
||||
assert.Falsef(t, os.IsExist(err), "Purge failed to remove file at %v", conf.LoadedConfigPath())
|
||||
}
|
||||
|
||||
func TestKClusterString(t *testing.T) {
|
||||
conf, cleanup := testutil.InitConfig(t)
|
||||
defer cleanup(t)
|
||||
|
||||
kClusters := conf.KubeConfig().Clusters
|
||||
for kClust := range kClusters {
|
||||
assert.NotEmpty(t, config.KClusterString(kClusters[kClust]))
|
||||
}
|
||||
assert.EqualValues(t, config.KClusterString(nil), "null\n")
|
||||
}
|
||||
func TestKContextString(t *testing.T) {
|
||||
conf, cleanup := testutil.InitConfig(t)
|
||||
defer cleanup(t)
|
||||
|
||||
kContexts := conf.KubeConfig().Contexts
|
||||
for kCtx := range kContexts {
|
||||
assert.NotEmpty(t, config.KContextString(kContexts[kCtx]))
|
||||
}
|
||||
assert.EqualValues(t, config.KClusterString(nil), "null\n")
|
||||
}
|
||||
func TestKAuthInfoString(t *testing.T) {
|
||||
conf, cleanup := testutil.InitConfig(t)
|
||||
defer cleanup(t)
|
||||
|
||||
kAuthInfos := conf.KubeConfig().AuthInfos
|
||||
for kAi := range kAuthInfos {
|
||||
assert.NotEmpty(t, config.KAuthInfoString(kAuthInfos[kAi]))
|
||||
}
|
||||
assert.EqualValues(t, config.KAuthInfoString(nil), "null\n")
|
||||
}
|
||||
|
||||
func TestComplexName(t *testing.T) {
|
||||
cName := "aCluster"
|
||||
ctName := config.Ephemeral
|
||||
|
Loading…
x
Reference in New Issue
Block a user