Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRDs: when I provide an expose section to proxy-defaults, it should use consul's default protocol rather than failing #367

Closed
ishustava opened this issue Oct 26, 2020 · 1 comment · Fixed by #362
Labels
theme/crds type/bug Something isn't working

Comments

@ishustava
Copy link
Contributor

Description

I have the following proxy-defaults.yaml:

apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
  name: global
spec:
  config:
    envoy_prometheus_bind_addr: 0.0.0.0:9200
  expose:
    checks: true
    paths:
      - path: /metrics
        localPathPort: 8080
        listenerPort: 9201

When I apply it to the cluster, I get the following error:

Error from server: error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"consul.hashicorp.com/v1alpha1\",\"kind\":\"ProxyDefaults\",\"metadata\":{\"annotations\":{},\"name\":\"global\",\"namespace\":\"default\"},\"spec\":{\"config\":{\"envoy_prometheus_bind_addr\":\"0.0.0.0:9200\"},\"expose\":{\"checks\":true,\"paths\":[{\"listenerPort\":9201,\"localPathPort\":8080,\"path\":\"/metrics\"}]}}}\n"}},"spec":{"expose":{"paths":[{"listenerPort":9201,"localPathPort":8080,"path":"/metrics"}]}}}
to:
Resource: "consul.hashicorp.com/v1alpha1, Resource=proxydefaults", GroupVersionKind: "consul.hashicorp.com/v1alpha1, Kind=ProxyDefaults"
Name: "global", Namespace: "default"
for: "proxy-defaults.yaml": admission webhook "mutate-proxydefaults.consul.hashicorp.com" denied the request: proxydefaults.consul.hashicorp.com "global" is invalid: spec.expose.paths[0].protocol: Invalid value: "": must be one of "http", "http2"

Expected behavior

Since Consul has a default for the expose.paths[].protocol (http) I expected to see no error and for the controller to pass through to Consul and let it default to http.

@ishustava ishustava added type/bug Something isn't working theme/crds labels Oct 26, 2020
@thisisnotashwin
Copy link
Contributor

This should be adressed by #362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/crds type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants