insertDryRun returns an error if calling insertResource with the given resource name would fail.
(kind ResourceKind, name string)
| 841 | |
| 842 | // insertDryRun returns an error if calling insertResource with the given resource name would fail. |
| 843 | func (p *Parser) insertDryRun(kind ResourceKind, name string) error { |
| 844 | rn := ResourceName{Kind: kind, Name: name} |
| 845 | _, ok := p.Resources[rn.Normalized()] |
| 846 | if ok { |
| 847 | return externalError{err: fmt.Errorf("name collision: another resource of type %q is also named %q", rn.Kind, rn.Name)} |
| 848 | } |
| 849 | return nil |
| 850 | } |
| 851 | |
| 852 | // insertResource inserts a resource in the parser's internal state. |
| 853 | // After calling insertResource, the caller can directly modify the returned resource's spec. |
no test coverage detected