Skip to content

Commit

Permalink
Rework the component unit tests to use the managedResourceObjectsMatc…
Browse files Browse the repository at this point in the history
…her (#302)
  • Loading branch information
ialidzhikov authored Dec 10, 2024
1 parent 87b4466 commit 52e5997
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 268 deletions.
9 changes: 3 additions & 6 deletions pkg/component/registrycaches/registry_caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (r *registryCaches) computeResourcesDataForRegistryCache(ctx context.Contex
Selector: &metav1.LabelSelector{
MatchLabels: getLabels(name, upstreamLabel),
},
Replicas: ptr.To(int32(1)),
Replicas: ptr.To[int32](1),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: utils.MergeStringMaps(getLabels(name, upstreamLabel), map[string]string{
Expand Down Expand Up @@ -407,7 +407,6 @@ source /entrypoint.sh /etc/distribution/config.yml
corev1.ResourceStorage: *cache.Volume.Size,
},
},

StorageClassName: storageClassName,
},
},
Expand All @@ -432,8 +431,6 @@ source /entrypoint.sh /etc/distribution/config.yml

var vpa *vpaautoscalingv1.VerticalPodAutoscaler
if r.values.VPAEnabled {
updateMode := vpaautoscalingv1.UpdateModeAuto
controlledValues := vpaautoscalingv1.ContainerControlledValuesRequestsOnly
vpa = &vpaautoscalingv1.VerticalPodAutoscaler{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -446,13 +443,13 @@ source /entrypoint.sh /etc/distribution/config.yml
Name: name,
},
UpdatePolicy: &vpaautoscalingv1.PodUpdatePolicy{
UpdateMode: &updateMode,
UpdateMode: ptr.To(vpaautoscalingv1.UpdateModeAuto),
},
ResourcePolicy: &vpaautoscalingv1.PodResourcePolicy{
ContainerPolicies: []vpaautoscalingv1.ContainerResourcePolicy{
{
ContainerName: vpaautoscalingv1.DefaultContainerResourcePolicy,
ControlledValues: &controlledValues,
ControlledValues: ptr.To(vpaautoscalingv1.ContainerControlledValuesRequestsOnly),
MinAllowed: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("20Mi"),
},
Expand Down
Loading

0 comments on commit 52e5997

Please sign in to comment.