Skip to content

Commit

Permalink
New Release v1.1.8 for OCI Service Operator (#40)
Browse files Browse the repository at this point in the history
New Release v1.1.8 for OCI Service Operator

- Update MaxControllerDelay for all resource controllers
- Remove watch on deployments for IngressGatewayDeployment
- Update BaseDelay for exponential backoff

Co-authored-by: giriraj34
Co-authored-by: ahwille
Co-authored-by: Shashank Nagamalla
  • Loading branch information
zihuaweng authored May 9, 2023
1 parent 6543090 commit 5cdf739
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See the [Documentation](docs/README.md#oci-service-operator-for-kubernetes) for
The OCI Service Operator for Kubernetes is packaged as Operator Lifecycle Manager (OLM) Bundle for making it easy to install in Kubernetes Clusters. The bundle can be downloaded as docker image using below command.

```
docker pull iad.ocir.io/oracle/oci-service-operator-bundle:1.1.1
docker pull iad.ocir.io/oracle/oci-service-operator-bundle:1.1.8
```

## Samples
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/servicemesh.oci/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"os"
"time"

appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/source"
Expand Down Expand Up @@ -510,7 +509,6 @@ func main() {

enqueueRequestsForConfigmapEvents := ingressgatewaydeployment.NewEnqueueRequestsForConfigmapEvents(mgr.GetClient(), ctrl.Log.WithName("controllers").WithName("IngressGatewayDeployment"), operatorNamespace)
igdCustomWatches := []servicemeshcontrollers.CustomWatch{
ingressgatewaydeployment.GetIngressGatewayDeploymentOwnerWatch(&appsv1.Deployment{}),
ingressgatewaydeployment.GetIngressGatewayDeploymentOwnerWatch(&corev1.Service{}),
ingressgatewaydeployment.GetIngressGatewayDeploymentOwnerWatch(&autoscalingv1.HorizontalPodAutoscaler{}),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (c *ServiceMeshServiceManager) CreateOrUpdate(ctx context.Context, obj runt
if resolveDependenciesErr != nil {
return meshErrors.GetOsokResponseByHandlingReconcileError(resolveDependenciesErr)
}

c.log.InfoLogWithFixedMessage(ctx, "dependencies resolved")
getResourceErr := c.handler.GetResource(ctx, object, resourceDetails)
if getResourceErr != nil {
_ = c.UpdateServiceMeshConfiguredStatus(ctx, object, getResourceErr)
Expand Down Expand Up @@ -193,6 +193,7 @@ func (c *ServiceMeshServiceManager) CreateOrUpdate(ctx context.Context, obj runt
if !resourceCreated {
_ = c.UpdateServiceMeshConfiguredStatus(ctx, object, resourceCreationErr)
if resourceCreationErr != nil {
c.log.InfoLogWithFixedMessage(ctx, "cp error while creating resource", "error", resourceCreationErr)
if !meshErrors.IsNetworkErrorOrInternalError(resourceCreationErr) {
// Clears the opcRetryToken if the request didn't fail for network or internal error
_ = c.UpdateOpcRetryToken(ctx, object, nil)
Expand Down
4 changes: 2 additions & 2 deletions pkg/servicemanager/servicemesh/utils/commons/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "time"
const (
// Delay duration parameters for rate limiter exponential back off
MaxDelay = 10 * time.Second
MaxControllerDelay = 10 * time.Minute
BaseDelay = 5 * time.Millisecond
MaxControllerDelay = 1 * time.Minute
BaseDelay = 500 * time.Millisecond

PollInterval = time.Second * 5

Expand Down
31 changes: 14 additions & 17 deletions pkg/servicemanager/servicemesh/utils/commons/ratelimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ import (
)

func TestDefaultControllerRateLimiter(t *testing.T) {
limiter := DefaultControllerRateLimiter(10 * time.Second)
limiter := DefaultControllerRateLimiter(1 * time.Minute)

assert.Equal(t, 5*time.Millisecond, limiter.When("one"))
assert.Equal(t, 10*time.Millisecond, limiter.When("one"))
assert.Equal(t, 20*time.Millisecond, limiter.When("one"))
assert.Equal(t, 40*time.Millisecond, limiter.When("one"))
assert.Equal(t, 80*time.Millisecond, limiter.When("one"))
assert.Equal(t, 160*time.Millisecond, limiter.When("one"))
assert.Equal(t, 320*time.Millisecond, limiter.When("one"))
assert.Equal(t, 640*time.Millisecond, limiter.When("one"))
assert.Equal(t, 1280*time.Millisecond, limiter.When("one"))
assert.Equal(t, 2560*time.Millisecond, limiter.When("one"))
assert.Equal(t, 5120*time.Millisecond, limiter.When("one"))
assert.Equal(t, 10000*time.Millisecond, limiter.When("one"))
assert.Equal(t, 10000*time.Millisecond, limiter.When("one"))
assert.Equal(t, 10000*time.Millisecond, limiter.When("one"))
assert.Equal(t, 500*time.Millisecond, limiter.When("one"))
assert.Equal(t, 1*time.Second, limiter.When("one"))
assert.Equal(t, 2*time.Second, limiter.When("one"))
assert.Equal(t, 4*time.Second, limiter.When("one"))
assert.Equal(t, 8*time.Second, limiter.When("one"))
assert.Equal(t, 16*time.Second, limiter.When("one"))
assert.Equal(t, 32*time.Second, limiter.When("one"))
assert.Equal(t, 1*time.Minute, limiter.When("one"))
assert.Equal(t, 1*time.Minute, limiter.When("one"))
assert.Equal(t, 1*time.Minute, limiter.When("one"))
assert.Equal(t, 1*time.Minute, limiter.When("one"))

assert.Equal(t, 5*time.Millisecond, limiter.When("two"))
assert.Equal(t, 10*time.Millisecond, limiter.When("two"))
assert.Equal(t, 500*time.Millisecond, limiter.When("two"))
assert.Equal(t, 1*time.Second, limiter.When("two"))
}

0 comments on commit 5cdf739

Please sign in to comment.