2020-08-12 23:30:23 +00:00
|
|
|
export function KubernetesResourcePoolFormValues(defaults) {
|
2021-08-26 14:00:59 +00:00
|
|
|
this.Name = '';
|
|
|
|
this.MemoryLimit = defaults.MemoryLimit;
|
|
|
|
this.CpuLimit = defaults.CpuLimit;
|
|
|
|
this.HasQuota = false;
|
|
|
|
this.IngressClasses = []; // KubernetesResourcePoolIngressClassFormValue
|
|
|
|
this.Registries = []; // RegistryViewModel
|
|
|
|
this.EndpointId = 0;
|
|
|
|
this.IsSystem = false;
|
2020-08-12 23:30:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-08-20 00:51:14 +00:00
|
|
|
* @param {KubernetesIngressClass} ingressClass
|
2020-08-12 23:30:23 +00:00
|
|
|
*/
|
2020-08-20 00:51:14 +00:00
|
|
|
export function KubernetesResourcePoolIngressClassFormValue(ingressClass) {
|
2020-08-12 23:30:23 +00:00
|
|
|
return {
|
2020-08-20 00:51:14 +00:00
|
|
|
Namespace: undefined, // will be filled inside ResourcePoolService.create
|
|
|
|
IngressClass: ingressClass,
|
|
|
|
RewriteTarget: false,
|
|
|
|
Annotations: [], // KubernetesResourcePoolIngressClassAnnotationFormValue
|
2021-04-27 17:51:13 +00:00
|
|
|
Hosts: [],
|
2020-08-12 23:30:23 +00:00
|
|
|
Selected: false,
|
|
|
|
WasSelected: false,
|
2020-08-20 00:51:14 +00:00
|
|
|
AdvancedConfig: false,
|
2021-02-26 15:50:33 +00:00
|
|
|
Paths: [], // will be filled to save IngressClass.Paths inside ingressClassesToFormValues() on RP EDIT
|
2020-08-20 00:51:14 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function KubernetesResourcePoolIngressClassAnnotationFormValue() {
|
|
|
|
return {
|
|
|
|
Key: '',
|
|
|
|
Value: '',
|
2020-08-12 23:30:23 +00:00
|
|
|
};
|
|
|
|
}
|
2021-04-27 17:51:13 +00:00
|
|
|
|
|
|
|
export function KubernetesResourcePoolIngressClassHostFormValue() {
|
|
|
|
return {
|
|
|
|
Host: '',
|
|
|
|
PreviousHost: '',
|
|
|
|
NeedsDeletion: false,
|
|
|
|
IsNew: true,
|
|
|
|
};
|
|
|
|
}
|