-
Notifications
You must be signed in to change notification settings - Fork 189
feat(kiali): Standardize Certificate Authority Configuration Method #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pkg/kiali/config_test.go
Outdated
| // Create a config file with absolute path | ||
| configFile := filepath.Join(s.tempDir, "config.toml") | ||
| // Convert backslashes to forward slashes for TOML compatibility on Windows | ||
| caFileForTOML := filepath.ToSlash(s.caFile) | ||
| configContent := ` | ||
| [toolset_configs.kiali] | ||
| url = "https://kiali.example/" | ||
| certificate_authority = "` + caFileForTOML + `" | ||
| ` | ||
| err := os.WriteFile(configFile, []byte(configContent), 0644) | ||
| s.Require().NoError(err, "Failed to write config file") | ||
|
|
||
| // Read config - Read() automatically sets the config directory path | ||
| cfg, err := config.Read(configFile) | ||
| s.Require().NoError(err, "Failed to read config") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be replaced with the logic we have in place for other tests e.g.
kubernetes-mcp-server/pkg/kiali/kiali_test.go
Lines 31 to 35 in 8d76426
| s.Config = test.Must(config.ReadToml([]byte(` | |
| [toolset_configs.kiali] | |
| url = "https://kiali.example/" | |
| insecure = true | |
| `))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Yes please, The idea is to replace the inline CA by path |
aljesusg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good only this 2 minor things, I am going to test it locally
docs/KIALI.md
Outdated
| - Invalid URL → ensure `[toolset_configs.kiali].url` is a valid `http(s)://host` URL. | ||
| - TLS certificate validation: | ||
| - If `[toolset_configs.kiali].url` uses HTTPS and `[toolset_configs.kiali].insecure` is false, you must set `[toolset_configs.kiali].certificate_authority` with the PEM-encoded certificate(s) used by the Kiali server. This field expects inline PEM content, not a file path. You may concatenate multiple PEM blocks to include an intermediate chain. | ||
| - If `[toolset_configs.kiali].url` uses HTTPS and `[toolset_configs.kiali].insecure` is false, you must set `[toolset_configs.kiali].certificate_authority` with the path to the CA certificate file. Relative paths are resolved relative to the directory containing the config file. Only file paths are supported; inline PEM content is not allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - If `[toolset_configs.kiali].url` uses HTTPS and `[toolset_configs.kiali].insecure` is false, you must set `[toolset_configs.kiali].certificate_authority` with the path to the CA certificate file. Relative paths are resolved relative to the directory containing the config file. Only file paths are supported; inline PEM content is not allowed. | |
| - If `[toolset_configs.kiali].url` uses HTTPS and `[toolset_configs.kiali].insecure` is false, you must set `[toolset_configs.kiali].certificate_authority` with the path to the CA certificate file. Relative paths are resolved relative to the directory containing the config file. |
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Signed-off-by: josunect <[email protected]>
Co-authored-by: Alberto Gutierrez <[email protected]> Signed-off-by: josunect <[email protected]>
This PR keeps the inline option for back-comp, but I can remove it if it is not required.
How to manually test it:
echo | openssl s_client -showcerts -connect kiali-istio-system.apps-crc.testing:443 2>/dev/null | openssl x509 > /tmp/kiali.crtConfiguration (Using a kiali https route):
Run the MCP server: