Files
seaweedfs/.github/workflows
0720955ea7 helm: pass extraEnvironmentVars and security.toml to the bucket-creation hook (#10477)
* helm: give the bucket hook the credentials weed shell needs

The post-install bucket hook pipes s3.configure into `weed shell`. Since
#9442 the filer only serves its IAM gRPC service to callers presenting an
admin-signed JWT, and since #9536 `weed shell` mints that token itself -
but only if it can find the filer signing key. The hook job sees neither
a security.toml nor the WEED_* environment overrides: its env list is
hardcoded, and it is the only workload in the chart without a
security.toml mount.

So with jwtSigning.filerWrite=true the hook logs

  error: failed to get user anonymous: rpc error: code = Unauthenticated
  desc = missing authorization metadata

and `weed shell` exits 0 regardless, which leaves the Job green while
anonymousRead is never applied.

Render the merged extraEnvironmentVars into the job's env - keeping
non-string values as valueFrom, so keys held in a Secret stay a
reference - and mount security.toml the way every other workload does.
The hardcoded WEED_CLUSTER_* entries go away because those values are
part of the global extraEnvironmentVars defaults and would otherwise
render twice.

Signed-off-by: Sebastian Preisner <preisner@puzzle-itc.de>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* helm ci: report a missing bucket hook Job instead of crashing

Signed-off-by: Sebastian Preisner <preisner@puzzle-itc.de>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* helm ci: assert where the bucket hook mounts security.toml

A mount under the wrong path leaves weed shell without the key just as
surely as no mount at all, so check the target, not only the name.

Signed-off-by: Sebastian Preisner <preisner@puzzle-itc.de>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* helm: keep the bucket hook's cluster endpoints chart-computed

Dropping the hardcoded WEED_CLUSTER_* left the readiness waits
dereferencing $WEED_CLUSTER_SW_*, which exist only while the values keep
the default alias. Rename the cluster, or clear extraEnvironmentVars, and
the hook polls "http://" for five minutes and then fails the release.

Derive the env names from the alias and render the addresses from the
chart, as all-in-one already does.

* helm ci: assert the bucket hook follows a renamed cluster alias

Renames the cluster and drops the default addresses, then checks that
every env name the readiness waits dereference is set, and that the
address is the chart's rather than the one left in the values.

* helm ci: check the hook's endpoints and security.toml source

The bucket hook tests took two shortcuts a wrong render slips through.

The alias test only rejected the stale master address the values kept, so
any other wrong address passed and the filer address was never compared at
all. And the security.toml test matched the volume by name, which a
same-named emptyDir or a foreign ConfigMap satisfies while `weed shell`
still has no signing key.

Compare both cluster addresses against the Services the chart renders, in
the default and the renamed-alias case, and assert the volume is backed by
the chart's security-config ConfigMap. Checked by pointing the volume at
another ConfigMap and the filer env at a wrong but non-empty address:
both now fail, both passed before.

Signed-off-by: Sebastian Preisner <preisner@puzzle-itc.de>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sebastian Preisner <preisner@puzzle-itc.de>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>
2026-07-31 19:42:59 -07:00
..