processRainSection returns true if the Rain section of the template existed The section is removed by this function
(t *cft.Template)
| 107 | // processRainSection returns true if the Rain section of the template existed |
| 108 | // The section is removed by this function |
| 109 | func processRainSection(t *cft.Template) error { |
| 110 | t.Constants = make(map[string]*yaml.Node) |
| 111 | rainNode, err := t.GetSection(cft.Rain) |
| 112 | if err != nil { |
| 113 | // This is okay, not all templates have a Rain section |
| 114 | return nil |
| 115 | } |
| 116 | |
| 117 | HasRainSection = true |
| 118 | |
| 119 | err = processConstants(t, rainNode) |
| 120 | if err != nil { |
| 121 | return err |
| 122 | } |
| 123 | |
| 124 | err = processPackages(t, t.Node) |
| 125 | if err != nil { |
| 126 | return err |
| 127 | } |
| 128 | |
| 129 | // Now remove the Rain node from the template |
| 130 | t.RemoveSection(cft.Rain) |
| 131 | |
| 132 | return nil |
| 133 | } |
| 134 | |
| 135 | // Template returns t with assets included as per AWS CLI packaging rules |
| 136 | // and any Rain:: functions used. |
no test coverage detected