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

ExtensionsV1beta1Api.createNamespacedIngress is throwing error for servicePort #117

Closed
jeesmon opened this issue Nov 14, 2017 · 2 comments
Closed

Comments

@jeesmon
Copy link

jeesmon commented Nov 14, 2017

java-client: v1.0.0-beta1
k8s: v1.8.2

In V1beta1IngressBackend model, servicePort is String. But calling ExtensionsV1beta1Api.createNamespacedIngress with "servicePort": "443" throws

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Ingress.extensions \"ingress\" is invalid: [spec.backend.servicePort: Invalid value: \"443\": must contain at least one letter or number (a-z, 0-9), spec.rules[0].http.backend.servicePort: Invalid value: \"443\": must contain at least one letter or number (a-z, 0-9)]","reason":"Invalid","details":{"name":"ingress","group":"extensions","kind":"Ingress","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"443\": must contain at least one letter or number (a-z, 0-9)","field":"spec.backend.servicePort"},{"reason":"FieldValueInvalid","message":"Invalid value: \"443\": must contain at least one letter or number (a-z, 0-9)","field":"spec.rules[0].http.backend.servicePort"}]},"code":422}

Serialized version of V1beta1Ingress captured from debug

{
    "apiVersion": "extensions/v1beta1",
    "kind": "Ingress",
    "metadata": {
        "annotations": {
            "ingress.kubernetes.io/ssl-passthrough": "true"
        },
        "name": "ingress",
        "namespace": "test"
    },
    "spec": {
        "backend": {
            "serviceName": "svc-1",
            "servicePort": "443"
        },
        "rules": [
            {
                "host": "myhost.com",
                "http": {
                    "paths": [
                        {
                            "backend": {
                                "serviceName": "svc-1",
                                "servicePort": "443"
                            },
                            "path": "/path"
                        }
                    ]
                }
            }
        ],
        "tls": [
            {
                "hosts": [
                    "myhost.com"
                ],
                "secretName": "ingress-secret"
            }
        ]
    }
}
kubectl apply -f ingress.json 
The Ingress "ingress" is invalid: 
* spec.backend.servicePort: Invalid value: "443": must contain at least one letter or number (a-z, 0-9)
* spec.rules[0].http.backend.servicePort: Invalid value: "443": must contain at least one letter or number (a-z, 0-9)

If I change "servicePort": "443" to "servicePort": 443 and run kubectl apply -f ingress.json, Ingress is created. But there is no way to do that using the V1beta1Ingress model for java client.

@brendandburns
Copy link
Contributor

Duplicate of #115 IntOrString isn't handled properly.

We need to regenerate the client...

@brendandburns
Copy link
Contributor

Closing since this is a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants