Update e2e tests (#1538)

* fix: update ingress class name assign
This commit is contained in:
AhmedGrati 2022-11-21 11:54:28 +01:00 committed by GitHub
parent af82f7e6db
commit 36593e8759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 29 deletions

View File

@ -135,7 +135,7 @@ type ServiceConfig struct {
ExposeServicePath string `compose:"kompose.service.expose.path"`
BuildLabels map[string]string `compose:"build-labels"`
ExposeServiceTLS string `compose:"kompose.service.expose.tls-secret"`
ExposeServiceIngressClassName *string `compose:"kompose.service.expose.ingress-class-name"`
ExposeServiceIngressClassName string `compose:"kompose.service.expose.ingress-class-name"`
ImagePullSecret string `compose:"kompose.image-pull-secret"`
Stdin bool `compose:"stdin_open"`
Tty bool `compose:"tty"`

View File

@ -518,7 +518,6 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
// Again, in v3, we use the "long syntax" for volumes in terms of parsing
// https://docs.docker.com/compose/compose-file/#long-syntax-3
serviceConfig.VolList = loadV3Volumes(composeServiceConfig.Volumes)
if err := parseKomposeLabels(composeServiceConfig.Labels, &serviceConfig); err != nil {
return kobject.KomposeObject{}, err
}
@ -538,7 +537,6 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
}
handleV3Volume(&komposeObject, &composeObject.Volumes)
return komposeObject, nil
}
@ -652,7 +650,6 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
// Label handler
// Labels used to influence conversion of kompose will be handled
// from here for docker-compose. Each loader will have such handler.
if serviceConfig.Labels == nil {
serviceConfig.Labels = make(map[string]string)
}
@ -673,7 +670,7 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
case LabelServiceExposeTLSSecret:
serviceConfig.ExposeServiceTLS = value
case LabelServiceExposeIngressClassName:
serviceConfig.ExposeServiceIngressClassName = &value
serviceConfig.ExposeServiceIngressClassName = value
case LabelImagePullSecret:
serviceConfig.ImagePullSecret = value
case LabelImagePullPolicy:
@ -687,7 +684,7 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
return errors.New("kompose.service.expose.tls-secret was specified without kompose.service.expose")
}
if serviceConfig.ExposeService == "" && serviceConfig.ExposeServiceIngressClassName != nil {
if serviceConfig.ExposeService == "" && serviceConfig.ExposeServiceIngressClassName != "" {
return errors.New("kompose.service.expose.ingress-class-name was specified without kompose.service.expose")
}

View File

@ -531,8 +531,8 @@ func (k *Kubernetes) initIngress(name string, service kobject.ServiceConfig, por
}
}
if service.ExposeServiceIngressClassName != nil {
ingress.Spec.IngressClassName = service.ExposeServiceIngressClassName
if service.ExposeServiceIngressClassName != "" {
ingress.Spec.IngressClassName = &service.ExposeServiceIngressClassName
}
return ingress

View File

@ -1,14 +1,16 @@
web:
image: tuna/docker-counter23
ports:
- "5000:5000"
links:
- redis
labels:
kompose.service.expose: "batman.example.com/dev,batwoman.example.com"
kompose.service.expose.tls-secret: "test-secret"
kompose.service.expose.ingress-class-name: "nginx"
redis:
image: redis:3.0
ports:
- "6379"
version: '3.5'
services:
web:
image: tuna/docker-counter23
ports:
- "5000:5000"
links:
- redis
labels:
kompose.service.expose: "batman.example.com/dev,batwoman.example.com"
kompose.service.expose.tls-secret: "test-secret"
kompose.service.expose.ingress-class-name: "nginx"
redis:
image: redis:3.0
ports:
- "6379"

View File

@ -83,7 +83,7 @@
"imageChangeParams": {
"automatic": true,
"containerNames": [
"redis"
"redis"
],
"from": {
"kind": "ImageStreamTag",
@ -146,7 +146,7 @@
},
"tags": [
{
"name": "latest",
"name": "3.0",
"annotations": null,
"from": {
"kind": "DockerImage",
@ -192,7 +192,7 @@
"imageChangeParams": {
"automatic": true,
"containerNames": [
"web"
"web"
],
"from": {
"kind": "ImageStreamTag",

View File

@ -73,7 +73,8 @@
],
"env": [
{
"name": "TZ"
"name": "TZ",
"value": "${TZ}"
}
],
"resources": {},
@ -89,7 +90,8 @@
"image": "librenms/dispatcher:latest",
"env": [
{
"name": "TZ"
"name": "TZ",
"value": "${TZ}"
}
],
"resources": {},

View File

@ -259,7 +259,7 @@
},
"tags": [
{
"name": "latest",
"name": "5.7",
"annotations": null,
"from": {
"kind": "DockerImage",

View File

@ -432,7 +432,7 @@
},
"tags": [
{
"name": "latest",
"name": "3.0",
"annotations": null,
"from": {
"kind": "DockerImage",