plancontext: use helpers to determine if CUE value is secret/fs/service

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-12-07 14:16:14 -05:00
parent 201ac391b4
commit c881bc2dba
7 changed files with 31 additions and 28 deletions

View File

@@ -18,6 +18,10 @@ var (
)
)
func IsFSValue(v *compiler.Value) bool {
return v.LookupPath(fsIDPath).Exists()
}
type FS struct {
id string
result bkgw.Reference
@@ -54,10 +58,6 @@ func (c *fsContext) New(result bkgw.Reference) *FS {
return fs
}
func (c *fsContext) Contains(v *compiler.Value) bool {
return v.LookupPath(fsIDPath).Exists()
}
func (c *fsContext) FromValue(v *compiler.Value) (*FS, error) {
c.l.RLock()
defer c.l.RUnlock()