younsl opened a new pull request, #389:
URL: https://github.com/apache/superset-kubernetes-operator/pull/389

   ## Summary
   
   The default database tool image for MySQL is mysql:8-alpine, but that tag 
does not exist on [Docker Hub](https://hub.docker.com/_/mysql/tags?name=alpine) 
(the [official MySQL image](https://hub.docker.com/_/mysql) has no Alpine 
variant). Every MySQL code path that relies on the default therefore fails with 
an image pull error: the seed task Pod never starts, and the create-database 
init container of the migrate Job cannot be pulled, so migrate is blocked with 
TaskCannotStart until its deadline and then fails. This PR switches the default 
to [mysql:8.4](https://hub.docker.com/_/mysql/tags?name=8.4), the current MySQL 
LTS, which ships the mysql and mysqldump clients used by both scripts and a 
mysql user with UID 999, the UID the non-root helper security context already 
assumes for MySQL.
   
   ## Details
   
   - The default lives in a single constant (SeedImageMySQL), shared by the 
seed task and the createDatabase init container; comments, the API reference, 
the user guide, and the release notes are updated to match.
   - Users who set an explicit image are unaffected. Partial overrides that set 
only a tag keep inheriting the default repository, which is unchanged (mysql).
   - Staging instances that seed from MySQL with the default image re-seed once 
after upgrading, because the seed image is part of the seed task checksum. 
Those instances could not have seeded successfully before this change, so no 
working setup loses data.
   - PostgreSQL defaults are unchanged.
   
   <details>
   <summary>Verification on a Kind cluster (before and after)</summary>
   
   Environment: Kind v0.33.0 with Kubernetes v1.37.0 on Podman (arm64). A MySQL 
8.4 server runs in a test namespace. Two Superset resources exercise the two 
affected paths with default tool images: one with metastore createDatabase 
enabled, and one with a MySQL seed source (superset_src, containing a marker 
row) copied into superset_b. The same manifests were applied against an 
operator built from main and from this branch.
   
   Operator built from main, seed path (final state):
   
   ```text
   --- fix-seed
   phase=Seeding seed=Running migrate=
   condition=TaskCannotStart: Seed task pod cannot start: container "superset": 
ErrImagePull: rpc error: code = NotFound desc = failed to pull and unpack image 
"docker.io/library/mysql:8-alpine": failed to resolve reference 
"docker.io/library/mysql:8-alpine": docker.io/library/mysql:8-alpine: not found
   --- superset_b.marker (seeded copy)
   (absent)
   ```
   
   Operator built from main, createDatabase path (sampled while the migrate Job 
runs):
   
   ```text
   --- migrate pod init containers
   create-database: image=mysql:8-alpine waiting=ErrImagePull message=rpc 
error: code = NotFound desc = failed to pull and unpack image 
"docker.io/library/mysql:8-alpine": failed to resolve reference 
"docker.io/library/mysql:8-alpine": docker.io/library/mysql:8-alpine: not found
   --- pod events
   Pulling: Pulling image "mysql:8-alpine"
   Failed: Failed to pull image "mysql:8-alpine": rpc error: code = NotFound 
desc = failed to pull and unpack image "docker.io/library/mysql:8-alpine": 
failed to resolve reference "docker.io/library/mysql:8-alpine": 
docker.io/library/mysql:8-alpine: not found
   Failed: Error: ErrImagePull
   BackOff: Back-off pulling image "mysql:8-alpine"
   Failed: Error: ImagePullBackOff
   --- Superset LifecycleComplete condition
   TaskCannotStart: Migrate task pod cannot start: container "create-database": 
ErrImagePull: rpc error: code = NotFound desc = failed to pull and unpack image 
"docker.io/library/mysql:8-alpine": failed to resolve reference 
"docker.io/library/mysql:8-alpine": docker.io/library/mysql:8-alpine: not found
   --- databases
   superset_src
   ```
   
   Once the 2m migrate timeout expires, the task ends in TaskFailed ("Job was 
active longer than specified deadline") and the database is never created.
   
   Operator built from this branch, both paths (the init container line comes 
from a second run with pod retention enabled, since successful task Pods are 
deleted by default):
   
   ```text
   --- fix-createdb
   phase=Complete seed= migrate=Complete
   condition=LifecycleComplete: Lifecycle tasks completed successfully
   --- migrate pod init containers
   create-database: image=docker.io/library/mysql:8.4 terminated=Completed
   --- fix-seed
   phase=Complete seed=Complete migrate=Complete
   condition=LifecycleComplete: Lifecycle tasks completed successfully
   --- databases
   superset_a
   superset_b
   superset_src
   --- superset_b.marker (seeded copy)
   seeded
   ```
   
   On Docker Hub, the [8-alpine tag 
lookup](https://hub.docker.com/v2/namespaces/library/repositories/mysql/tags/8-alpine)
 returns 404, a [tag search for 
alpine](https://hub.docker.com/v2/namespaces/library/repositories/mysql/tags?name=alpine)
 returns no results, and the [8.4 tag 
lookup](https://hub.docker.com/v2/namespaces/library/repositories/mysql/tags/8.4)
 returns 200. The mysql:8.4 image was also checked directly: it contains mysql, 
mysqldump, sh, and the other tools the scripts use, and its mysql user is 
uid=999.
   
   Other checks on this branch: unit tests, envtest integration tests, 
golangci-lint (default and integration build tags), Markdown lint, and make 
codegen with no resulting diff.
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to