Skip to content

Commit

Permalink
feat(operator): add 'allowPastTimestamps' property on ledger configur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
gfyrag committed Jun 5, 2023
1 parent 1f49bda commit 11672f4
Show file tree
Hide file tree
Showing 57 changed files with 2,219 additions and 63 deletions.
2 changes: 2 additions & 0 deletions components/operator/apis/stack/v1beta3/ledger_types.go
Expand Up @@ -19,4 +19,6 @@ type LockingStrategyRedisConfig struct {
// +kubebuilder:object:generate=true
type LedgerSpec struct {
Postgres PostgresConfig `json:"postgres"`
// +optional
AllowPastTimestamps bool `json:"allowPastTimestamps"`
}
Expand Up @@ -4250,6 +4250,8 @@ spec:
type: object
ledger:
properties:
allowPastTimestamps:
type: boolean
postgres:
properties:
disableSSLMode:
Expand Down
Expand Up @@ -4261,6 +4261,8 @@ spec:
type: object
ledger:
properties:
allowPastTimestamps:
type: boolean
postgres:
properties:
disableSSLMode:
Expand Down
Expand Up @@ -82,6 +82,14 @@ var _ = Describe("When creating a stack", func() {
It("should be ok", func() {
verifyResources(stack, "monopod")
})
Context("and ledger v1", func() {
BeforeEach(func() {
versions.Spec.Ledger = "v1.0.0"
})
It("should be ok", func() {
verifyResources(stack, "monopod-ledgerv1")
})
})
})
})

Expand Down
3 changes: 2 additions & 1 deletion components/operator/internal/controllers/stack/suite_test.go
Expand Up @@ -147,7 +147,8 @@ func NewDumbConfiguration() *v1beta3.Configuration {
},
Control: v1beta3.ControlSpec{},
Ledger: v1beta3.LedgerSpec{
Postgres: NewPostgresConfig(),
Postgres: NewPostgresConfig(),
AllowPastTimestamps: true,
},
Payments: v1beta3.PaymentsSpec{
Postgres: NewPostgresConfig(),
Expand Down
@@ -0,0 +1,51 @@
apiVersion: v1
data:
config.yaml: |
clients:
- public: false
description: null
redirectUris:
- http://example.net/auth/login
PostLogoutRedirectUris:
- http://example.net/auth/destroy
scopes:
- openid
- profile
- email
- offline
id: control
secrets:
- mocked-secret
- public: false
description: null
redirectUris: []
PostLogoutRedirectUris: []
scopes:
- openid
id: orchestration
secrets:
- mocked-secret
- public: false
description: null
redirectUris: []
PostLogoutRedirectUris: []
scopes:
- openid
id: stargate
secrets:
- mocked-secret
- public: false
description: null
redirectUris: []
PostLogoutRedirectUris: []
scopes:
- openid
id: wallets
secrets:
- mocked-secret
kind: ConfigMap
metadata:
labels:
stack: "true"
name: auth-config
namespace: orga2-stack2
@@ -0,0 +1,106 @@
apiVersion: v1
data:
Caddyfile: |-
(cors) {
header {
Access-Control-Allow-Methods "GET,OPTIONS,PUT,POST,DELETE,HEAD,PATCH"
Access-Control-Allow-Headers content-type
Access-Control-Max-Age 100
Access-Control-Allow-Origin *
}
}
(handle_route_without_auth) {
# handle does not strips the prefix from the request path
handle {args.0}/* {
reverse_proxy {args.1}
import cors
}
}
(handle_path_route_with_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
import auth
}
}
(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}
import cors
}
}
(auth) {
auth {
issuer http://example.net/api/auth
read_key_set_max_retries 10
}
}
{
# Many directives manipulate the HTTP handler chain and the order in which
# those directives are evaluated matters. So the jwtauth directive must be
# ordered.
# c.f. https://caddyserver.com/docs/caddyfile/directives#directive-order
order auth before basicauth
order versions after metrics
}
:8000 {
tracing {
span gateway
}
log {
output stdout
}
import handle_path_route_without_auth /api/auth 127.0.0.1:10001
import handle_path_route_with_auth /api/ledger 127.0.0.1:10002
import handle_path_route_with_auth /api/orchestration 127.0.0.1:8080
import handle_path_route_with_auth /api/payments 127.0.0.1:10003
import handle_path_route_with_auth /api/search 127.0.0.1:10004
import handle_path_route_with_auth /api/search-benthos 127.0.0.1:4195
import handle_path_route_with_auth /api/stargate 127.0.0.1:10005
import handle_path_route_with_auth /api/wallets 127.0.0.1:10006
import handle_path_route_with_auth /api/webhooks 127.0.0.1:10007
handle /versions {
versions {
region "us-west-1"
env "staging"
endpoints {
auth http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck
ledger http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck
orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck
payments http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health
search http://127.0.0.1:10004/_info http://127.0.0.1:10004/_healthcheck
stargate http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck
wallets http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck
webhooks http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck
}
}
}
# handle all other requests
handle {
reverse_proxy control:3000
import cors
}
}
kind: ConfigMap
metadata:
labels:
stack: "true"
name: gateway-config
namespace: orga2-stack2
@@ -0,0 +1,18 @@
apiVersion: v1
data:
config.yaml: |
---
tracer:
open_telemetry_collector:
tags:
service.name: search-ingester
service.version: latest
grpc:
- url: ${OTEL_TRACES_EXPORTER_OTLP_ENDPOINT}
# a useless comment
kind: ConfigMap
metadata:
labels:
stack: "true"
name: search-benthos-global
namespace: orga2-stack2
@@ -0,0 +1,31 @@
apiVersion: v1
data:
output_elasticsearch.yaml: |
output_resources:
- label: elasticsearch
broker:
outputs:
- elasticsearch:
urls:
- ${OPENSEARCH_URL}
id: ${!meta("id")}
sniff: false
healthcheck: false
index: ${OPENSEARCH_INDEX}
action: ${!meta("action")}
tls:
enabled: true
skip_cert_verify: true
basic_auth:
enabled: ${BASIC_AUTH_ENABLED}
username: ${BASIC_AUTH_USERNAME}
password: ${BASIC_AUTH_PASSWORD}
batching:
count: ${OPENSEARCH_BATCHING_COUNT}
period: ${OPENSEARCH_BATCHING_PERIOD}
kind: ConfigMap
metadata:
labels:
stack: "true"
name: search-benthos-resources
namespace: orga2-stack2

1 comment on commit 11672f4

@vercel
Copy link

@vercel vercel bot commented on 11672f4 Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.