@@ -6892,9 +6892,9 @@ d.then(e);
6892
6892
e.unwatchAll(z);
6893
6893
});
6894
6894
}));
6895
- } ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "EnvironmentService", "HPAService", "ImageStreamResolver", "Logger", "MetricsService", "ModalsService", "Navigate", "PodsService", "ProjectsService", "StorageService", "keyValueEditorUtils", "kind", function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
6896
- var t = !1, u = b("annotation"), v = b("humanizeKind")(s );
6897
- switch (s ) {
6895
+ } ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "EnvironmentService", "HPAService", "ImageStreamResolver", "Logger", "MetricsService", "ModalsService", "Navigate", "OwnerReferencesService", " PodsService", "ProjectsService", "StorageService", "keyValueEditorUtils", "kind", function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t ) {
6896
+ var u = !1, v = b("annotation"), w = b("humanizeKind")(t), x = b("hasDeployment" );
6897
+ switch (t ) {
6898
6898
case "ReplicaSet":
6899
6899
a.resource = {
6900
6900
group:"extensions",
@@ -6905,19 +6905,19 @@ break;
6905
6905
case "ReplicationController":
6906
6906
a.resource = "replicationcontrollers", a.healthCheckURL = n.healthCheckURL(c.project, "ReplicationController", c.replicaSet);
6907
6907
}
6908
- var w = {};
6909
- a.projectName = c.project, a.kind = s , a.replicaSet = null, a.deploymentConfig = null, a.deploymentConfigMissing = !1, a.imagesByDockerReference = {}, a.builds = {}, a.alerts = {}, a.renderOptions = a.renderOptions || {}, a.renderOptions.hideFilterWidget = !0, a.forms = {}, a.logOptions = {};
6910
- var x = [];
6908
+ var y = {};
6909
+ a.projectName = c.project, a.kind = t , a.replicaSet = null, a.deploymentConfig = null, a.deploymentConfigMissing = !1, a.imagesByDockerReference = {}, a.builds = {}, a.alerts = {}, a.renderOptions = a.renderOptions || {}, a.renderOptions.hideFilterWidget = !0, a.forms = {}, a.logOptions = {};
6910
+ var z = [];
6911
6911
l.isAvailable().then(function(b) {
6912
6912
a.metricsAvailable = b;
6913
6913
});
6914
- var y, z = b("deploymentStatus"), A = function(b) {
6915
- a.logCanRun = !_.includes([ "New", "Pending" ], z (b));
6916
- }, B = !1, C = function(c, d) {
6917
- if (!B ) {
6914
+ var A, B = b("deploymentStatus"), C = function(b) {
6915
+ a.logCanRun = !_.includes([ "New", "Pending" ], B (b));
6916
+ }, D = !1, E = function(c, d) {
6917
+ if (!D ) {
6918
6918
if (!a.forms.envForm || a.forms.envForm.$pristine) return void (a.updatedReplicaSet = h.copyAndNormalize(c));
6919
6919
if (h.isEnvironmentEqual(c, d)) return void (a.updatedReplicaSet = h.mergeEdits(a.updatedReplicaSet, c));
6920
- B = !0, a.alerts["env-conflict"] = {
6920
+ D = !0, a.alerts["env-conflict"] = {
6921
6921
type:"warning",
6922
6922
message:"The environment variables for the " + b("humanizeKind")(a.replicaSet.kind) + " have been updated in the background. Saving your changes may create a conflict or cause loss of data.",
6923
6923
links:[ {
@@ -6930,7 +6930,7 @@ return a.clearEnvVarUpdates(), !0;
6930
6930
}
6931
6931
};
6932
6932
a.saveEnvVars = function() {
6933
- h.compact(a.updatedReplicaSet), y = f.update(a.resource, c.replicaSet, a.updatedReplicaSet, a.projectContext), y .then(function() {
6933
+ h.compact(a.updatedReplicaSet), A = f.update(a.resource, c.replicaSet, a.updatedReplicaSet, a.projectContext), A .then(function() {
6934
6934
a.alerts.saveEnvSuccess = {
6935
6935
type:"success",
6936
6936
message:a.replicaSet.metadata.name + " was updated."
@@ -6943,54 +6943,54 @@ details:b("getErrorDetails")(c)
6943
6943
};
6944
6944
});
6945
6945
}, a.clearEnvVarUpdates = function() {
6946
- a.updatedReplicaSet = h.copyAndNormalize(a.replicaSet), a.forms.envForm.$setPristine(), B = !1;
6946
+ a.updatedReplicaSet = h.copyAndNormalize(a.replicaSet), a.forms.envForm.$setPristine(), D = !1;
6947
6947
};
6948
- var D = b("isIE")() || b("isEdge")(), E = b("orderByDisplayName"), F = b("getErrorDetails"), G = function(b, c) {
6948
+ var F = b("isIE")() || b("isEdge")(), G = b("orderByDisplayName"), H = b("getErrorDetails"), I = function(b, c) {
6949
6949
a.alerts["from-value-objects"] = {
6950
6950
type:"error",
6951
6951
message:b,
6952
6952
details:c
6953
6953
};
6954
- }, H = [], I = [];
6955
- a.valueFromObjects = [], p .get(c.project).then(_.spread(function(h, l) {
6954
+ }, J = [], K = [];
6955
+ a.valueFromObjects = [], q .get(c.project).then(_.spread(function(h, l) {
6956
6956
a.project = h, a.projectContext = l, f.list("configmaps", l, null, {
6957
6957
errorNotification:!1
6958
6958
}).then(function(b) {
6959
- H = E (b.by("metadata.name")), a.valueFromObjects = H .concat(I );
6959
+ J = G (b.by("metadata.name")), a.valueFromObjects = J .concat(K );
6960
6960
}, function(a) {
6961
- 403 !== a.code && G ("Could not load config maps", F (a));
6961
+ 403 !== a.code && I ("Could not load config maps", H (a));
6962
6962
}), f.list("secrets", l, null, {
6963
6963
errorNotification:!1
6964
6964
}).then(function(b) {
6965
- I = E (b.by("metadata.name")), a.valueFromObjects = I .concat(H );
6965
+ K = G (b.by("metadata.name")), a.valueFromObjects = K .concat(J );
6966
6966
}, function(a) {
6967
- 403 !== a.code && G ("Could not load secrets", F (a));
6967
+ 403 !== a.code && I ("Could not load secrets", H (a));
6968
6968
});
6969
- var p = {}, r = function() {
6970
- if (a.hpaForRS = i.filterHPA(p, s , c.replicaSet), a.deploymentConfigName && a.isActive) {
6971
- var b = i.filterHPA(p , "DeploymentConfig", a.deploymentConfigName);
6969
+ var q = {}, s = function() {
6970
+ if (a.hpaForRS = i.filterHPA(q, t , c.replicaSet), a.deploymentConfigName && a.isActive) {
6971
+ var b = i.filterHPA(q , "DeploymentConfig", a.deploymentConfigName);
6972
6972
a.autoscalers = a.hpaForRS.concat(b);
6973
6973
} else if (a.deployment && a.isActive) {
6974
- var d = i.filterHPA(p , "Deployment", a.deployment.metadata.name);
6974
+ var d = i.filterHPA(q , "Deployment", a.deployment.metadata.name);
6975
6975
a.autoscalers = a.hpaForRS.concat(d);
6976
6976
} else a.autoscalers = a.hpaForRS;
6977
- }, B = function() {
6978
- x .push(f.watch(a.resource, l, function(b) {
6977
+ }, D = function() {
6978
+ z .push(f.watch(a.resource, l, function(b) {
6979
6979
var c, d = [];
6980
6980
angular.forEach(b.by("metadata.name"), function(b) {
6981
- var c = u (b, "deploymentConfig") || "";
6981
+ var c = v (b, "deploymentConfig") || "";
6982
6982
c === a.deploymentConfigName && d.push(b);
6983
- }), c = g.getActiveDeployment(d), a.isActive = c && c.metadata.uid === a.replicaSet.metadata.uid, r ();
6983
+ }), c = g.getActiveDeployment(d), a.isActive = c && c.metadata.uid === a.replicaSet.metadata.uid, s ();
6984
6984
}));
6985
- }, J = function() {
6985
+ }, L = function() {
6986
6986
i.getHPAWarnings(a.replicaSet, a.autoscalers, a.limitRanges, h).then(function(b) {
6987
6987
a.hpaWarnings = b;
6988
6988
});
6989
- }, K = function(d) {
6990
- var e = u (d, "deploymentConfig");
6989
+ }, M = function(d) {
6990
+ var e = v (d, "deploymentConfig");
6991
6991
if (e) {
6992
- t = !0, a.deploymentConfigName = e;
6993
- var g = u (d, "deploymentVersion");
6992
+ u = !0, a.deploymentConfigName = e;
6993
+ var g = v (d, "deploymentVersion");
6994
6994
g && (a.logOptions.version = g), a.healthCheckURL = n.healthCheckURL(c.project, "DeploymentConfig", e), f.get("deploymentconfigs", e, l, {
6995
6995
errorNotification:!1
6996
6996
}).then(function(b) {
@@ -7003,125 +7003,129 @@ details:b("getErrorDetails")(c)
7003
7003
});
7004
7004
});
7005
7005
}
7006
- }, L = function() {
7006
+ }, N = function() {
7007
7007
a.isActive = g.isActiveReplicaSet(a.replicaSet, a.deployment);
7008
- }, M = b("hasDeployment"), N = !1, O = function() {
7009
- M(a.replicaSet) && f.list({
7008
+ }, O = function(b) {
7009
+ return _.some(b, function(b) {
7010
+ if (_.get(b, "status.replicas") && _.get(b, "metadata.uid") !== _.get(a.replicaSet, "metadata.uid")) {
7011
+ var c = o.getControllerReferences(b);
7012
+ return _.some(c, {
7013
+ uid:a.deployment.metadata.uid
7014
+ });
7015
+ }
7016
+ });
7017
+ }, P = !1, Q = function() {
7018
+ var b = o.getControllerReferences(a.replicaSet), d = _.find(b, {
7019
+ kind:"Deployment"
7020
+ });
7021
+ d && f.get({
7010
7022
group:"extensions",
7011
7023
resource:"deployments"
7012
- }, l).then(function(b) {
7013
- var d = b.by("metadata.name"), h = new LabelSelector(a.replicaSet.spec.selector);
7014
- return a.deployment = _.find(d, function(a) {
7015
- var b = new LabelSelector(a.spec.selector);
7016
- return b.covers(h);
7017
- }), a.deployment ? (a.healthCheckURL = n.healthCheckURL(c.project, "Deployment", a.deployment.metadata.name, "extensions"), x.push(f.watchObject({
7024
+ }, d.name, l).then(function(b) {
7025
+ a.deployment = b, a.healthCheckURL = n.healthCheckURL(c.project, "Deployment", b.metadata.name, "extensions"), z.push(f.watchObject({
7018
7026
group:"extensions",
7019
7027
resource:"deployments"
7020
- }, a.deployment .metadata.name, l, function(b, d) {
7028
+ }, b .metadata.name, l, function(b, d) {
7021
7029
return "DELETED" === d ? (a.alerts["deployment-deleted"] = {
7022
7030
type:"warning",
7023
7031
message:"The deployment controlling this replica set has been deleted."
7024
- }, a.healthCheckURL = n.healthCheckURL(c.project, "ReplicaSet", c.replicaSet, "extensions"), a.deploymentMissing = !0, void delete a.deployment) :(a.breadcrumbs = e.getBreadcrumbs({
7032
+ }, a.healthCheckURL = n.healthCheckURL(c.project, "ReplicaSet", c.replicaSet, "extensions"), a.deploymentMissing = !0, void delete a.deployment) :(a.deployment = b, a. breadcrumbs = e.getBreadcrumbs({
7025
7033
object:a.replicaSet,
7026
7034
displayName:"#" + g.getRevision(a.replicaSet),
7027
7035
parent:{
7028
7036
title:a.deployment.metadata.name,
7029
7037
link:n.resourceURL(a.deployment)
7030
7038
},
7031
7039
humanizedKind:"Deployments"
7032
- }), L (), void r ());
7033
- })), void x .push(f.watch({
7040
+ }), N (), void s ());
7041
+ })), z .push(f.watch({
7034
7042
group:"extensions",
7035
7043
resource:"replicasets"
7036
- }, l, function(b) {
7037
- var c = new LabelSelector(a.deployment.spec.selector);
7038
- N = !1;
7039
- var d = 0;
7040
- _.each(b.by("metadata.name"), function(a) {
7041
- if (a.status.replicas && c.covers(new LabelSelector(a.spec.selector))) return d++, d > 1 ? (N = !0, !1) :void 0;
7042
- });
7043
- }))) :void (a.deploymentMissing = !0);
7044
+ }, l, function(a) {
7045
+ var b = a.by("metadata.name");
7046
+ P = O(b);
7047
+ }));
7044
7048
});
7045
- }, P = function() {
7046
- if (!_.isEmpty(w )) {
7049
+ }, R = function() {
7050
+ if (!_.isEmpty(y )) {
7047
7051
var b = _.get(a, "replicaSet.spec.template");
7048
- b && j.fetchReferencedImageStreamImages([ b ], a.imagesByDockerReference, w , l);
7052
+ b && j.fetchReferencedImageStreamImages([ b ], a.imagesByDockerReference, y , l);
7049
7053
}
7050
7054
};
7051
7055
f.get(a.resource, c.replicaSet, l, {
7052
7056
errorNotification:!1
7053
7057
}).then(function(b) {
7054
- switch (a.loaded = !0, a.replicaSet = b, A (b), s ) {
7058
+ switch (a.loaded = !0, a.replicaSet = b, C (b), t ) {
7055
7059
case "ReplicationController":
7056
- K (b);
7060
+ M (b);
7057
7061
break;
7058
7062
7059
7063
case "ReplicaSet":
7060
- O ();
7064
+ Q ();
7061
7065
}
7062
- J (), a.breadcrumbs = e.getBreadcrumbs({
7066
+ L (), a.breadcrumbs = e.getBreadcrumbs({
7063
7067
object:b
7064
- }), x .push(f.watchObject(a.resource, c.replicaSet, l, function(b, c) {
7068
+ }), z .push(f.watchObject(a.resource, c.replicaSet, l, function(b, c) {
7065
7069
"DELETED" === c && (a.alerts.deleted = {
7066
7070
type:"warning",
7067
- message:"This " + v + " has been deleted."
7071
+ message:"This " + w + " has been deleted."
7068
7072
});
7069
7073
var d = a.replicaSet;
7070
- a.replicaSet = b, y ? y ["finally"](function() {
7071
- C (b, d);
7072
- }) :C (b, d), A (b), J (), P ();
7073
- })), a.deploymentConfigName && B (), x .push(f.watch("pods", l, function(b) {
7074
+ a.replicaSet = b, A ? A ["finally"](function() {
7075
+ E (b, d);
7076
+ }) :E (b, d), C (b), L (), R(), a.deployment && N ();
7077
+ })), a.deploymentConfigName && D (), z .push(f.watch("pods", l, function(b) {
7074
7078
var c = b.by("metadata.name");
7075
- a.podsForDeployment = o .filterForOwner(c, a.replicaSet);
7079
+ a.podsForDeployment = p .filterForOwner(c, a.replicaSet);
7076
7080
}));
7077
7081
}, function(d) {
7078
7082
a.loaded = !0, a.alerts.load = {
7079
7083
type:"error",
7080
- message:"The " + v + " details could not be loaded.",
7084
+ message:"The " + w + " details could not be loaded.",
7081
7085
details:b("getErrorDetails")(d)
7082
7086
}, a.breadcrumbs = e.getBreadcrumbs({
7083
7087
name:c.replicaSet,
7084
- kind:s ,
7088
+ kind:t ,
7085
7089
namespace:c.project
7086
7090
});
7087
- }), x .push(f.watch(a.resource, l, function(c, d, e) {
7088
- a.replicaSets = c.by("metadata.name"), "ReplicationController" === s && (a.deploymentsByDeploymentConfig = g.associateDeploymentsToDeploymentConfig(a.replicaSets));
7091
+ }), z .push(f.watch(a.resource, l, function(c, d, e) {
7092
+ a.replicaSets = c.by("metadata.name"), "ReplicationController" === t && (a.deploymentsByDeploymentConfig = g.associateDeploymentsToDeploymentConfig(a.replicaSets));
7089
7093
var f, h;
7090
- e && (f = u (e, "deploymentConfig"), h = e.metadata.name), a.deploymentConfigDeploymentsInProgress = a.deploymentConfigDeploymentsInProgress || {}, d ? "ADDED" === d || "MODIFIED" === d && b("deploymentIsInProgress")(e) ? (a.deploymentConfigDeploymentsInProgress[f] = a.deploymentConfigDeploymentsInProgress[f] || {}, a.deploymentConfigDeploymentsInProgress[f][h] = e) :"MODIFIED" === d && a.deploymentConfigDeploymentsInProgress[f] && delete a.deploymentConfigDeploymentsInProgress[f][h] :a.deploymentConfigDeploymentsInProgress = g.associateRunningDeploymentToDeploymentConfig(a.deploymentsByDeploymentConfig), e ? "DELETED" !== d && (e.causes = b("deploymentCauses")(e)) :angular.forEach(a.replicaSets, function(a) {
7094
+ e && (f = v (e, "deploymentConfig"), h = e.metadata.name), a.deploymentConfigDeploymentsInProgress = a.deploymentConfigDeploymentsInProgress || {}, d ? "ADDED" === d || "MODIFIED" === d && b("deploymentIsInProgress")(e) ? (a.deploymentConfigDeploymentsInProgress[f] = a.deploymentConfigDeploymentsInProgress[f] || {}, a.deploymentConfigDeploymentsInProgress[f][h] = e) :"MODIFIED" === d && a.deploymentConfigDeploymentsInProgress[f] && delete a.deploymentConfigDeploymentsInProgress[f][h] :a.deploymentConfigDeploymentsInProgress = g.associateRunningDeploymentToDeploymentConfig(a.deploymentsByDeploymentConfig), e ? "DELETED" !== d && (e.causes = b("deploymentCauses")(e)) :angular.forEach(a.replicaSets, function(a) {
7091
7095
a.causes = b("deploymentCauses")(a);
7092
7096
});
7093
- })), x .push(f.watch("imagestreams", l, function(a) {
7097
+ })), z .push(f.watch("imagestreams", l, function(a) {
7094
7098
var b = a.by("metadata.name");
7095
- j.buildDockerRefMapForImageStreams(b, w ), P (), k.log("imagestreams (subscribe)", b);
7096
- })), x .push(f.watch("builds", l, function(b) {
7099
+ j.buildDockerRefMapForImageStreams(b, y ), R (), k.log("imagestreams (subscribe)", b);
7100
+ })), z .push(f.watch("builds", l, function(b) {
7097
7101
a.builds = b.by("metadata.name"), k.log("builds (subscribe)", a.builds);
7098
- })), x .push(f.watch({
7102
+ })), z .push(f.watch({
7099
7103
group:"autoscaling",
7100
7104
resource:"horizontalpodautoscalers",
7101
7105
version:"v1"
7102
7106
}, l, function(a) {
7103
- p = a.by("metadata.name"), r (), J ();
7107
+ q = a.by("metadata.name"), s (), L ();
7104
7108
}, {
7105
- poll:D ,
7109
+ poll:F ,
7106
7110
pollInterval:6e4
7107
7111
})), f.list("limitranges", l).then(function(b) {
7108
- a.limitRanges = b.by("metadata.name"), J ();
7112
+ a.limitRanges = b.by("metadata.name"), L ();
7109
7113
});
7110
- var Q = 6e4;
7111
- x .push(f.watch("resourcequotas", l, function(b) {
7114
+ var S = 6e4;
7115
+ z .push(f.watch("resourcequotas", l, function(b) {
7112
7116
a.quotas = b.by("metadata.name");
7113
7117
}, {
7114
7118
poll:!0,
7115
- pollInterval:Q
7116
- })), x .push(f.watch("appliedclusterresourcequotas", l, function(b) {
7119
+ pollInterval:S
7120
+ })), z .push(f.watch("appliedclusterresourcequotas", l, function(b) {
7117
7121
a.clusterQuotas = b.by("metadata.name");
7118
7122
}, {
7119
7123
poll:!0,
7120
- pollInterval:Q
7124
+ pollInterval:S
7121
7125
}));
7122
- var R = b("deploymentIsLatest");
7126
+ var T = b("deploymentIsLatest");
7123
7127
a.showRollbackAction = function() {
7124
- return "Complete" === z (a.replicaSet) && !R (a.replicaSet, a.deploymentConfig) && !a.replicaSet.metadata.deletionTimestamp && d.canI("deploymentconfigrollbacks", "create");
7128
+ return "Complete" === B (a.replicaSet) && !T (a.replicaSet, a.deploymentConfig) && !a.replicaSet.metadata.deletionTimestamp && d.canI("deploymentconfigrollbacks", "create");
7125
7129
}, a.retryFailedDeployment = function(b) {
7126
7130
g.retryFailedDeployment(b, l, a);
7127
7131
}, a.rollbackToDeployment = function(b, c, d, e) {
@@ -7138,9 +7142,9 @@ details:b("getErrorDetails")(c)
7138
7142
}, e = a.deployment || a.deploymentConfig || a.replicaSet;
7139
7143
g.scale(e, c).then(_.noop, d);
7140
7144
};
7141
- var S = b("hasDeploymentConfig");
7145
+ var U = b("hasDeploymentConfig");
7142
7146
a.isScalable = function() {
7143
- return !!_.isEmpty(a.autoscalers) && (!S (a.replicaSet) && !M (a.replicaSet) || (!(!a.deploymentConfigMissing && !a.deploymentMissing) || !(!a.deploymentConfig && !a.deployment) && (a.isActive && !N )));
7147
+ return !!_.isEmpty(a.autoscalers) && (!U (a.replicaSet) && !x (a.replicaSet) || (!(!a.deploymentConfigMissing && !a.deploymentMissing) || !(!a.deploymentConfig && !a.deployment) && (a.isActive && !P )));
7144
7148
}, a.removeVolume = function(c) {
7145
7149
var d = "This will remove the volume from the " + b("humanizeKind")(a.replicaSet.kind) + ".";
7146
7150
c.persistentVolumeClaim ? d += " It will not delete the persistent volume claim." :c.secret ? d += " It will not delete the secret." :c.configMap && (d += " It will not delete the config map.");
@@ -7151,11 +7155,11 @@ okButtonText:"Remove",
7151
7155
okButtonClass:"btn-danger",
7152
7156
cancelButtonText:"Cancel"
7153
7157
}), f = function() {
7154
- q .removeVolume(a.replicaSet, c, l);
7158
+ r .removeVolume(a.replicaSet, c, l);
7155
7159
};
7156
7160
e.then(f);
7157
7161
}, a.$on("$destroy", function() {
7158
- f.unwatchAll(x );
7162
+ f.unwatchAll(z );
7159
7163
});
7160
7164
}));
7161
7165
} ]), angular.module("openshiftConsole").controller("StatefulSetsController", [ "$scope", "$routeParams", "DataService", "ProjectsService", "LabelFilter", "PodsService", function(a, b, c, d, e, f) {
0 commit comments