Просмотр исходного кода

log newestimage from rerun or save with new values

jusrhee 5 лет назад
Родитель
Сommit
6d0e62e651

+ 22 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -179,8 +179,30 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
     let conf: string;
 
     if (!config) {
+      let values = {};
+
+      console.log("newest image", this.state.newestImage);
+      let imageUrl = this.state.newestImage;
+      let tag = null;
+  
+      if (imageUrl.includes(":")) {
+        let splits = imageUrl.split(":");
+        imageUrl = splits[0];
+        tag = splits[1];
+      } else if (!tag) {
+        tag = "latest";
+      }
+
+      if (imageUrl) {
+        _.set(values, "image.repository", imageUrl);
+        _.set(values, "image.tag", tag);
+      }
+
+      console.log("values before yaml", values)
+
       conf = yaml.dump({
         ...this.state.currentChart.config,
+        ...values,
       });
     } else {
       // Convert dotted keys to nested objects