Skip to content

Commit 9978771

Browse files
authored
feat(observability-proxy): serve tenant namespace logs through an authorizing proxy (#5214)
## What this PR does Adds `observability-proxy`, a new system component that lets a tenant user read the logs of their own namespace from VictoriaLogs with the same Kubernetes credentials they already use for the console, and with Kubernetes RBAC deciding what they can read. This is the first part of the design proposals [Tenant application logs](cozystack/community#95) and [Tenant resource-consumption metrics](cozystack/community#94); this PR implements the namespace logs root only. Metrics and the per-application roots follow in separate PRs. Why a proxy: today the log stores are shared per root tenant and have no notion of a caller, so tenants cannot be given direct read access without seeing other tenants' logs. The proxy authenticates the caller, authorizes the request from its path, and rebuilds the upstream query so that its scope cannot be widened by the client. Backward compatibility: this adds a new package and a new HelmRelease; nothing existing is renamed, removed or changed, so no migration is needed. What is included: - `cmd/observability-proxy` and `internal/observabilityproxy`: the proxy. - Serves `/apis/cozystack.io/v1alpha1/namespaces/<ns>/logs/select/logsql/<endpoint>` for the VictoriaLogs read endpoints the console needs (`query`, `hits`, `stats_query_range`, `tail`, `field_values`, `stream_field_values`, `facets`). Anything else under the root answers `404`. - Authentication by `TokenReview`, authorization by one `SubjectAccessReview` built from the path (`list` on `cozystack.io/logs` in the namespace), both cached briefly. - The upstream request is rebuilt from an allowlist of parameters; the namespace scope is always forced as `extra_stream_filters`. Client-supplied `extra_filters`, `extra_stream_filters`, any LogsQL `options(...)` block, and tenant headers such as `AccountID`/`ProjectID` are not forwarded or are refused. - Non-canonical paths (`..`, `//`, encoded separators) are refused with `400` before any authorization is built, because the console nginx matches on the normalized path but forwards the raw one. - Time window, step, bucket count and result limits are clamped; per-user rate, concurrency and open-tail limits answer `429`. Invalid time, step and limit parameters answer `400`. - The store is resolved from the namespace's `namespace.cozystack.io/monitoring` label. - Live `tail` streams are passed through unbuffered, and the upstream tail request disables compression so headers reach the client before the first line. - `packages/system/observability-proxy`: chart and image build, wired into the root `make build`. - Platform wiring: a new `cozystack.observability-proxy` PackageSource, enabled by default on the full variants and opt-in on the slim ones, the same way as `monitoring-agents`. - RBAC: an aggregated `cozy:observability:view` ClusterRole grants `list` on `cozystack.io/logs` to tenant `view` and above. No API server serves this resource; the rule exists only for the proxy's `SubjectAccessReview`. The proxy's own ClusterRole is limited to the calls it makes (`tokenreviews`, `subjectaccessreviews`, `list`/`watch` on namespaces). - Console nginx: when the proxy is not installed or cannot be reached, the observability roots answer `404` with a Kubernetes `Status` body, which the console shows as not available on this cluster; the proxy's own `502`/`504` for an unreachable store pass through unchanged. - Console: one regex `location` in the console nginx routes the four observability roots to the proxy ahead of `/apis`. The upstream is resolved at request time, so the console starts even when the proxy is not installed; those paths then answer `404` with a Kubernetes `Status` body. The console Deployment now receives the cluster domain for that resolution. - E2E: a new Chainsaw suite `hack/e2e-chainsaw/observability-proxy/` with two tenants, covering `401`/`403`/`200`, scope-widening attempts, path normalization and a long-lived `tail`. #### How it was tested - `go test -race` and `go vet` for the proxy packages. - helm-unittest for `observability-proxy`, `dashboard`, `tenant` and `core/platform`; bats tests for the console nginx routing. - The Chainsaw suite was not run as-is: it deploys its own VictoriaLogs as the root store and refuses to run when a real one exists. Its cases were replayed by a script against the real store on a test cluster. - Verified on a test cluster: - `401` without a token and with an invalid token, `403` for another tenant's namespace, `200` for the caller's own. - Client `extra_stream_filters`/`extra_filters` (GET and POST), an `AccountID` header and another tenant's stream named inside the query do not widen the scope; `options(...)` answers `400`; a path with `..` pointing at another tenant answers `400`; an endpoint outside the allowlist answers `404`. - Through the full browser chain (OIDC login, gatekeeper, gateway, console nginx), a single `tail` stayed open for more than two minutes without reconnecting, and requests from the same session to other tenants' roots answered `403`. - Not verified: the `429` limits under real load. `golangci-lint` has not been run locally. #### Known limitations - The proxy is reachable only through the console route; tenant workloads have no egress rule to it. Every request takes its concurrency or tail slot before the body is read; the token and access reviews and the body read run under `--request-timeout`, so a stalled kube-apiserver answers `503` rather than holding the request; and writes to the client carry a deadline (renewed per line for tails). `--request-timeout=0` disables those bounds and should not be used in production. - The first lines a newly started pod writes can be missing from an already open `tail`, although they are in the store. The likely cause is that Fluent Bit picks up a new log file later than the VictoriaLogs live-tail window; later lines of the same pod arrive. A history query shows them. - The per-application roots (`.../<plural>/<name>/log`, `.../metrics`) and the namespace metrics root answer `404` in this PR. ### Screenshots No UI changes. ### Downstream repositories - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: cozystack/website#787 (docs land once the implementation PRs merge) - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: Downstream: `cozystack/website` is reached. A new platform component (`packages/core/platform/sources/observability-proxy.yaml`) triggers `content/en/docs/next/guides/platform-stack/_index.md` and `operations/configuration/licenses.md`; adding it to the system bundle (`packages/core/platform/templates/bundles/system.yaml`) may also need a line in `operations/configuration/variants.md`. A user-facing page for the logs API and the new tenant `view` permission is not required by the trigger map but would be useful. Tracked in cozystack/website#787. Other repositories: no trigger matched. `packages/core/platform/values.yaml` is not changed (only a test fixture), no package under `packages/apps/` gains a values field, and no CRD changes. The root `Makefile` `build` target builds one more image; this does not touch `hack/` or the make targets `ccp` relies on, so `ccp` is not considered affected, but a reviewer may want to confirm. ### Release note ```release-note feat(observability-proxy): add an authorizing proxy that lets tenant users read their namespace logs from VictoriaLogs with their Kubernetes credentials, under `/apis/cozystack.io/v1alpha1/namespaces/<ns>/logs/`. Access requires the tenant `view` role or higher. The component is enabled by default on full variants and opt-in on slim variants. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added an observability proxy for tenant-scoped log access through the console, including live log streaming. Requests are authenticated, access-controlled, and subject to configurable rate and concurrency limits. * Added platform packaging and deployment support, with console routing for observability requests. * **Tests** * Added automated coverage for access control, tenant scoping, query handling, streaming, proxy behavior, and deployment configuration. * **Documentation** * Updated end-to-end test guidance with host requirements for running the observability proxy suite. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 3b4db69 + fb5ac18 commit 9978771

44 files changed

Lines changed: 4931 additions & 5 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _repos
2323
/flux-shard-operator
2424
/kubeovn-plunger
2525
/lineage-controller-webhook
26+
/observability-proxy
2627
/securitygroup-controller
2728

2829
# User-specific stuff

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build: build-deps
1717
make -C packages/system/cozystack-api image
1818
make -C packages/system/cozystack-controller image
1919
make -C packages/system/backup-controller image
20+
make -C packages/system/observability-proxy image
2021
make -C packages/system/backupstrategy-controller image
2122
make -C packages/system/lineage-controller-webhook image
2223
make -C packages/system/migration-controller image

‎cmd/observability-proxy/main.go‎

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
/*
2+
Copyright 2026 The Cozystack Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Command observability-proxy serves tenant logs from the VictoriaLogs
18+
// stores behind a Kubernetes TokenReview and SubjectAccessReview, with the
19+
// tenant's namespace scope forced into every upstream request.
20+
package main
21+
22+
import (
23+
"context"
24+
"errors"
25+
"flag"
26+
"fmt"
27+
"io"
28+
"log/slog"
29+
"math"
30+
"net/http"
31+
"os"
32+
"os/signal"
33+
"sync/atomic"
34+
"syscall"
35+
"time"
36+
37+
"github.com/prometheus/client_golang/prometheus"
38+
"github.com/prometheus/client_golang/prometheus/collectors"
39+
"github.com/prometheus/client_golang/prometheus/promhttp"
40+
"k8s.io/client-go/informers"
41+
"k8s.io/client-go/kubernetes"
42+
"k8s.io/client-go/tools/cache"
43+
"k8s.io/client-go/tools/clientcmd"
44+
45+
"github.com/cozystack/cozystack/internal/observabilityproxy"
46+
)
47+
48+
type options struct {
49+
listenAddress string
50+
probeAddress string
51+
clusterDomain string
52+
rootTenant string
53+
kubeconfig string
54+
authCacheTTL time.Duration
55+
requestTimeout time.Duration
56+
tailIdleTimeout time.Duration
57+
shutdownTimeout time.Duration
58+
logs observabilityproxy.LogsLimits
59+
limiter observabilityproxy.LimiterConfig
60+
}
61+
62+
func parseFlags(args []string) (options, error) {
63+
var o options
64+
fs := flag.NewFlagSet("observability-proxy", flag.ContinueOnError)
65+
fs.SetOutput(io.Discard)
66+
fs.StringVar(&o.listenAddress, "listen-address", ":8080", "address of the API listener")
67+
fs.StringVar(&o.probeAddress, "probe-address", ":8081", "address serving /healthz, /readyz and /metrics")
68+
fs.StringVar(&o.clusterDomain, "cluster-domain", "cozy.local", "cluster DNS domain used to reach the stores")
69+
fs.StringVar(&o.rootTenant, "root-tenant", "tenant-root", "tenant namespace hosting the default store")
70+
fs.StringVar(&o.kubeconfig, "kubeconfig", "", "kubeconfig path; in-cluster config when empty")
71+
fs.DurationVar(&o.authCacheTTL, "auth-cache-ttl", 10*time.Second, "how long TokenReview and SubjectAccessReview answers are cached")
72+
fs.DurationVar(&o.requestTimeout, "request-timeout", time.Minute, "deadline for reading the request body, the token and access reviews, and every upstream endpoint but tail; 0 disables it")
73+
fs.DurationVar(&o.tailIdleTimeout, "tail-idle-timeout", 5*time.Minute, "close a tail after this long without a line")
74+
fs.DurationVar(&o.shutdownTimeout, "shutdown-timeout", 15*time.Second, "grace period for in-flight requests on shutdown")
75+
fs.DurationVar(&o.logs.DefaultRange, "logs-default-range", time.Hour, "window used when a logs request has no start")
76+
// One week covers an incident investigation and keeps a single query
77+
// to a fraction of the default one-month log retention.
78+
fs.DurationVar(&o.logs.MaxRange, "logs-max-range", 7*24*time.Hour, "longest [start, end] a logs request may span; wider windows are clamped")
79+
// Prometheus's cap on points per series in a range query.
80+
fs.IntVar(&o.logs.MaxBuckets, "logs-max-buckets", 11000, "most buckets hits and stats_query_range may return over a window")
81+
fs.IntVar(&o.logs.DefaultLimit, "logs-default-limit", 1000, "entries returned when a request sets no limit")
82+
fs.IntVar(&o.logs.MaxLimit, "logs-max-limit", 10000, "largest limit a request may set")
83+
fs.DurationVar(&o.logs.MaxTailResume, "logs-max-tail-resume", 15*time.Minute, "how far back a tail may resume with since or start_offset")
84+
fs.IntVar(&o.limiter.MaxConcurrentPerUser, "max-concurrent-per-user", 10, "concurrent non-tail requests per user; 0 disables")
85+
fs.Float64Var(&o.limiter.RatePerUser, "rate-limit-per-user", 10, "sustained requests per second per user; 0 disables")
86+
fs.IntVar(&o.limiter.RateBurst, "rate-limit-burst", 20, "request burst per user")
87+
fs.IntVar(&o.limiter.MaxTailsPerUser, "max-tails-per-user", 5, "open tails per user; 0 disables")
88+
fs.IntVar(&o.limiter.MaxTails, "max-tails", 200, "open tails in total; 0 disables")
89+
if err := fs.Parse(args); err != nil {
90+
return o, err
91+
}
92+
// Parsing stops at the first non-flag, so every flag after it would
93+
// be dropped silently.
94+
if fs.NArg() > 0 {
95+
return o, fmt.Errorf("unexpected argument %q", fs.Arg(0))
96+
}
97+
switch {
98+
case o.rootTenant == "":
99+
return o, errors.New("--root-tenant must not be empty")
100+
case o.clusterDomain == "":
101+
return o, errors.New("--cluster-domain must not be empty")
102+
case o.logs.DefaultRange <= 0 || o.logs.MaxRange < o.logs.DefaultRange:
103+
return o, errors.New("--logs-default-range must be positive and not above --logs-max-range")
104+
// Below four buckets (three steps once one is held back for
105+
// alignment), or a range under three seconds, the step cap that keeps
106+
// vlselect's step alignment inside the range cannot hold.
107+
case o.logs.MaxBuckets < 4:
108+
return o, errors.New("--logs-max-buckets must be at least 4")
109+
case o.logs.MaxRange < 3*time.Second:
110+
return o, errors.New("--logs-max-range must be at least 3s")
111+
case o.logs.DefaultLimit <= 0 || o.logs.MaxLimit < o.logs.DefaultLimit:
112+
return o, errors.New("--logs-default-limit must be positive and not above --logs-max-limit")
113+
case o.logs.MaxTailResume < 0:
114+
return o, errors.New("--logs-max-tail-resume must not be negative")
115+
case o.requestTimeout < 0 || o.tailIdleTimeout < 0 || o.authCacheTTL < 0 || o.shutdownTimeout < 0:
116+
return o, errors.New("timeouts and the auth cache TTL must not be negative")
117+
// NaN passes every comparison and +Inf never empties a bucket; either
118+
// would switch the rate limit off without saying so.
119+
case math.IsNaN(o.limiter.RatePerUser) || math.IsInf(o.limiter.RatePerUser, 0):
120+
return o, errors.New("--rate-limit-per-user must be a finite number")
121+
case o.limiter.RatePerUser < 0 || o.limiter.RateBurst < 0 || o.limiter.MaxConcurrentPerUser < 0 ||
122+
o.limiter.MaxTailsPerUser < 0 || o.limiter.MaxTails < 0:
123+
return o, errors.New("limits must not be negative; 0 disables a limit")
124+
}
125+
return o, nil
126+
}
127+
128+
func main() {
129+
slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stderr, nil)))
130+
o, err := parseFlags(os.Args[1:])
131+
if err != nil {
132+
fmt.Fprintf(os.Stderr, "observability-proxy: %v\n", err)
133+
os.Exit(2)
134+
}
135+
if err := run(o); err != nil {
136+
slog.Error("exiting", "error", err)
137+
os.Exit(1)
138+
}
139+
}
140+
141+
func run(o options) error {
142+
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
143+
defer stop()
144+
145+
restConfig, err := clientcmd.BuildConfigFromFlags("", o.kubeconfig)
146+
if err != nil {
147+
return fmt.Errorf("loading kubeconfig: %w", err)
148+
}
149+
client, err := kubernetes.NewForConfig(restConfig)
150+
if err != nil {
151+
return fmt.Errorf("building client: %w", err)
152+
}
153+
154+
factory := informers.NewSharedInformerFactory(client, 0)
155+
namespaces := factory.Core().V1().Namespaces()
156+
lister := namespaces.Lister()
157+
factory.Start(ctx.Done())
158+
var ready atomic.Bool
159+
go func() {
160+
if cache.WaitForCacheSync(ctx.Done(), namespaces.Informer().HasSynced) {
161+
ready.Store(true)
162+
}
163+
}()
164+
165+
reg := prometheus.NewRegistry()
166+
reg.MustRegister(collectors.NewGoCollector(), collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
167+
proxy := observabilityproxy.NewServer(observabilityproxy.Config{
168+
ClusterDomain: o.clusterDomain,
169+
Logs: o.logs,
170+
Limiter: o.limiter,
171+
RequestTimeout: o.requestTimeout,
172+
TailIdleTimeout: o.tailIdleTimeout,
173+
}, observabilityproxy.NewAuthorizer(client, o.authCacheTTL), observabilityproxy.NewStoreResolver(lister, namespaces.Informer().HasSynced, o.rootTenant), reg)
174+
175+
probes := http.NewServeMux()
176+
probes.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) { _, _ = io.WriteString(w, "ok") })
177+
probes.HandleFunc("/readyz", func(w http.ResponseWriter, _ *http.Request) {
178+
if !ready.Load() {
179+
http.Error(w, "namespace cache not synced", http.StatusServiceUnavailable)
180+
return
181+
}
182+
_, _ = io.WriteString(w, "ok")
183+
})
184+
probes.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{}))
185+
186+
// No WriteTimeout on the API listener: it would cut live tails, which
187+
// the handler bounds with its own idle timeout instead.
188+
servers := []*http.Server{
189+
{Addr: o.listenAddress, Handler: proxy, ReadHeaderTimeout: 10 * time.Second, IdleTimeout: 2 * time.Minute},
190+
{Addr: o.probeAddress, Handler: probes, ReadHeaderTimeout: 10 * time.Second},
191+
}
192+
errs := make(chan error, len(servers))
193+
for _, srv := range servers {
194+
go func() {
195+
slog.Info("listening", "address", srv.Addr)
196+
if err := srv.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) {
197+
errs <- err
198+
}
199+
}()
200+
}
201+
202+
var runErr error
203+
select {
204+
case <-ctx.Done():
205+
case runErr = <-errs:
206+
}
207+
stop()
208+
shutdownCtx, cancel := context.WithTimeout(context.Background(), o.shutdownTimeout)
209+
defer cancel()
210+
for _, srv := range servers {
211+
if err := srv.Shutdown(shutdownCtx); err != nil {
212+
// Open tails never go idle on their own; cut them so clients
213+
// reconnect with since to another replica.
214+
_ = srv.Close()
215+
}
216+
}
217+
return runErr
218+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
Copyright 2026 The Cozystack Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"testing"
21+
"time"
22+
)
23+
24+
func TestParseFlagsDefaults(t *testing.T) {
25+
o, err := parseFlags(nil)
26+
if err != nil {
27+
t.Fatal(err)
28+
}
29+
if o.listenAddress != ":8080" || o.probeAddress != ":8081" || o.clusterDomain != "cozy.local" || o.rootTenant != "tenant-root" {
30+
t.Errorf("contract defaults changed: %+v", o)
31+
}
32+
if o.authCacheTTL != 10*time.Second || o.logs.MaxTailResume != 15*time.Minute || o.logs.MaxRange != 7*24*time.Hour {
33+
t.Errorf("limit defaults changed: %+v", o)
34+
}
35+
}
36+
37+
func TestParseFlagsOverrides(t *testing.T) {
38+
o, err := parseFlags([]string{"--cluster-domain=example.org", "--logs-max-range=24h", "--max-tails=3"})
39+
if err != nil {
40+
t.Fatal(err)
41+
}
42+
if o.clusterDomain != "example.org" || o.logs.MaxRange != 24*time.Hour || o.limiter.MaxTails != 3 {
43+
t.Errorf("overrides not applied: %+v", o)
44+
}
45+
// The smallest bucket count and range the step cap can satisfy.
46+
if _, err := parseFlags([]string{"--logs-max-buckets=4", "--logs-max-range=3s", "--logs-default-range=1s"}); err != nil {
47+
t.Errorf("smallest satisfiable step cap refused: %v", err)
48+
}
49+
}
50+
51+
func TestParseFlagsInvalid(t *testing.T) {
52+
for _, args := range [][]string{
53+
{"--root-tenant="},
54+
{"--cluster-domain="},
55+
{"--logs-default-range=48h", "--logs-max-range=24h"},
56+
{"--logs-max-buckets=3"},
57+
{"--logs-max-range=2s", "--logs-default-range=1s"},
58+
{"--shutdown-timeout=-1s"},
59+
{"--logs-default-limit=0"},
60+
{"--logs-default-limit=100", "--logs-max-limit=10"},
61+
{"--logs-max-tail-resume=-1m"},
62+
{"--request-timeout=-1s"},
63+
{"--tail-idle-timeout=-1s"},
64+
{"--auth-cache-ttl=-1s"},
65+
{"--rate-limit-per-user=-1"},
66+
{"--rate-limit-per-user=NaN"},
67+
{"--rate-limit-per-user=+Inf"},
68+
{"--rate-limit-burst=-1"},
69+
{"--max-concurrent-per-user=-1"},
70+
{"--max-tails-per-user=-1"},
71+
{"--max-tails=-1"},
72+
{"--unknown"},
73+
{"unexpected", "--root-tenant=tenant-x"},
74+
} {
75+
if _, err := parseFlags(args); err == nil {
76+
t.Errorf("parseFlags(%v) accepted", args)
77+
}
78+
}
79+
}

‎hack/console-nginx-header-buffers.bats‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ nginx_size_kib() {
3737
cd "$REPO_ROOT"
3838

3939
conf=$(awk '
40-
/^COPY <<.EOF. \/etc\/nginx\/conf\.d\/default\.conf$/ { inblock = 1; next }
40+
/^COPY <<.EOF. \/etc\/nginx\/templates\/default\.conf\.template$/ { inblock = 1; next }
4141
inblock && /^EOF$/ { inblock = 0; next }
4242
inblock { print }
4343
' "$CONSOLE_CONTAINERFILE")
44-
[ -n "$conf" ] || { echo "no /etc/nginx/conf.d/default.conf heredoc found in $CONSOLE_CONTAINERFILE" >&2; exit 1; }
44+
[ -n "$conf" ] || { echo "no /etc/nginx/templates/default.conf.template heredoc found in $CONSOLE_CONTAINERFILE" >&2; exit 1; }
4545

4646
# An extraction that silently grabbed the wrong slice would let every
4747
# assertion below pass on an empty-ish config, so anchor on a line the

0 commit comments

Comments
 (0)