@@ -8676,7 +8676,7 @@ return {
8676
8676
name:b,
8677
8677
value:a
8678
8678
};
8679
- }), a.systemLabels.push({
8679
+ }), L() && a.systemLabels.push({
8680
8680
name:"app",
8681
8681
value:a.template.metadata.name
8682
8682
});
@@ -8742,7 +8742,7 @@ type:"error"
8742
8742
});
8743
8743
d.length ? (a.disableInputs = !1, a.alerts = c) :c.length ? (J(c), a.disableInputs = !1) :I();
8744
8744
};
8745
- if ( a.createFromTemplate = function() {
8745
+ a.createFromTemplate = function() {
8746
8746
a.disableInputs = !0;
8747
8747
var b = s.mapEntries(s.compactEntries(a.labels)), c = s.mapEntries(s.compactEntries(a.systemLabels));
8748
8748
a.template.labels = _.extend(c, b), d.create("processedtemplates", null, a.template, f).then(function(b) {
@@ -8756,19 +8756,23 @@ message:"An error occurred processing the template.",
8756
8756
details:c
8757
8757
};
8758
8758
});
8759
- }, v) d.get("templates", u, {
8759
+ };
8760
+ var L = function() {
8761
+ return !_.get(a.template, "labels.app") && !_.some(a.template.objects, "metadata.labels.app");
8762
+ };
8763
+ if (v) d.get("templates", u, {
8760
8764
namespace:v || a.projectName
8761
8765
}).then(function(b) {
8762
8766
a.template = b, E(), a.breadcrumbs[3].title = n("displayName")(b);
8763
8767
}, function() {
8764
8768
m.toErrorPage("Cannot create from template: the specified template could not be retrieved.");
8765
8769
}); else {
8766
8770
if (a.template = r.getTemplate(), _.isEmpty(a.template)) {
8767
- var L = URI("error").query({
8771
+ var M = URI("error").query({
8768
8772
error:"not_found",
8769
8773
error_description:"Template wasn't found in cache."
8770
8774
}).toString();
8771
- j.url(L );
8775
+ j.url(M );
8772
8776
}
8773
8777
r.clearTemplate(), E();
8774
8778
}
0 commit comments