Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update missing files #2485

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions adapter/internal/operator/config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ webhooks:
resources:
- interceptorservices
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: mratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down Expand Up @@ -430,6 +450,26 @@ webhooks:
resources:
- interceptorservices
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: vratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down
2 changes: 1 addition & 1 deletion common-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/pelletier/go-toml v1.9.5
github.com/redis/go-redis/v9 v9.2.1
github.com/wso2/apk/adapter v0.0.0-20231214082511-af2c8b8a19f1
github.com/wso2/apk/common-go-libs v0.0.0-20240304050809-a382bc6b0d82
github.com/wso2/apk/common-go-libs v0.0.0-20240923143402-ff7fdb0366f9
google.golang.org/grpc v1.65.0
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ webhooks:
resources:
- interceptorservices
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: mratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down Expand Up @@ -430,6 +450,26 @@ webhooks:
resources:
- interceptorservices
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: vratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down
5 changes: 5 additions & 0 deletions common-controller/internal/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ func InitOperator(metricsConfig config.Metrics) {
"Unable to create webhook for Ratelimit, error: %v", err))
}

if err = (&dpv1alpha3.RateLimitPolicy{}).SetupWebhookWithManager(mgr); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2637, logging.MAJOR,
"Unable to create webhook for Ratelimit, error: %v", err))
}

if err = (&dpv1alpha3.APIPolicy{}).SetupWebhookWithManager(mgr); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2638, logging.MAJOR,
"Unable to create webhook for APIPolicy, error: %v", err))
Expand Down
40 changes: 40 additions & 0 deletions common-go-libs/config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,46 @@ webhooks:
resources:
- interceptorservices
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: mratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: mratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- ratelimitpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ webhooks:
service:
name: {{ template "apk-helm.resource.prefix" . }}-common-controller-service
namespace: {{ .Release.Namespace }}
path: /mutate-dp-wso2-com-v1alpha1-ratelimitpolicy
path: /mutate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: mratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha1
- v1alpha3
operations:
- CREATE
- UPDATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ webhooks:
service:
name: {{ template "apk-helm.resource.prefix" . }}-common-controller-service
namespace: {{ .Release.Namespace }}
path: /validate-dp-wso2-com-v1alpha1-ratelimitpolicy
path: /validate-dp-wso2-com-v1alpha3-ratelimitpolicy
failurePolicy: Fail
name: vratelimitpolicy.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha1
- v1alpha3
operations:
- CREATE
- UPDATE
Expand Down
24 changes: 22 additions & 2 deletions test/cucumber-tests/CRs/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ spec:


---
apiVersion: "dp.wso2.com/v1alpha1"
apiVersion: "dp.wso2.com/v1alpha3"
kind: "RateLimitPolicy"
metadata:
name: "api-subscription-ratelimit"
Expand Down Expand Up @@ -912,10 +912,30 @@ spec:
name: "Semantic Versioning API"
version: "v\\d+(\\.\\d+)?"
ratelimitRef:
name: api-subscription-ratelimit
name: api--sem-subscription-ratelimit
level: application

---
apiVersion: "dp.wso2.com/v1alpha3"
kind: "RateLimitPolicy"
metadata:
name: "api--sem-subscription-ratelimit"
spec:
override:
subscription:
stopOnQuotaReach: true
organization: "default"
requestCount:
requestsPerUnit: 50
unit: "Minute"
burstControl:
requestsPerUnit: 50
unit: "Minute"
targetRef:
kind: Subscription
name: "7416c241a121b844392d447f00ff6709cb9c932b"
group: gateway.networking.k8s.io
---
apiVersion: cp.wso2.com/v1alpha2
kind: ApplicationMapping
metadata:
Expand Down
Loading