Browse Source

override default values in form.yaml

sunguroku 5 years ago
parent
commit
c3366b80d4

+ 0 - 1
dashboard/src/components/values-form/ValuesForm.tsx

@@ -120,7 +120,6 @@ export default class ValuesForm extends Component<PropsType, StateType> {
   renderFormContents = () => {
     if (this.state) {
       return this.props.sections.map((section: Section, i: number) => {
-
         // Hide collapsible section if deciding field is false
         if (section.show_if) {
           if (!this.state[section.show_if]) {

+ 4 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -87,6 +87,9 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
     for (const file of files) { 
       if (file.name === 'form.yaml') {
         let formData = yaml.load(Base64.decode(file.data));
+        if (this.props.currentChart.config) {
+          console.log(formData)
+        }
         return formData;
       }
     };
@@ -107,7 +110,7 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
       service_account_id: currentCluster.service_account_id,
     }, (err: any, res: any) => {
       if (err) {
-        setCurrentError(err.response.data);
+        setCurrentError(err);
         this.setState({ saveValuesStatus: 'error' });
       } else {
         this.setState({ saveValuesStatus: 'successful' });

+ 1 - 2
dashboard/src/main/home/cluster-dashboard/expanded-chart/ValuesYaml.tsx

@@ -59,7 +59,7 @@ export default class ValuesYaml extends Component<PropsType, StateType> {
       service_account_id: currentCluster.service_account_id,
     }, (err: any, res: any) => {
       if (err) {
-        setCurrentError(err.response.data);
+        console.log(err)
         this.setState({ saveValuesStatus: 'error' });
       } else {
         this.setState({ saveValuesStatus: 'successful' });
@@ -69,7 +69,6 @@ export default class ValuesYaml extends Component<PropsType, StateType> {
   }
 
   render() {
-    console.log('values', this.state.values)
     return (
       <StyledValuesYaml>
         <Wrapper>

+ 1 - 0
v.yml

@@ -0,0 +1 @@
+ok: true