mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
fix ingress creation for none class (#12273)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
ea228c3d6d
commit
c0db48b29d
1 changed files with 6 additions and 3 deletions
|
@ -223,6 +223,11 @@ func (kcl *KubeClient) CreateIngress(namespace string, info models.K8sIngressInf
|
||||||
// convertToK8sIngress converts a Portainer K8sIngressInfo object to a k8s native Ingress object.
|
// convertToK8sIngress converts a Portainer K8sIngressInfo object to a k8s native Ingress object.
|
||||||
// this is required for create and update operations.
|
// this is required for create and update operations.
|
||||||
func (kcl *KubeClient) convertToK8sIngress(info models.K8sIngressInfo, owner string) netv1.Ingress {
|
func (kcl *KubeClient) convertToK8sIngress(info models.K8sIngressInfo, owner string) netv1.Ingress {
|
||||||
|
ingressSpec := netv1.IngressSpec{}
|
||||||
|
if info.ClassName != "" {
|
||||||
|
ingressSpec.IngressClassName = &info.ClassName
|
||||||
|
}
|
||||||
|
|
||||||
result := netv1.Ingress{
|
result := netv1.Ingress{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: info.Name,
|
Name: info.Name,
|
||||||
|
@ -230,9 +235,7 @@ func (kcl *KubeClient) convertToK8sIngress(info models.K8sIngressInfo, owner str
|
||||||
Annotations: info.Annotations,
|
Annotations: info.Annotations,
|
||||||
},
|
},
|
||||||
|
|
||||||
Spec: netv1.IngressSpec{
|
Spec: ingressSpec,
|
||||||
IngressClassName: &info.ClassName,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
labels := make(map[string]string)
|
labels := make(map[string]string)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue