@@ -7637,41 +7637,7 @@ if (o.canI({
7637
7637
resource: "horizontalpodautoscalers",
7638
7638
group: "autoscaling"
7639
7639
}, l, n.project)) {
7640
- var m = function() {
7641
- e.disableInputs = !0, h();
7642
- var t = {
7643
- apiVersion: "autoscaling/v1",
7644
- kind: "HorizontalPodAutoscaler",
7645
- metadata: {
7646
- name: e.autoscaling.name,
7647
- labels: p.mapEntries(p.compactEntries(e.labels))
7648
- },
7649
- spec: {
7650
- scaleTargetRef: {
7651
- kind: n.kind,
7652
- name: n.name,
7653
- apiVersion: "extensions/v1beta1",
7654
- subresource: "scale"
7655
- },
7656
- minReplicas: e.autoscaling.minReplicas,
7657
- maxReplicas: e.autoscaling.maxReplicas,
7658
- targetCPUUtilizationPercentage: e.autoscaling.targetCPU
7659
- }
7660
- };
7661
- s.create(y, null, t, r).then(function(e) {
7662
- d.addNotification({
7663
- type: "success",
7664
- message: "Horizontal pod autoscaler " + e.metadata.name + " successfully created."
7665
- }), v();
7666
- }, function(t) {
7667
- e.disableInputs = !1, d.addNotification({
7668
- id: "edit-hpa-error",
7669
- type: "error",
7670
- message: "An error occurred creating the horizontal pod autoscaler.",
7671
- details: g(t)
7672
- });
7673
- });
7674
- }, f = function(t) {
7640
+ var m = function(t) {
7675
7641
e.disableInputs = !0, (t = angular.copy(t)).metadata.labels = p.mapEntries(p.compactEntries(e.labels)), t.spec.minReplicas = e.autoscaling.minReplicas, t.spec.maxReplicas = e.autoscaling.maxReplicas, t.spec.targetCPUUtilizationPercentage = e.autoscaling.targetCPU, s.update(y, t.metadata.name, t, r).then(function(e) {
7676
7642
d.addNotification({
7677
7643
type: "success",
@@ -7685,15 +7651,15 @@ message: "An error occurred creating the horizontal pod autoscaler.",
7685
7651
details: g(t)
7686
7652
});
7687
7653
});
7688
- }, S = {};
7689
- S = "HorizontalPodAutoscaler" === n.kind ? {
7654
+ }, f = {};
7655
+ f = "HorizontalPodAutoscaler" === n.kind ? {
7690
7656
resource: "horizontalpodautoscalers",
7691
7657
group: "autoscaling",
7692
7658
version: "v1"
7693
7659
} : {
7694
7660
resource: a.kindToResource(n.kind),
7695
7661
group: n.group
7696
- }, s.get(S , n.name, r).then(function(a) {
7662
+ }, s.get(f , n.name, r).then(function(a) {
7697
7663
if (e.labels = _.map(_.get(a, "metadata.labels", {}), function(e, t) {
7698
7664
return {
7699
7665
name: t,
@@ -7704,7 +7670,7 @@ minReplicas: _.get(a, "spec.minReplicas"),
7704
7670
maxReplicas: _.get(a, "spec.maxReplicas"),
7705
7671
targetCPU: _.get(a, "spec.targetCPUUtilizationPercentage")
7706
7672
}), e.disableInputs = !1, e.save = function() {
7707
- f (a);
7673
+ m (a);
7708
7674
}, e.breadcrumbs = i.getBreadcrumbs({
7709
7675
name: e.targetName,
7710
7676
kind: e.targetKind,
@@ -7716,7 +7682,40 @@ e.breadcrumbs = i.getBreadcrumbs({
7716
7682
object: a,
7717
7683
project: t,
7718
7684
subpage: "Autoscale"
7719
- }), e.save = m;
7685
+ }), e.save = function() {
7686
+ e.disableInputs = !0, h();
7687
+ var t = {
7688
+ apiVersion: "autoscaling/v1",
7689
+ kind: "HorizontalPodAutoscaler",
7690
+ metadata: {
7691
+ name: e.autoscaling.name,
7692
+ labels: p.mapEntries(p.compactEntries(e.labels))
7693
+ },
7694
+ spec: {
7695
+ scaleTargetRef: {
7696
+ kind: a.kind,
7697
+ name: a.metadata.name,
7698
+ apiVersion: a.apiVersion
7699
+ },
7700
+ minReplicas: e.autoscaling.minReplicas,
7701
+ maxReplicas: e.autoscaling.maxReplicas,
7702
+ targetCPUUtilizationPercentage: e.autoscaling.targetCPU
7703
+ }
7704
+ };
7705
+ s.create(y, null, t, r).then(function(e) {
7706
+ d.addNotification({
7707
+ type: "success",
7708
+ message: "Horizontal pod autoscaler " + e.metadata.name + " successfully created."
7709
+ }), v();
7710
+ }, function(t) {
7711
+ e.disableInputs = !1, d.addNotification({
7712
+ id: "edit-hpa-error",
7713
+ type: "error",
7714
+ message: "An error occurred creating the horizontal pod autoscaler.",
7715
+ details: g(t)
7716
+ });
7717
+ });
7718
+ };
7720
7719
var o = {}, l = function() {
7721
7720
var n = _.get(a, "spec.template.spec.containers", []);
7722
7721
e.showCPURequestWarning = !c.hasCPURequest(n, o, t);
0 commit comments