forked from kiali/kiali
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert common cfgmap func and protect against failure
This reverts the callers of IstioConfigMapName back to using `cfg.external_services.istio.config_map_name` directly. It now logs failures in GetMesh to auto-detect the configmap instead of returning an error. Nothing is currently using that configuration so an error shouldn't be returned there. Related to: kiali#6669.
- Loading branch information
Showing
7 changed files
with
89 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package business | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestIstioConfigMapName(t *testing.T) { | ||
testCases := map[string]struct { | ||
revision string | ||
expected string | ||
}{ | ||
"revision is default": { | ||
revision: "default", | ||
expected: "istio", | ||
}, | ||
"revision is v1": { | ||
revision: "v1", | ||
expected: "istio-v1", | ||
}, | ||
"revision is empty": { | ||
revision: "", | ||
expected: "istio", | ||
}, | ||
} | ||
|
||
for desc, tc := range testCases { | ||
t.Run(desc, func(t *testing.T) { | ||
result := guessIstioConfigMapName(tc.revision) | ||
assert.Equal(t, tc.expected, result) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters