Skip to content

Commit

Permalink
fix forgotten verticalpodautoscaler.Config (#1506)
Browse files Browse the repository at this point in the history
* fix forgotten verticalpodautoscaler.Config
* move a const to a more suitable place

---------

Co-authored-by: Herve Nicol <[email protected]>
  • Loading branch information
hervenicol and hervenicol authored Feb 5, 2024
1 parent aad9fa7 commit 8d9b502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (
)

const (
Name = "verticalpodautoscaler"
Name = "verticalpodautoscaler"
unknownObservabilityBundleVersion = "0.0.0"
)

type Config struct {
Expand Down Expand Up @@ -173,8 +174,6 @@ func (r *Resource) getObject(ctx context.Context, v interface{}) (*vpa_types.Ver
return vpa, nil
}

const unknownObservabilityBundleVersion = "0.0.0"

// We get the management cluster observability bundle app version for the management cluster to know if we need to configure the VPA CR to target the StatefulSet or the Prometheus CR.
// We need to do this because VPA uses the scale subresource to scale the target object, and the Prometheus CR has a scale subresource since the observability-bundle 1.2.0.
func (r *Resource) getManagementClusterObservabilityBundleAppVersion(ctx context.Context, cluster metav1.Object) (string, error) {
Expand Down
8 changes: 5 additions & 3 deletions service/controller/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,11 @@ func New(config Config) ([]resource.Interface, error) {
var verticalPodAutoScalerResource resource.Interface
{
c := verticalpodautoscaler.Config{
Logger: config.Logger,
K8sClient: config.K8sClient,
VpaClient: config.VpaClient,
Logger: config.Logger,
K8sClient: config.K8sClient,
VpaClient: config.VpaClient,
Installation: config.Installation,
Provider: config.Provider,
}

verticalPodAutoScalerResource, err = verticalpodautoscaler.New(c)
Expand Down

0 comments on commit 8d9b502

Please sign in to comment.