mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
fix: return missing information in cluster get API (#25566)
Signed-off-by: Patroklos Papapetrou <ppapapetrou76@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3811a30949
commit
19a74df8dc
@@ -2298,8 +2298,14 @@ func (c *Cluster) Sanitized() *Cluster {
|
||||
ProxyUrl: c.Config.ProxyUrl,
|
||||
DisableCompression: c.Config.DisableCompression,
|
||||
TLSClientConfig: TLSClientConfig{
|
||||
Insecure: c.Config.Insecure,
|
||||
Insecure: c.Config.Insecure,
|
||||
ServerName: c.Config.ServerName,
|
||||
},
|
||||
// We can't know what the user has put into args or
|
||||
// env vars on the exec provider that might be sensitive
|
||||
// (e.g. --private-key=XXX, PASSWORD=XXX)
|
||||
// Implicitly assumes the command executable name is non-sensitive
|
||||
ExecProviderConfig: nil,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4892,10 +4892,16 @@ func TestSanitized(t *testing.T) {
|
||||
Password: "password123",
|
||||
BearerToken: "abc",
|
||||
TLSClientConfig: TLSClientConfig{
|
||||
Insecure: true,
|
||||
Insecure: true,
|
||||
ServerName: "server",
|
||||
CertData: []byte("random bytes we don't want to show in the API response"),
|
||||
KeyData: []byte("random bytes we don't want to show in the API response"),
|
||||
CAData: []byte("random bytes we don't want to show in the API response"),
|
||||
},
|
||||
ExecProviderConfig: &ExecProviderConfig{
|
||||
Command: "test",
|
||||
Command: "this should be omitted in API",
|
||||
Args: []string{"this should be omitted in API"},
|
||||
APIVersion: "this should be omitted in API",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -4921,7 +4927,8 @@ func TestSanitized(t *testing.T) {
|
||||
Annotations: map[string]string{"annotation-key": "annotation-value"},
|
||||
Config: ClusterConfig{
|
||||
TLSClientConfig: TLSClientConfig{
|
||||
Insecure: true,
|
||||
Insecure: true,
|
||||
ServerName: "server",
|
||||
},
|
||||
},
|
||||
}, cluster.Sanitized())
|
||||
|
||||
Reference in New Issue
Block a user