Add exec connection options to remaining kubedb resource descriptors - #663
Merged
Conversation
Adds spec.exec to 26 kubedb ResourceDescriptors, following the shape already used by mongodbs/postgreses/mysqls, so the UI can open an authenticated shell into the primary container. Container names come from apimachinery's *ContainerName constants; auth env vars from the same constants file or each operator's petset builder. Notes: - HTTP-only DBs (druid, milvus, qdrant, solr, weaviate) drop into bash with a curl one-liner in help, matching the elasticsearch pattern. - neo4j reads credentials from the mounted /config/neo4j-auth files rather than env, since NEO4J_USERNAME/PASSWORD are exported only inside the startup script. - aerospike's container sets no env vars, so asadm runs bare. - mssql prepends both mssql-tools paths to PATH because the sqlcmd location depends on the server version. - etcd is left out: it has no operator repo or container name constant. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
spec.execto 26 kubedb ResourceDescriptors, following the shape already used bymongodbs/postgreses/mysqls, so the UI can open an authenticated shell into the primary container.Every kubedb RD now has
spec.execexceptetcds(see below).How the values were derived
*ContainerNameconstants inkubedb.dev/apimachinery/apis/kubedb/constants.go. Verified for all 26.serviceNameTemplate— uniformly{{- .metadata.name -}}; every DB'sServiceName()resolves toOffshootName().Notes
bashwith acurlone-liner inhelp, matching the existing elasticsearch pattern./config/neo4j-auth/{username,password}files rather than env —NEO4J_USERNAME/NEO4J_PASSWORDare exported only inside the startup script (neo4j/pkg/controller/config.go:334-335), so they are not present in a fresh exec shell.aerospike/pkg/controller/petset.go:149-156), soasadmruns bare./opt/mssql-tools18/binand/opt/mssql-tools/bintoPATH, because thesqlcmdlocation depends on whether the version is >=2022-cu14(mssqlserver/pkg/controller/petset.go:507-511).kubedb.dev/and noEtcdContainerNameconstant, so the container name could not be verified.Worth a reviewer's eye
Container names and env vars are grep-verified. The CLI binary names are not for a subset — these follow upstream convention rather than anything in the operator code:
cqlsh,clickhouse-client,hdbsql,zkCli.sh,kafka-topics.sh,hz-cli,control.sh,asadm, andpsqlfor pgbouncer/pgpool. Operator code did confirmmemsql,rabbitmqctl,sqlplus,sqlcmd,db2, andpsql(documentdb).Testing
go build ./...passescmd/resource-fmtproduces no further changescmd/check-edge-labelandcmd/check-embedpasscmd/check-schemafails, but fails identically on cleanmasterand is not wired into thefmtorcitargetsUnrelated observations
cmd/gen-resourcedescritorsbuilds a freshResourceDescriptorwith onlySpec.Resourceset andos.WriteFiles over the target without reading it (main.go:95-129), so re-running it would wipespec.execfrom every DB — including the ones that already had it before this PR.v1/memcacheds.yamlhas a pre-existingexecentry with nocontainerand nohelp. Left untouched.