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

Removed default value from capacity.json, assigning default value for… #760

Merged
merged 10 commits into from Feb 7, 2022

Conversation

Kuvesz
Copy link
Contributor

@Kuvesz Kuvesz commented Feb 1, 2022

… each broker now.

Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets fixes #741
License Apache 2.0

What's in this PR?

Removed default value from configmap and through that capacity.json. Now we're setting default values for every broker instead by utilizing the broker status as well as the spec. This way if something can be found in the status and not in the spec we know that that too needs (default) capacity config values assigned. This will basically mean that there will be no default config but there will be a default value for every broker which eliminates the cause of the mentioned issue.

@Kuvesz Kuvesz requested a review from a team as a code owner February 1, 2022 13:30
@CLAassistant
Copy link

CLAassistant commented Feb 1, 2022

CLA assistant check
All committers have signed the CLA.

pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
Copy link
Member

@stoader stoader left a comment

Choose a reason for hiding this comment

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

LGTM, I've found only a few nits

pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
result, err := json.MarshalIndent(capacityConfig, "", " ")
if err != nil {
log.Error(err, "Could not marshal cruise control capacity config")
return "", err
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return "", err
return "", errors.WrapIf(err, "could not marshal cruise control capacity config")

pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Outdated Show resolved Hide resolved
pkg/resources/cruisecontrol/configmap.go Show resolved Hide resolved
@baluchicken baluchicken merged commit 4ee4330 into master Feb 7, 2022
@baluchicken baluchicken deleted the capacityconfig_fix branch February 7, 2022 20:33
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.

Operator kills CC during broker addition even if adding broker is already in progress
4 participants