mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
Fix/release commits cherrypick (#5546)
* fix EE-1078 Too strict form validation for docker environment variables (#5278) Co-authored-by: Simon Meng <simon.meng@portainer.io> * fix(ingress): EE-1049 Ingress config is lost when deleting an application deployed with ingress (#5264) Co-authored-by: Simon Meng <simon.meng@portainer.io> * feat(app/k8s): update ingress scheme from v1beta1 to v1 (#5466) Co-authored-by: cong meng <mcpacino@gmail.com> Co-authored-by: Simon Meng <simon.meng@portainer.io> Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
parent
b4f4ef701a
commit
7e211ef384
6 changed files with 18 additions and 24 deletions
|
@ -19,10 +19,10 @@ export class KubernetesIngressConverter {
|
|||
: _.map(rule.http.paths, (path) => {
|
||||
const ingRule = new KubernetesIngressRule();
|
||||
ingRule.IngressName = data.metadata.name;
|
||||
ingRule.ServiceName = path.backend.serviceName;
|
||||
ingRule.ServiceName = path.backend.service.name;
|
||||
ingRule.Host = rule.host || '';
|
||||
ingRule.IP = data.status.loadBalancer.ingress ? data.status.loadBalancer.ingress[0].ip : undefined;
|
||||
ingRule.Port = path.backend.servicePort;
|
||||
ingRule.Port = path.backend.service.port.number;
|
||||
ingRule.Path = path.path;
|
||||
return ingRule;
|
||||
});
|
||||
|
@ -151,8 +151,8 @@ export class KubernetesIngressConverter {
|
|||
rule.http.paths = _.map(paths, (p) => {
|
||||
const path = new KubernetesIngressRulePathCreatePayload();
|
||||
path.path = p.Path;
|
||||
path.backend.serviceName = p.ServiceName;
|
||||
path.backend.servicePort = p.Port;
|
||||
path.backend.service.name = p.ServiceName;
|
||||
path.backend.service.port.number = p.Port;
|
||||
return path;
|
||||
});
|
||||
hostsWithRules.push(host);
|
||||
|
@ -173,7 +173,7 @@ export class KubernetesIngressConverter {
|
|||
res.spec.rules = [];
|
||||
_.forEach(data.Hosts, (host) => {
|
||||
if (!host.NeedsDeletion) {
|
||||
res.spec.rules.push({ host: host.Host });
|
||||
res.spec.rules.push({ host: host.Host || host });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -20,10 +20,15 @@ export function KubernetesIngressRuleCreatePayload() {
|
|||
|
||||
export function KubernetesIngressRulePathCreatePayload() {
|
||||
return {
|
||||
backend: {
|
||||
serviceName: '',
|
||||
servicePort: 0,
|
||||
},
|
||||
path: '',
|
||||
pathType: 'ImplementationSpecific',
|
||||
backend: {
|
||||
service: {
|
||||
name: '',
|
||||
port: {
|
||||
number: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ angular.module('portainer.kubernetes').factory('KubernetesIngresses', factory);
|
|||
function factory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return function (namespace) {
|
||||
const url = `${API_ENDPOINT_ENDPOINTS}/:endpointId/kubernetes/apis/networking.k8s.io/v1beta1${namespace ? '/namespaces/:namespace' : ''}/ingresses/:id/:action`;
|
||||
const url = `${API_ENDPOINT_ENDPOINTS}/:endpointId/kubernetes/apis/networking.k8s.io/v1${namespace ? '/namespaces/:namespace' : ''}/ingresses/:id/:action`;
|
||||
return $resource(
|
||||
url,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue