mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
use kes.Status() for Status() call (#16629)
This commit is contained in:
parent
a1dd08f2e6
commit
e1e9ddd4a4
@ -172,7 +172,11 @@ var _ KMS = (*kesClient)(nil) // compiler check
|
|||||||
// Stat returns the current KES status containing a
|
// Stat returns the current KES status containing a
|
||||||
// list of KES endpoints and the default key ID.
|
// list of KES endpoints and the default key ID.
|
||||||
func (c *kesClient) Stat(ctx context.Context) (Status, error) {
|
func (c *kesClient) Stat(ctx context.Context) (Status, error) {
|
||||||
if _, err := c.client.Version(ctx); err != nil {
|
c.lock.RLock()
|
||||||
|
defer c.lock.RUnlock()
|
||||||
|
|
||||||
|
st, err := c.client.Status(ctx)
|
||||||
|
if err != nil {
|
||||||
return Status{}, err
|
return Status{}, err
|
||||||
}
|
}
|
||||||
endpoints := make([]string, len(c.client.Endpoints))
|
endpoints := make([]string, len(c.client.Endpoints))
|
||||||
@ -181,6 +185,7 @@ func (c *kesClient) Stat(ctx context.Context) (Status, error) {
|
|||||||
Name: "KES",
|
Name: "KES",
|
||||||
Endpoints: endpoints,
|
Endpoints: endpoints,
|
||||||
DefaultKey: c.defaultKeyID,
|
DefaultKey: c.defaultKeyID,
|
||||||
|
Details: st,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,11 @@ type Status struct {
|
|||||||
// is specified. It is empty if the KMS does not support
|
// is specified. It is empty if the KMS does not support
|
||||||
// a default key.
|
// a default key.
|
||||||
DefaultKey string
|
DefaultKey string
|
||||||
|
|
||||||
|
// Details provides more details about the KMS endpoint status.
|
||||||
|
// including uptime, version and available CPUs.
|
||||||
|
// Could be more in future.
|
||||||
|
Details kes.State
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEK is a data encryption key. It consists of a
|
// DEK is a data encryption key. It consists of a
|
||||||
|
Loading…
Reference in New Issue
Block a user