Upgrade dependent version: github.com/open-policy-agent/opa (#5315)

Upgrade dependent version: github.com/open-policy-agent/opa v0.18.0 -> v0.45.0

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
hongzhouzi
2022-10-31 10:58:55 +08:00
committed by GitHub
parent 668fca1773
commit ef03b1e3df
363 changed files with 277341 additions and 13544 deletions

View File

@@ -51,14 +51,18 @@ func WriteOne(ctx context.Context, store Store, op PatchOp, path Path, value int
// MakeDir inserts an empty object at path. If the parent path does not exist,
// MakeDir will create it recursively.
func MakeDir(ctx context.Context, store Store, txn Transaction, path Path) (err error) {
func MakeDir(ctx context.Context, store Store, txn Transaction, path Path) error {
// Allow the Store implementation to deal with this in its own way.
if md, ok := store.(MakeDirer); ok {
return md.MakeDir(ctx, txn, path)
}
if len(path) == 0 {
return nil
}
node, err := store.Read(ctx, txn, path)
if err != nil {
if !IsNotFound(err) {
return err
@@ -66,19 +70,15 @@ func MakeDir(ctx context.Context, store Store, txn Transaction, path Path) (err
if err := MakeDir(ctx, store, txn, path[:len(path)-1]); err != nil {
return err
} else if err := store.Write(ctx, txn, AddOp, path, map[string]interface{}{}); err != nil {
return err
}
return nil
return store.Write(ctx, txn, AddOp, path, map[string]interface{}{})
}
if _, ok := node.(map[string]interface{}); ok {
return nil
}
return writeConflictError(path)
}
// Txn is a convenience function that executes f inside a new transaction