Groovy web console

subscribe to the feed Subscribe
to this
regex (via #groovywebconsole)
tweet this snippet Tweet


Published 2 weeks ago by me
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def output = '     # This section is only required if TLS is to be enabled for the Ingress     tls:         - hosts:             -           secretName: example-tls  If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:    apiVersion: v1   kind: Secret   metadata:     name: example-tls     namespace: foo   data:     tls.crt: <base64 encoded cert>     tls.key: <base64 encoded key>   type:  Release "hcpc-kube-dash-71" does not exist. Installing it now. NAME:   hcpc-kube-dash-71 LAST DEPLOYED: Thu Oct  5 11:41:12 2017 NAMESPACE: kube-dash-71 STATUS: DEPLOYED  RESOURCES: ==> v1beta1/Deployment NAME                        DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE hcpc-kube-dash-71-hcp-api   1        1        1           1          40s hcpc-kube-dash-71-hcp-loop  1        1        1           1          40s hcpc-kube-dash-71-hcp-dns   1        1        1           1          40s  ==> v1beta1/Ingress NAME                               HOSTS                                           ADDRESS  PORTS  AGE hcpc-kube-dash-71-hcp-api-ingress  80       40s  ==> v1/Secret NAME                       TYPE                     DATA  AGE jwt-signing-key            Opaque                   1     41s azure-external-dns-config  Opaque                   1     41s acr-secret         1     41s  ==> v1/Service NAME                       CLUSTER-IP   EXTERNAL-IP  PORT(S)       AGE hcpc-kube-dash-71-hcp-api  <nodes>      80:31953/TCP  40s '.trim()

// println output
def pattern = ~"[a-z0-9\\-]+[\\.]{1}[a-z0-9\\-]+[\\.]{1}[a-z0-9]+[\\.]{1}[a-z0-9]+[\\.]{1}[a-z0-9]+[\\.]{1}[a-z0-9]+"
println output.find(pattern)