Skip to content

Commit

Permalink
comparing parts effecting adaptive scale
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamna committed Dec 12, 2023
1 parent a8b7e9f commit f69090f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions internal/controller/basic_authenticator/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ func (r *BasicAuthenticatorReconciler) createDeploymentAuthenticator(ctx context
replica, err := r.acquireTargetReplica(ctx, basicAuthenticator)
if err != nil {
r.logger.Error(err, "failed to acquire target replica using adaptiveScale")
return subreconciler.RequeueWithError(err)
}
targetReplica = &replica
}
Expand All @@ -313,16 +314,15 @@ func (r *BasicAuthenticatorReconciler) createDeploymentAuthenticator(ctx context

foundDeployment.Spec = newDeployment.Spec
foundDeployment.Spec.Replicas = targetReplica

err := r.Update(ctx, foundDeployment)
err = r.Update(ctx, foundDeployment)
if err != nil {
r.logger.Error(err, "failed to update deployment")
return subreconciler.RequeueWithError(err)
}
}
r.logger.Info("updating ready replicas")
basicAuthenticator.Status.ReadyReplicas = int(foundDeployment.Status.ReadyReplicas)
err := r.Status().Update(ctx, basicAuthenticator)
err = r.Status().Update(ctx, basicAuthenticator)
if err != nil {
r.logger.Error(err, "failed to update basic authenticator status")
return subreconciler.RequeueWithError(err)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/adaptive-scaling/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: BasicAuthenticator
metadata:
name: basicauthenticator-sample
status:
readyReplicas: 1
readyReplicas: 2

3 changes: 2 additions & 1 deletion tests/e2e/adaptive-scaling/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
name: basicauthenticator-sample
spec:
type: deployment
replicas: 1
replicas: 2
appPort: 8080
appService: my-service
adaptiveScale: true
Expand All @@ -36,6 +36,7 @@ spec:
containers:
- name: curl-container
image: curlimages/curl:latest
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]
---
apiVersion: v1
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/sidecar/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ metadata:
name: curl-deployment
labels:
foo: bar
finalizers:
- basicauthenticator.snappcloud.io/finalizer
basicauthenticator.snappcloud.io/name: basicauthenticator-sidecar

0 comments on commit f69090f

Please sign in to comment.