cloud104 / tks-uptimerobot-controller

0 stars 1 forks source link

Read annotations ingress api #3

Open vavasilva opened 5 years ago

vavasilva commented 5 years ago

tks.sh/uptimerobot.enable: "true" tks.sh/uptimerobot.monitorspath: "['/healthz','/ready']" tks.sh/uptimerobot.monitorsprotocol: "['https','https']" tks.sh/uptimerobot.monitorsinterval: "['300','300']" tks.sh/uptimerobot.monitorsalertcontact: "['2713850','2713850']"

michelsazevedo commented 5 years ago

@vavarodrigues, we can unmarshal values only in json formats.

monitorPaths := "[\"/healthz\",\"/ready\"]"
var paths []string

err := json.Unmarshal([]byte(monitorPaths), &paths)

if err != nil {
        log.Fatal(err)
}

fmt.Printf("%v", paths)