Repeat-condition construct 编辑
Repeat-condition construct
The repeat-condition construct is evaluated in each iteration of a repeat construct and the result determines whether to build the configuration object in that iteration or to move to the next iteration. The following example shows the use of the repeat-condition construct:
Example:
components
-
name: der-key-files-comp
type: ns::systemfile
repeat:
repeat-list: $parameters.certificates
repeat-item: certificate
repeat-condition: $certificate.ssl-inform == DER
properties:
filecontent: base64($certificate.keyfile.contents)
fileencoding: BASE64
filelocation: /nsconfig/ssl
filename: $certificate.keyfile.file
<!--NeedCopy-->
In this example, the der-key-files-comp
component iterates over all the certificates given by the user but it only builds configuration objects that correspond to certificates with DER encoding. In each iteration, the repeat-condition expression is evaluated to test whether the certificate encoding is of type DER. If it is not of type DER, no configuration object is built in the current iteration, and the iteration moves to the next certificate in the list.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论