Skip to content
Discussion options

You must be logged in to vote

One not so great workaround is to build the whole config in text/json and then unmarshal it into protobuf.

  • You could add Go template based config templates like this:
    probe {
     ...
     http_probe {
       port: {{.Port}}
       tls_config {
         server_name: "{{.ServerName}}"
       }
      ...
    }
    
  • Build text format config from this template and your data.
  • Unmarshal the textconfig into ProbeDef.

This is similar to what cloudprober binary does:

func processConfigText(configStr, configFormat string, tmplData map[string]any, m protoreflect.ProtoMessage, l *logger.Logger) (string, error) {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kssahazeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants