feat(motd)!: store the MOTD over HTTP, dropping gRPC - #40
Merged
Conversation
MotdConfigStore reads through the consumer API and writes through the admin one — the same split it had over gRPC, because service-config grants the two separately: a proxy that may show the MOTD need not be allowed to change it. The whole :grpc module goes with it. It existed only to generate the config stubs for this one store, and nothing else in the plugin used it; grpc-netty-shaded and the DNS/pick-first provider registration Velocity's classloader needed go too. The velocity jar carries no gRPC classes. A refusal now arrives as the problem's `detail` rather than a gRPC status description. That line is the only place a missing writer grant is explained, so the store unwraps it and /motd shows the sentence service-config wrote instead of a status code. CONFIG_SERVICE_URL and CONFIG_GRPC_TARGET are both already read here, so no manifest change is needed to roll this.
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.
The MOTD store was the last gRPC caller here — and, with groundsgg/plugin-config#14, the last one in the network. It now reads
GET /v1/config/apps/{app}/envs/{env}/namespaces/motd/documents/activeand writesPUT/DELETEunder/v1/config/admin/..., the endpoints groundsgg/service-config#48 added (released as 0.8.0).The read/write split is deliberate and tested. Reads go to the consumer API, which any authenticated workload may use; writes go to the admin API, which service-config restricts to admin service accounts and to writers explicitly named for this app. That is what lets the proxies own the network MOTD without being handed every other app's configuration — and it means a proxy missing the grant can still show the MOTD, and
/motd setsays why rather than failing silently. A test asserts all three calls land on the half they should.A refusal has to reach chat as a sentence. Over gRPC the store let
StatusRuntimeExceptionout andMotdCommanddug the description out of the status. Now the store unwraps the problem response'sdetail— which is where service-config explains a missing writer grant — and raisesMotdStoreExceptioncarrying it.describe()in the command is correspondingly one line instead of a cast.The whole
:grpcmodule is deleted. It existed only to generate the config stubs for this one store; nothing else in the plugin imported it.grpc-netty-shadedand theNameResolverRegistry/LoadBalancerRegistryregistration that Velocity's per-plugin classloader needed go with it.unzip -lon the built velocity jar reports 0 gRPC classes, down from 3823.No manifest change needed. This plugin already reads
CONFIG_SERVICE_URLwithCONFIG_GRPC_TARGETas a fallback, and both point at the same address and port.Order of deployment: service-config 0.8.0 must be live first (it already serves both transports), and proxies load plugin jars at startup — so this needs a
rollout restart, not just an Argo sync.82 tests green, six of them new around the store.