Skip to content

Commit f99d267

Browse files
committed
(MODULES-9428) Make title_patterns mandatory
After conversation with Henrik, I'm certain that we should not burden the text or code with the complexity of having title_patterns optional.
1 parent 592d7c2 commit f99d267

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

language/resource-api/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ For autoloading to work, this code needs to go into `lib/puppet/type/<name>.rb`
7676

7777
Each resource being managed must be identified by a unique title. Usually this is fairly straightforward and a single attribute can be used to act as an identifier. Sometimes though, you need a composite of two or more attributes to uniquely identify the resource you want to manage.
7878

79-
If multiple attributes are defined with the `namevar` behaviour, the type SHOULD specify `title_patterns` that will tell Resource API how to get at the attributes from the title. If `title_patterns` is not specified a default pattern is applied, and matches the entire title against the first declared `namevar`.
80-
> Note: Not supplying a title_pattern that assigns values to all namevars will severely restrict the usability of the provider.
79+
If multiple attributes are defined with the `namevar` behaviour, the type must specify `title_patterns` that will tell Resource API how to get at the attributes from the title.
8180

82-
The title_patterns are evaluated in the order they are specified. Evaluation stops after the first match is achieved.
81+
The `title_patterns` are evaluated in the order they are specified. Evaluation stops after the first match is achieved.
8382

8483
Each title pattern contains the:
8584
* `pattern`, which is a ruby regex containing named captures. The names of the captures MUST be that of the namevar attributes.

0 commit comments

Comments
 (0)