Skip to content
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

CBG-4100: Call AuditIDClusterInfoRead event #7009

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions rest/admin_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2147,36 +2147,36 @@ type BucketInfo struct {
// information (registry) for each
func (h *handler) handleGetClusterInfo() error {

// If not using persistent config, returns legacy_config:true
if h.server.persistentConfig == false {
clusterInfo := ClusterInfo{
LegacyConfig: true,
}
h.writeJSON(clusterInfo)
return nil
}

clusterInfo := ClusterInfo{
Buckets: make(map[string]BucketInfo),
LegacyConfig: true,
}

bucketNames, err := h.server.GetBucketNames()
if err != nil {
return err
}
if !h.server.persistentConfig {
bbrks marked this conversation as resolved.
Show resolved Hide resolved
bbrks marked this conversation as resolved.
Show resolved Hide resolved

for _, bucketName := range bucketNames {
registry, err := h.server.BootstrapContext.getGatewayRegistry(h.ctx(), bucketName)
bucketNames, err := h.server.GetBucketNames()
if err != nil {
base.InfofCtx(h.ctx(), base.KeyAll, "Unable to retrieve registry for bucket %s during getClusterInfo: %v", base.MD(bucketName), err)
continue
return err
}

bucketInfo := BucketInfo{
Registry: *registry,
clusterInfo = ClusterInfo{
Buckets: make(map[string]BucketInfo, len(bucketNames)),
}

for _, bucketName := range bucketNames {
registry, err := h.server.BootstrapContext.getGatewayRegistry(h.ctx(), bucketName)
if err != nil {
base.InfofCtx(h.ctx(), base.KeyAll, "Unable to retrieve registry for bucket %s during getClusterInfo: %v", base.MD(bucketName), err)
continue
}

bucketInfo := BucketInfo{
Registry: *registry,
}
clusterInfo.Buckets[bucketName] = bucketInfo
}
clusterInfo.Buckets[bucketName] = bucketInfo
}

base.Audit(h.ctx(), base.AuditIDClusterInfoRead, nil)
h.writeJSON(clusterInfo)
return nil
}
Expand Down
Loading