From 97e3931208425c0ad48c1257fa3c182807233706 Mon Sep 17 00:00:00 2001 From: "assaf.admi" Date: Sun, 22 Sep 2024 11:38:26 +0300 Subject: [PATCH] Add official cluster shorthands to region flags --- CONTRIBUTING.md | 4 +- charts/coralogix-operator/templates/NOTES.txt | 2 +- .../templates/crds/coralogix.com_alerts.yaml | 20 ++++++---- .../coralogix.com_recordingrulegroupsets.yaml | 34 +++++++++-------- .../crds/coralogix.com_rulegroups.yaml | 26 +++++++------ config/crd/bases/coralogix.com_alerts.yaml | 20 ++++++---- .../bases/coralogix.com_outboundwebhooks.yaml | 20 ++++++---- .../coralogix.com_recordingrulegroupsets.yaml | 33 ++++++++-------- .../crd/bases/coralogix.com_rulegroups.yaml | 26 +++++++------ config/default/manager_auth_proxy_patch.yaml | 2 +- docs/api.md | 38 ++++++++++--------- main.go | 7 +++- 12 files changed, 132 insertions(+), 100 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc7ba3d..d02560e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ Add the region and api-key as environment variables (or later as flags). ```sh $ export CORALOGIX_API_KEY="xxx-xxx-xxx" -$ export CORALOGIX_REGION = "EUROPE2" +$ export CORALOGIX_REGION = "EU2" ``` Run the operator locally @@ -43,7 +43,7 @@ $ go run main.go ``` Or with `regin` and `api-key` flags ```sh -$ go run main.go -region EUROPE2 -api-key xxx-xxx-xxx +$ go run main.go -region EU2 -api-key xxx-xxx-xxx ``` For not running the prometheusRule controller set the `prometheus-rule-controller` flag to `false` ```sh diff --git a/charts/coralogix-operator/templates/NOTES.txt b/charts/coralogix-operator/templates/NOTES.txt index a54230e..6a80a47 100644 --- a/charts/coralogix-operator/templates/NOTES.txt +++ b/charts/coralogix-operator/templates/NOTES.txt @@ -7,5 +7,5 @@ {{ end }} {{- if (eq .Values.coralogixOperator.region "") }} -{{ fail "[ERROR] 'coralogixOperator.region' must be set. Please select one of APAC1,APAC2,EUROPE1,EUROPE2,USA1,USA2 regions. See https://coralogix.com/docs/coralogix-domain/ for more information." }} +{{ fail "[ERROR] 'coralogixOperator.region' must be set. Please select one of APAC1,AP1,APAC2,AP2,EUROPE1,EU1,EUROPE2,EU2,USA1,US1,USA2,US2 regions. See https://coralogix.com/docs/coralogix-domain/ for more information." }} {{ end }} diff --git a/charts/coralogix-operator/templates/crds/coralogix.com_alerts.yaml b/charts/coralogix-operator/templates/crds/coralogix.com_alerts.yaml index 4558ff0..d693c86 100644 --- a/charts/coralogix-operator/templates/crds/coralogix.com_alerts.yaml +++ b/charts/coralogix-operator/templates/crds/coralogix.com_alerts.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: alerts.coralogix.com spec: group: coralogix.com @@ -21,14 +20,19 @@ spec: description: Alert is the Schema for the alerts API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/charts/coralogix-operator/templates/crds/coralogix.com_recordingrulegroupsets.yaml b/charts/coralogix-operator/templates/crds/coralogix.com_recordingrulegroupsets.yaml index 8325b22..3311b0c 100644 --- a/charts/coralogix-operator/templates/crds/coralogix.com_recordingrulegroupsets.yaml +++ b/charts/coralogix-operator/templates/crds/coralogix.com_recordingrulegroupsets.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: recordingrulegroupsets.coralogix.com spec: group: coralogix.com @@ -22,14 +21,19 @@ spec: API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -42,15 +46,14 @@ spec: intervalSeconds: default: 60 format: int32 - minimum: 60 type: integer limit: format: int64 type: integer name: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state - of cluster Important: Run "make" to regenerate code after - modifying this file' + description: |- + INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file type: string rules: items: @@ -81,15 +84,14 @@ spec: intervalSeconds: default: 60 format: int32 - minimum: 60 type: integer limit: format: int64 type: integer name: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state - of cluster Important: Run "make" to regenerate code after - modifying this file' + description: |- + INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file type: string rules: items: diff --git a/charts/coralogix-operator/templates/crds/coralogix.com_rulegroups.yaml b/charts/coralogix-operator/templates/crds/coralogix.com_rulegroups.yaml index 1fe5926..33122cf 100644 --- a/charts/coralogix-operator/templates/crds/coralogix.com_rulegroups.yaml +++ b/charts/coralogix-operator/templates/crds/coralogix.com_rulegroups.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: rulegroups.coralogix.com spec: group: coralogix.com @@ -21,14 +20,19 @@ spec: description: RuleGroup is the Schema for the rulegroups API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -248,9 +252,9 @@ spec: hidden: type: boolean id: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file' + description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file type: string name: type: string diff --git a/config/crd/bases/coralogix.com_alerts.yaml b/config/crd/bases/coralogix.com_alerts.yaml index 4558ff0..d693c86 100644 --- a/config/crd/bases/coralogix.com_alerts.yaml +++ b/config/crd/bases/coralogix.com_alerts.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: alerts.coralogix.com spec: group: coralogix.com @@ -21,14 +20,19 @@ spec: description: Alert is the Schema for the alerts API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/config/crd/bases/coralogix.com_outboundwebhooks.yaml b/config/crd/bases/coralogix.com_outboundwebhooks.yaml index d6d8d2b..af1f86a 100644 --- a/config/crd/bases/coralogix.com_outboundwebhooks.yaml +++ b/config/crd/bases/coralogix.com_outboundwebhooks.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: outboundwebhooks.coralogix.com spec: group: coralogix.com @@ -21,14 +20,19 @@ spec: description: OutboundWebhook is the Schema for the outboundwebhooks API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/config/crd/bases/coralogix.com_recordingrulegroupsets.yaml b/config/crd/bases/coralogix.com_recordingrulegroupsets.yaml index 4c87274..3311b0c 100644 --- a/config/crd/bases/coralogix.com_recordingrulegroupsets.yaml +++ b/config/crd/bases/coralogix.com_recordingrulegroupsets.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: recordingrulegroupsets.coralogix.com spec: group: coralogix.com @@ -22,14 +21,19 @@ spec: API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -47,9 +51,9 @@ spec: format: int64 type: integer name: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state - of cluster Important: Run "make" to regenerate code after - modifying this file' + description: |- + INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file type: string rules: items: @@ -80,15 +84,14 @@ spec: intervalSeconds: default: 60 format: int32 - minimum: 60 type: integer limit: format: int64 type: integer name: - description: 'INSERT ADDITIONAL SPEC FIELDS - desired state - of cluster Important: Run "make" to regenerate code after - modifying this file' + description: |- + INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file type: string rules: items: diff --git a/config/crd/bases/coralogix.com_rulegroups.yaml b/config/crd/bases/coralogix.com_rulegroups.yaml index 1fe5926..33122cf 100644 --- a/config/crd/bases/coralogix.com_rulegroups.yaml +++ b/config/crd/bases/coralogix.com_rulegroups.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: rulegroups.coralogix.com spec: group: coralogix.com @@ -21,14 +20,19 @@ spec: description: RuleGroup is the Schema for the rulegroups API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -248,9 +252,9 @@ spec: hidden: type: boolean id: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file' + description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file type: string name: type: string diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 320b0f5..2efacd6 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -54,4 +54,4 @@ spec: - "--metrics-bind-address=127.0.0.1:8080" - "--leader-elect" - "--api-key=xxx" - - "--region=EUROPE2" + - "--region=EU2" diff --git a/docs/api.md b/docs/api.md index c777cbd..f125d05 100644 --- a/docs/api.md +++ b/docs/api.md @@ -5122,26 +5122,26 @@ OutboundWebhookSpec defines the desired state of OutboundWebhook - attachments - []object + url + string
true - digests + attachments []object
- true + false - url - string + digests + []object
- true + false @@ -5719,26 +5719,26 @@ OutboundWebhookStatus defines the observed state of OutboundWebhook - attachments - []object + url + string
true - digests + attachments []object
- true + false - url - string + digests + []object
- true + false @@ -5930,7 +5930,8 @@ RecordingRuleGroupSetSpec defines the desired state of RecordingRuleGroupSet name string - INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run "make" to regenerate code after modifying this file
+ INSERT ADDITIONAL SPEC FIELDS - desired state of cluster +Important: Run "make" to regenerate code after modifying this file
false @@ -6043,7 +6044,6 @@ RecordingRuleGroupSetStatus defines the observed state of RecordingRuleGroupSet
Format: int32
Default: 60
- Minimum: 60
false @@ -6059,7 +6059,8 @@ RecordingRuleGroupSetStatus defines the observed state of RecordingRuleGroupSet name string - INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run "make" to regenerate code after modifying this file
+ INSERT ADDITIONAL SPEC FIELDS - desired state of cluster +Important: Run "make" to regenerate code after modifying this file
false @@ -6814,7 +6815,8 @@ RuleGroupStatus defines the observed state of RuleGroup id string - INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying this file
+ INSERT ADDITIONAL STATUS FIELD - define observed state of cluster +Important: Run "make" to regenerate code after modifying this file
true diff --git a/main.go b/main.go index 8b48a0e..486c48d 100644 --- a/main.go +++ b/main.go @@ -49,12 +49,17 @@ var ( setupLog = ctrl.Log.WithName("setup") regionToGrpcUrl = map[string]string{ "APAC1": "ng-api-grpc.app.coralogix.in:443", + "AP1": "ng-api-grpc.app.coralogix.in:443", "APAC2": "ng-api-grpc.coralogixsg.com:443", + "AP2": "ng-api-grpc.coralogixsg.com:443", "EUROPE1": "ng-api-grpc.coralogix.com:443", + "EU1": "ng-api-grpc.coralogix.com:443", "EUROPE2": "ng-api-grpc.eu2.coralogix.com:443", + "EU2": "ng-api-grpc.eu2.coralogix.com:443", "USA1": "ng-api-grpc.coralogix.us:443", - "STG": "ng-api-grpc.app.staging.coralogix.net:443", + "US1": "ng-api-grpc.coralogix.us:443", "USA2": "ng-api-grpc.cx498.coralogix.com:443", + "US2": "ng-api-grpc.cx498.coralogix.com:443", } validRegions = utils.GetKeys(regionToGrpcUrl) )