Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@aprvsh
Copy link
Collaborator

@aprvsh aprvsh commented Apr 29, 2025

Closes #21

@aprvsh aprvsh requested a review from arttor April 29, 2025 14:29
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Show resolved Hide resolved
@aprvsh aprvsh requested a review from arttor May 9, 2025 16:47
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
@aprvsh aprvsh requested a review from arttor May 15, 2025 17:14
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
api/cluster.proto Outdated Show resolved Hide resolved
pkg/api/cluster_api_handlers.go Outdated Show resolved Hide resolved
}
return iService > jService
default:
return false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is default case here? should we skip sorting in this case?

pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config_test.go Outdated Show resolved Hide resolved
pkg/cephconfig/config_test.go Show resolved Hide resolved
@aprvsh aprvsh requested a review from arttor May 22, 2025 18:10
}
serviceStr, found := serviceTypeMap[*service]
if !found {
serviceStr = service.String()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i got it right, this line means that we don't have suitable enum for given value. should it be error? or at least log error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a fallback. If we do not have a suitable enum value, a test will fail.

return nil, fmt.Errorf("failed to unmarshal config index JSON: %w", err)
}

// Check if jsonArray is sorted by Name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to check. since json is embedded and hadrcoded, we can check sort order in unit test

sortedCluster []string,
fetchNew func(name string) (ConfigParamInfo, error),
) ([]ConfigParamInfo, error) {
result := make([]ConfigParamInfo, 0, len(sortedCluster))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should capacity be a max(sortedBase,sortedCluster)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be okay because we will not have more than len(sortedCluster) params (the number of params allowed in the current cluster)

i++
}
}
// Any remaining names in cluster are new params
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also handle case where i < len(sortedBase)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i < len(sortedBase) after the loop, it means we skipped adding those elements from sortedBase (from the base JSON file) that were not in the current cluster. This is what we want, so no need to handle separately.

pkg/cephconfig/config.go Outdated Show resolved Hide resolved
pkg/cephconfig/config_test.go Show resolved Hide resolved
@aprvsh aprvsh requested a review from arttor May 26, 2025 07:12
pkg/cephconfig/config_test.go Outdated Show resolved Hide resolved
pkg/cephconfig/config_test.go Outdated Show resolved Hide resolved
@aprvsh aprvsh requested a review from arttor May 26, 2025 13:59
@aprvsh aprvsh merged commit 43d5b17 into main Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Index ceph config options

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.