Skip to content

Commit

Permalink
Import revision and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Dec 18, 2023
1 parent 743d1de commit a593141
Show file tree
Hide file tree
Showing 181 changed files with 1,408 additions and 1,662 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test-e2e: manifests ginkgo kind-create kind-deploy kind-deploy-backup-assets ##

assets: go-bindata ## assets: Generate embedded assets
@echo Generate Go embedded assets files by processing source
PATH=$$PATH:$$PWD/bin go generate github.com/3scale/saas-operator/pkg/assets
PATH=$$PATH:$$PWD/bin go generate github.com/3scale-ops/saas-operator/pkg/assets

##@ Build

Expand Down
26 changes: 13 additions & 13 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: saas-operator
repo: github.com/3scale/saas-operator
repo: github.com/3scale-ops/saas-operator
resources:
- api:
crdVersion: v1
Expand All @@ -14,7 +14,7 @@ resources:
domain: 3scale.net
group: saas
kind: AutoSSL
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -23,7 +23,7 @@ resources:
domain: 3scale.net
group: saas
kind: Apicast
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -32,7 +32,7 @@ resources:
domain: 3scale.net
group: saas
kind: EchoAPI
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -41,7 +41,7 @@ resources:
domain: 3scale.net
group: saas
kind: MappingService
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -50,7 +50,7 @@ resources:
domain: 3scale.net
group: saas
kind: CORSProxy
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -59,7 +59,7 @@ resources:
domain: 3scale.net
group: saas
kind: Backend
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -68,7 +68,7 @@ resources:
domain: 3scale.net
group: saas
kind: System
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -77,7 +77,7 @@ resources:
domain: 3scale.net
group: saas
kind: Zync
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -86,7 +86,7 @@ resources:
domain: 3scale.net
group: saas
kind: Sentinel
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -95,7 +95,7 @@ resources:
domain: 3scale.net
group: saas
kind: RedisShard
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -104,7 +104,7 @@ resources:
domain: 3scale.net
group: saas
kind: TwemproxyConfig
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -113,6 +113,6 @@ resources:
domain: 3scale.net
group: saas
kind: ShardedRedisBackup
path: github.com/3scale/saas-operator/api/v1alpha1
path: github.com/3scale-ops/saas-operator/api/v1alpha1
version: v1alpha1
version: "3"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

![3scale-saas](docs/logos/3scale-saas-logo.svg)

[![test](https://github.com/3scale/saas-operator/actions/workflows/test.yaml/badge.svg)](https://github.com/3scale/saas-operator/actions/workflows/test.yaml)
[![release](https://badgen.net/github/release/3scale/saas-operator)](https://github.com/3scale/saas-operator/releases)
[![license](https://badgen.net/github/license/3scale/saas-operator)](https://github.com/3scale/saas-operator/LICENSE)
[![test](https://github.com/3scale-ops/saas-operator/actions/workflows/test.yaml/badge.svg)](https://github.com/3scale-ops/saas-operator/actions/workflows/test.yaml)
[![release](https://badgen.net/github/release/3scale/saas-operator)](https://github.com/3scale-ops/saas-operator/releases)
[![license](https://badgen.net/github/license/3scale/saas-operator)](https://github.com/3scale-ops/saas-operator/LICENSE)

A Kubernetes Operator based on the Operator SDK to manage 3scale SaaS (hosted version) on **Kubernetes/OpenShift**.

Expand Down
63 changes: 31 additions & 32 deletions api/v1alpha1/apicast_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,29 @@ limitations under the License.
package v1alpha1

import (
"github.com/3scale/saas-operator/pkg/util"
"github.com/3scale-ops/basereconciler/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"
)

var (
apicastDefaultReplicas int32 = 2
apicastDefaultImage defaultImageSpec = defaultImageSpec{
Name: pointer.String("quay.io/3scale/apicast-cloud-hosted"),
Tag: pointer.String("latest"),
PullPolicy: (*corev1.PullPolicy)(pointer.String(string(corev1.PullIfNotPresent))),
Name: util.Pointer("quay.io/3scale/apicast-cloud-hosted"),
Tag: util.Pointer("latest"),
PullPolicy: (*corev1.PullPolicy)(util.Pointer(string(corev1.PullIfNotPresent))),
}
apicastDefaultLoadBalancer defaultLoadBalancerSpec = defaultLoadBalancerSpec{
ProxyProtocol: pointer.Bool(true),
CrossZoneLoadBalancingEnabled: pointer.Bool(true),
ConnectionDrainingEnabled: pointer.Bool(true),
ConnectionDrainingTimeout: pointer.Int32(60),
HealthcheckHealthyThreshold: pointer.Int32(2),
HealthcheckUnhealthyThreshold: pointer.Int32(2),
HealthcheckInterval: pointer.Int32(5),
HealthcheckTimeout: pointer.Int32(3),
ProxyProtocol: util.Pointer(true),
CrossZoneLoadBalancingEnabled: util.Pointer(true),
ConnectionDrainingEnabled: util.Pointer(true),
ConnectionDrainingTimeout: util.Pointer[int32](60),
HealthcheckHealthyThreshold: util.Pointer[int32](2),
HealthcheckUnhealthyThreshold: util.Pointer[int32](2),
HealthcheckInterval: util.Pointer[int32](5),
HealthcheckTimeout: util.Pointer[int32](3),
}
apicastDefaultResources defaultResourceRequirementsSpec = defaultResourceRequirementsSpec{
Requests: corev1.ResourceList{
Expand All @@ -53,31 +52,31 @@ var (
},
}
apicastDefaultHPA defaultHorizontalPodAutoscalerSpec = defaultHorizontalPodAutoscalerSpec{
MinReplicas: pointer.Int32(2),
MaxReplicas: pointer.Int32(4),
ResourceUtilization: pointer.Int32(90),
ResourceName: pointer.String("cpu"),
MinReplicas: util.Pointer[int32](2),
MaxReplicas: util.Pointer[int32](4),
ResourceUtilization: util.Pointer[int32](90),
ResourceName: util.Pointer("cpu"),
}
apicastDefaultLivenessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(5),
TimeoutSeconds: pointer.Int32(5),
PeriodSeconds: pointer.Int32(10),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
InitialDelaySeconds: util.Pointer[int32](5),
TimeoutSeconds: util.Pointer[int32](5),
PeriodSeconds: util.Pointer[int32](10),
SuccessThreshold: util.Pointer[int32](1),
FailureThreshold: util.Pointer[int32](3),
}
apicastDefaultReadinessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(5),
TimeoutSeconds: pointer.Int32(5),
PeriodSeconds: pointer.Int32(30),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
InitialDelaySeconds: util.Pointer[int32](5),
TimeoutSeconds: util.Pointer[int32](5),
PeriodSeconds: util.Pointer[int32](30),
SuccessThreshold: util.Pointer[int32](1),
FailureThreshold: util.Pointer[int32](3),
}
apicastDefaultPDB defaultPodDisruptionBudgetSpec = defaultPodDisruptionBudgetSpec{
MaxUnavailable: util.IntStrPtr(intstr.FromInt(1)),
MaxUnavailable: util.Pointer(intstr.FromInt(1)),
}
apicastDefaultGrafanaDashboard defaultGrafanaDashboardSpec = defaultGrafanaDashboardSpec{
SelectorKey: pointer.String("monitoring-key"),
SelectorValue: pointer.String("middleware"),
SelectorKey: util.Pointer("monitoring-key"),
SelectorValue: util.Pointer("middleware"),
}
apicastDefaultMarin3rSpec defaultMarin3rSidecarSpec = defaultMarin3rSidecarSpec{}
apicastDefaultLogLevel string = "warn"
Expand Down Expand Up @@ -227,8 +226,8 @@ type ApicastConfig struct {

// Default sets default values for any value not specifically set in the ApicastConfig struct
func (cfg *ApicastConfig) Default() {
cfg.LogLevel = stringOrDefault(cfg.LogLevel, pointer.String(apicastDefaultLogLevel))
cfg.OIDCLogLevel = stringOrDefault(cfg.OIDCLogLevel, pointer.String(apicastDefaultOIDCLogLevel))
cfg.LogLevel = stringOrDefault(cfg.LogLevel, util.Pointer(apicastDefaultLogLevel))
cfg.OIDCLogLevel = stringOrDefault(cfg.OIDCLogLevel, util.Pointer(apicastDefaultOIDCLogLevel))

}

Expand Down
55 changes: 27 additions & 28 deletions api/v1alpha1/autossl_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,29 @@ limitations under the License.
package v1alpha1

import (
"github.com/3scale/saas-operator/pkg/util"
"github.com/3scale-ops/basereconciler/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"
)

var (
autosslDefaultReplicas int32 = 2
autosslDefaultImage defaultImageSpec = defaultImageSpec{
Name: pointer.String("quay.io/3scale/autossl"),
Tag: pointer.String("latest"),
PullPolicy: (*corev1.PullPolicy)(pointer.String(string(corev1.PullIfNotPresent))),
Name: util.Pointer("quay.io/3scale/autossl"),
Tag: util.Pointer("latest"),
PullPolicy: (*corev1.PullPolicy)(util.Pointer(string(corev1.PullIfNotPresent))),
}
autosslDefaultLoadBalancer defaultLoadBalancerSpec = defaultLoadBalancerSpec{
ProxyProtocol: pointer.Bool(true),
CrossZoneLoadBalancingEnabled: pointer.Bool(true),
ConnectionDrainingEnabled: pointer.Bool(true),
ConnectionDrainingTimeout: pointer.Int32(60),
HealthcheckHealthyThreshold: pointer.Int32(2),
HealthcheckUnhealthyThreshold: pointer.Int32(2),
HealthcheckInterval: pointer.Int32(5),
HealthcheckTimeout: pointer.Int32(3),
ProxyProtocol: util.Pointer(true),
CrossZoneLoadBalancingEnabled: util.Pointer(true),
ConnectionDrainingEnabled: util.Pointer(true),
ConnectionDrainingTimeout: util.Pointer[int32](60),
HealthcheckHealthyThreshold: util.Pointer[int32](2),
HealthcheckUnhealthyThreshold: util.Pointer[int32](2),
HealthcheckInterval: util.Pointer[int32](5),
HealthcheckTimeout: util.Pointer[int32](3),
}
autosslDefaultResources defaultResourceRequirementsSpec = defaultResourceRequirementsSpec{
Requests: corev1.ResourceList{
Expand All @@ -53,25 +52,25 @@ var (
},
}
autosslDefaultHPA defaultHorizontalPodAutoscalerSpec = defaultHorizontalPodAutoscalerSpec{
MinReplicas: pointer.Int32(2),
MaxReplicas: pointer.Int32(4),
ResourceUtilization: pointer.Int32(90),
ResourceName: pointer.String("cpu"),
MinReplicas: util.Pointer[int32](2),
MaxReplicas: util.Pointer[int32](4),
ResourceUtilization: util.Pointer[int32](90),
ResourceName: util.Pointer("cpu"),
}
autosslDefaultProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(25),
TimeoutSeconds: pointer.Int32(1),
PeriodSeconds: pointer.Int32(10),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
InitialDelaySeconds: util.Pointer[int32](25),
TimeoutSeconds: util.Pointer[int32](1),
PeriodSeconds: util.Pointer[int32](10),
SuccessThreshold: util.Pointer[int32](1),
FailureThreshold: util.Pointer[int32](3),
}
autosslDefaultPDB defaultPodDisruptionBudgetSpec = defaultPodDisruptionBudgetSpec{
MaxUnavailable: util.IntStrPtr(intstr.FromInt(1)),
MaxUnavailable: util.Pointer(intstr.FromInt(1)),
}

autosslDefaultGrafanaDashboard defaultGrafanaDashboardSpec = defaultGrafanaDashboardSpec{
SelectorKey: pointer.String("monitoring-key"),
SelectorValue: pointer.String("middleware"),
SelectorKey: util.Pointer("monitoring-key"),
SelectorValue: util.Pointer("middleware"),
}
autosslDefaultACMEStaging bool = false
autosslDefaultRedisPort int32 = 6379
Expand Down Expand Up @@ -208,9 +207,9 @@ type AutoSSLConfig struct {

// Default sets default values for any value not specifically set in the AutoSSLConfig struct
func (cfg *AutoSSLConfig) Default() {
cfg.ACMEStaging = boolOrDefault(cfg.ACMEStaging, pointer.Bool(autosslDefaultACMEStaging))
cfg.RedisPort = intOrDefault(cfg.RedisPort, pointer.Int32(autosslDefaultRedisPort))
cfg.LogLevel = stringOrDefault(cfg.LogLevel, pointer.String(autosslDefaultLogLevel))
cfg.ACMEStaging = boolOrDefault(cfg.ACMEStaging, util.Pointer(autosslDefaultACMEStaging))
cfg.RedisPort = intOrDefault(cfg.RedisPort, util.Pointer[int32](autosslDefaultRedisPort))
cfg.LogLevel = stringOrDefault(cfg.LogLevel, util.Pointer(autosslDefaultLogLevel))
if cfg.DomainWhitelist == nil {
cfg.DomainWhitelist = []string{}
}
Expand Down
Loading

0 comments on commit a593141

Please sign in to comment.