-
Notifications
You must be signed in to change notification settings - Fork 65
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
Consumed capacity info in SpaceProvisionerConfig #1109
Consumed capacity info in SpaceProvisionerConfig #1109
Conversation
the corresponding cluster. The capacity manager is simplified to take this fact into account, even though it needs to re-check the spacecount from the cache to decrease the chance of placing spaces to full clusters just because of the fact that the reconciliation of the SPC didn't happen yet.
The readiness reason will reflect the situation better in that case.
…o member-info-in-spc-status-2
Co-authored-by: Francisc Munteanu <[email protected]>
…o member-info-in-spc-status-2
Co-authored-by: Francisc Munteanu <[email protected]>
This simplifies the logic in the controller and doesn't increase the complexity in the controller tests.
to be less surprising.
a test package and simplify how the SpaceCountGetter is obtained.
…o member-info-in-spc-status-2
SpaceProvisionerConfig. This data is just for information purposes and is not yet used anywhere else in the operator.
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I have only two cosmetic comments 👍 🥇
controllers/spaceprovisionerconfig/spaceprovisionerconfig_controller.go
Outdated
Show resolved
Hide resolved
controllers/spaceprovisionerconfig/spaceprovisionerconfig_controller_test.go
Show resolved
Hide resolved
…c-status_controller-part # Conflicts: # go.mod # go.sum
/retest |
2 similar comments
/retest |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work , just some minor clarification.
toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" | ||
"k8s.io/apimachinery/pkg/types" | ||
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" | ||
"sigs.k8s.io/controller-runtime/pkg/log" | ||
"sigs.k8s.io/controller-runtime/pkg/reconcile" | ||
) | ||
|
||
func MapToolchainClusterToSpaceProvisionerConfigs(ctx context.Context, cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { | ||
return func(context context.Context, obj runtimeclient.Object) []reconcile.Request { | ||
func MapToolchainClusterToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func MapToolchainClusterToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { | |
func mapToolchainClusterToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { |
minor doubt- i don't see this function being used out of the package or in e2e, why is it declared global?
} | ||
} | ||
|
||
func MapToolchainStatusToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func MapToolchainStatusToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { | |
func mapToolchainStatusToSpaceProvisionerConfigs(cl runtimeclient.Client) func(context.Context, runtimeclient.Object) []reconcile.Request { |
Similarly for this function may be we don't require it to be global
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fbm3307, MatousJobanek, metlos The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1109 +/- ##
==========================================
+ Coverage 79.44% 79.48% +0.03%
==========================================
Files 78 78
Lines 7785 7876 +91
==========================================
+ Hits 6185 6260 +75
- Misses 1422 1436 +14
- Partials 178 180 +2
|
This updates the status of the
SpaceProvisionerConfig
with "consumed capacity" info copied fromToolchainStatus
.This info is also used for readiness computation of the SPC. The logic is more or less duplicated in the capacity manager so no behavioral changes should happen to the optimal cluster selection logic.
In the forthcoming PRs the capacity manager will be simplified to take advantage of the new info in the SPC status.
Paired PRs:
Note to self: