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

velaux 1.9.1 Configure the gateway, and convert the port into a string #6165

Closed
Louse-luo opened this issue Jun 29, 2023 · 18 comments · Fixed by kubevela/velaux#861
Closed
Assignees
Labels
help wanted Extra attention is needed and welcome new comers who are well skilled type/bug Something isn't working

Comments

@Louse-luo
Copy link

Louse-luo commented Jun 29, 2023

Describe the bug

velaux 1.9.1 Configure the gateway, and convert the port into a string
To Reproduce

cannot generate manifests from components and traits: evaluate template trait=gateway app=third-app1-prod: invalid template of trait gateway after merge with parameter and context: outputs.service.spec.ports.0.port: conflicting values "8090" and int (mismatched types string and int) (and 3 more errors)
Expected behavior

Screenshots

KubeVela Version
1.9.1

Cluster information

Additional context

@chivalryq chivalryq added type/bug Something isn't working help wanted Extra attention is needed and welcome new comers who are well skilled labels Jun 29, 2023
@chivalryq
Copy link
Member

Could you provide a screenshot?

@Kolossi
Copy link
Contributor

Kolossi commented Jun 29, 2023

@Louse-luo : please provide an example manifest which fails, thanks.

@wonderflow
Copy link
Collaborator

wonderflow commented Jun 29, 2023

Same issue reported in Dingtalk, I'm copy-paste the screenshoots here:

image

image

@Kolossi
Copy link
Contributor

Kolossi commented Jun 29, 2023

thanks @wonderflow do we know the last version where this didn't happen?

and can you publish a full repro for getting to this state shown in the screenshot?

@wonderflow
Copy link
Collaborator

@Kolossi Thanks Paul for investigating this issue. The reporter didn't send the full repro, so I can't provide that.

I checked the gateway trait:

https://github.com/kubevela/kubevela/blob/v1.9.2/vela-templates/definitions/internal/trait/gateway.cue#L149

It's defined as http: [string]: int in CUE, AFAIK, the port must be a int, why it become a string in this case?

@Kolossi
Copy link
Contributor

Kolossi commented Jun 29, 2023

Indeed, I looked and saw the same.

Also, my changes to gateway were included in v1.9.0 and doing a diff to previous 1.8.2, there's nothing changed around port - v1.8.2...v1.9.1#diff-eb6e43f0e2cf800a96e1dac66f3f4871067f865d5c694d9efa5c84cb2529a5a0

Is there something hardcoded in velaux about ports which has broken (again I tried a github search and couldn't find anything).

🤔

@wonderflow
Copy link
Collaborator

ping @chivalryq @barnettZQG , will it possible that's a bug caused by velaux?

@chivalryq
Copy link
Member

I will dig into this recently.

@chivalryq chivalryq self-assigned this Jul 11, 2023
@lxkaka
Copy link

lxkaka commented Jul 12, 2023

same problem in 1.9.1; now we degrade to 1.8.1 ; keep an eye on this

@Kolossi
Copy link
Contributor

Kolossi commented Jul 12, 2023

@lxkaka : can you post the steps to reproduce this issue please

@barnettZQG
Copy link
Collaborator

Let's check the open API schema that generate from the gateway trait, it save in a configmap. @chivalryq

@lxkaka
Copy link

lxkaka commented Jul 13, 2023

@Kolossi
image
in 1.9.1 the port will be render to "8888" in yaml

@Kolossi
Copy link
Contributor

Kolossi commented Jul 13, 2023

@chivalryq I really can't see anything in either kubevela or velaux diff between 1.8.1 and 1.9.1. Perhaps it's a change in the underlying cue version that has changed the behaviour? I'm going to have to leave this with you.

@chivalryq
Copy link
Member

chivalryq commented Jul 14, 2023

@Kolossi No worry. Will take care of this.

@chivalryq
Copy link
Member

I try to repro with:
velaux: v1.9.1, run the server locally.
vela-core v1.9.3
gateway trait: master.

When creating trait, velaux send the request to apiserver with the value of string type.

image

@chivalryq
Copy link
Member

OpenAPI schema is like below. It's like there's something wrong in grammar. Still investigating.

{
  "properties": {
    "class": {
      "default": "nginx",
      "description": "Specify the class of ingress to use",
      "title": "class",
      "type": "string"
    },
    "classInSpec": {
      "default": false,
      "description": "Set ingress class in ''.spec.ingressClassName'' instead of ''kubernetes.io/ingress.class'' annotation.",
      "title": "classInSpec",
      "type": "boolean"
    },
    "domain": {
      "description": "Specify the domain you want to expose",
      "title": "domain",
      "type": "string"
    },
    "gatewayHost": {
      "description": "Specify the host of the ingress gateway, which is used to generate the endpoints when the host is empty.",
      "title": "gatewayHost",
      "type": "string"
    },
    "http": {
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Specify the mapping relationship between the http path and the workload port",
      "title": "http",
      "type": "object"
    },
    "secretName": {
      "description": "Specify the secret name you want to quote to use tls.",
      "title": "secretName",
      "type": "string"
    }
  },
  "required": [
    "http",
    "class",
    "classInSpec" [],
    "type"
    :
    "object"
    }

@lxkaka
Copy link

lxkaka commented Jul 17, 2023

@chivalryq we will keep an eye on this

@chivalryq
Copy link
Member

Openapi schema is not wrong. It's a k9s bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed and welcome new comers who are well skilled type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants