Repository navigation
sourcegraph: Drop DEPLOY_TYPE from every container except worker - #982
Open
marcleblanc2 wants to merge 2 commits into
Open
marcleblanc2 wants to merge 2 commits into
marcleblanc2 wants to merge 2 commits into
Conversation
zoekt-webserver, zoekt-indexserver, and syntect-server are not built from sourcegraph/sourcegraph and never read DEPLOY_TYPE, so the default added in Amp-Thread-ID: https://ampcode.com/threads/T-01a16c86-310a-72d8-8a7e-9025e822232c Co-authored-by: Amp <[email protected]> #929 is dead config on those containers.
deploy.Type() defaults to kubernetes when DEPLOY_TYPE is unset, and every consumer except the update-check ping goes through predicates that treat helm and kubernetes the same. The ping runs in the worker, so that is the only container where the value is observable. Amp-Thread-ID: https://ampcode.com/threads/T-01a17ada-cdbc-76ff-992b-901bddd4d0b7 Co-authored-by: Amp <[email protected]>
This branch has not been deployed
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.
Summary
#929 added a default
DEPLOY_TYPE=helmenv var to every application container. Only one of them can tell the difference:worker.deploy.Type()falls back tokuberneteswhen the env var is unset, and every consumer insourcegraph/sourcegraphexcept one goes through predicates (IsDeployTypeKubernetes,IsDev,IsDeployTypeSingleDockerContainer, …) that puthelmandkubernetesin the same bucket. The exception isinternal/pings/client.go, which sends the raw string asdeploy_typein the update-check ping. Since sourcegraph/sourcegraph@a9ca36a (in 8.0.0 and later, which is what the chart releases pin) that ping is sent by the worker'supdate-checkjob, not frontend.frontendalso forwards the value to the browser aswindow.context.deployType, but no code underclient/reads it onmain, and the 5.11-era readers only compared it againstdev/docker-container.This PR keeps
DEPLOY_TYPE=helmonworkerand removes it fromfrontend,migrator,gitserver,blobstore,searcher,precise-code-intel-worker,syntactic-code-intel-worker,zoekt-webserver,zoekt-indexserver, andsyntect-server. The*.envvalues for those return to their pre-#929 shape ({}or just the other defaults), the helm-docs@defaultannotations go with them, and the unit tests now assert both that worker has the var and that nothing else does.Test plan
helm unittest charts/sourcegraph: 192 passed; the new negative assertions fail against the pre-changevalues.yamlhelm lint charts/sourcegraph: cleanhelm templatewithsyntacticCodeIntel.enabled=truerendersDEPLOY_TYPEon theworkercontainer and nowhere else./scripts/helm-docs.shleaves no uncommitted changes