From fe3f42a6b8ffde06e917d92c0889887c7f2a8222 Mon Sep 17 00:00:00 2001 From: Kris Jacque Date: Wed, 4 Sep 2024 06:36:35 -0600 Subject: [PATCH] DAOS-16245 control: Fix dmg cont set-owner (#14945) (#15042) - Fix bug where all CONT_PROP_SET RPCs were sent directly to ds_cont_op_hdlr instead of using the custom set_prop handler that detected server vs. client RPCs. ds_cont_op_hdlr now detects server RPCs and calls the appropriate handler. - Add CONT_PROP_SET_BYLABEL RPC to allow for container label usage via dmg (without pool/cont handles). - Update dmg cont set-owner command to accept positional arguments and allow either UUIDs or labels. Signed-off-by: Kris Jacque --- src/container/rpc.c | 3 +- src/container/rpc.h | 58 ++++- src/container/srv_container.c | 163 +++++++----- src/container/srv_internal.h | 3 +- src/control/cmd/daos/acl.go | 14 +- src/control/cmd/dmg/command_test.go | 2 +- src/control/cmd/dmg/cont.go | 45 ++-- src/control/cmd/dmg/cont_test.go | 44 ++-- src/control/cmd/dmg/json_test.go | 3 +- src/control/common/proto/mgmt/addons.go | 4 +- src/control/common/proto/mgmt/cont.pb.go | 122 +++------ src/control/common/proto/mgmt/mgmt.pb.go | 238 +++++++++--------- src/control/common/proto/mgmt/mgmt_grpc.pb.go | 10 +- src/control/lib/control/cont.go | 26 +- src/control/lib/control/cont_test.go | 70 +++--- src/control/server/mgmt_cont.go | 6 +- src/control/server/mgmt_cont_test.go | 24 +- src/include/daos_srv/container.h | 5 +- src/mgmt/cont.pb-c.c | 107 +------- src/mgmt/cont.pb-c.h | 54 +--- src/mgmt/srv_container.c | 39 +-- src/mgmt/srv_drpc.c | 32 +-- src/mgmt/srv_internal.h | 6 +- src/mgmt/tests/mocks.c | 16 +- src/mgmt/tests/mocks.h | 10 +- src/mgmt/tests/srv_drpc_tests.c | 77 +++--- src/proto/mgmt/cont.proto | 17 +- src/proto/mgmt/mgmt.proto | 4 +- src/tests/ftest/security/cont_get_acl.yaml | 1 + src/tests/ftest/security/cont_owner.py | 75 ++++++ .../ftest/util/cont_security_test_base.py | 4 +- src/tests/ftest/util/daos_utils.py | 2 +- src/tests/ftest/util/dmg_utils.py | 8 +- src/tests/ftest/util/dmg_utils_base.py | 8 +- 34 files changed, 628 insertions(+), 672 deletions(-) diff --git a/src/container/rpc.c b/src/container/rpc.c index 6c3e96b57c0..51a13ed256e 100644 --- a/src/container/rpc.c +++ b/src/container/rpc.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2016-2023 Intel Corporation. + * (C) Copyright 2016-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -134,6 +134,7 @@ CRT_RPC_DEFINE(cont_tgt_snapshot_notify, DAOS_ISEQ_CONT_TGT_SNAPSHOT_NOTIFY, DAOS_OSEQ_CONT_TGT_SNAPSHOT_NOTIFY) CRT_RPC_DEFINE(cont_prop_set, DAOS_ISEQ_CONT_PROP_SET, DAOS_OSEQ_CONT_PROP_SET) CRT_RPC_DEFINE(cont_prop_set_v8, DAOS_ISEQ_CONT_PROP_SET_V8, DAOS_OSEQ_CONT_PROP_SET) +CRT_RPC_DEFINE(cont_prop_set_bylabel, DAOS_ISEQ_CONT_PROP_SET_BYLABEL, DAOS_OSEQ_CONT_PROP_SET) CRT_RPC_DEFINE(cont_acl_update, DAOS_ISEQ_CONT_ACL_UPDATE, DAOS_OSEQ_CONT_ACL_UPDATE) CRT_RPC_DEFINE(cont_acl_update_v8, DAOS_ISEQ_CONT_ACL_UPDATE_V8, DAOS_OSEQ_CONT_ACL_UPDATE) CRT_RPC_DEFINE(cont_acl_delete, DAOS_ISEQ_CONT_ACL_DELETE, DAOS_OSEQ_CONT_ACL_DELETE) diff --git a/src/container/rpc.h b/src/container/rpc.h index 61e66af5ced..7d15dba4c58 100644 --- a/src/container/rpc.h +++ b/src/container/rpc.h @@ -1,5 +1,5 @@ /** - * (C) Copyright 2016-2023 Intel Corporation. + * (C) Copyright 2016-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -74,7 +74,8 @@ X(CONT_TGT_EPOCH_AGGREGATE, 0, &CQF_cont_tgt_epoch_aggregate, \ ds_cont_tgt_epoch_aggregate_handler, &ds_cont_tgt_epoch_aggregate_co_ops) \ X(CONT_TGT_SNAPSHOT_NOTIFY, 0, &CQF_cont_tgt_snapshot_notify, \ - ds_cont_tgt_snapshot_notify_handler, &ds_cont_tgt_snapshot_notify_co_ops) + ds_cont_tgt_snapshot_notify_handler, &ds_cont_tgt_snapshot_notify_co_ops) \ + X(CONT_PROP_SET_BYLABEL, 0, &CQF_cont_prop_set_bylabel, ds_cont_set_prop_srv_handler, NULL) /* Define for RPC enum population below */ #define X(a, ...) a, @@ -919,24 +920,43 @@ CRT_RPC_DECLARE(cont_tgt_snapshot_notify, DAOS_ISEQ_CONT_TGT_SNAPSHOT_NOTIFY, CRT_RPC_DECLARE(cont_prop_set, DAOS_ISEQ_CONT_PROP_SET, DAOS_OSEQ_CONT_PROP_SET) CRT_RPC_DECLARE(cont_prop_set_v8, DAOS_ISEQ_CONT_PROP_SET_V8, DAOS_OSEQ_CONT_PROP_SET) +#define DAOS_ISEQ_CONT_PROP_SET_BYLABEL /* input fields */ \ + DAOS_ISEQ_CONT_PROP_SET_V8 \ + ((d_const_string_t) (cpsi_label) CRT_VAR) + +CRT_RPC_DECLARE(cont_prop_set_bylabel, DAOS_ISEQ_CONT_PROP_SET_BYLABEL, DAOS_OSEQ_CONT_PROP_SET) + /* clang-format on */ static inline void cont_prop_set_in_get_data(crt_rpc_t *rpc, crt_opcode_t opc, int cont_proto_ver, - daos_prop_t **cpsi_propp, uuid_t *cpsi_pool_uuidp) + daos_prop_t **cpsi_propp, uuid_t *cpsi_pool_uuidp, uuid_t *cpsi_co_uuidp, + const char **cont_label) { void *in = crt_req_get(rpc); - if (cont_proto_ver >= CONT_PROTO_VER_WITH_SVC_OP_KEY) { + if (opc == CONT_PROP_SET_BYLABEL) { + *cpsi_propp = ((struct cont_prop_set_bylabel_in *)in)->cpsi_prop; + if (cpsi_pool_uuidp) + uuid_copy(*cpsi_pool_uuidp, + ((struct cont_prop_set_bylabel_in *)in)->cpsi_pool_uuid); + if (cont_label != NULL) + *cont_label = ((struct cont_prop_set_bylabel_in *)in)->cpsi_label; + } else if (cont_proto_ver >= CONT_PROTO_VER_WITH_SVC_OP_KEY) { *cpsi_propp = ((struct cont_prop_set_v8_in *)in)->cpsi_prop; if (cpsi_pool_uuidp) uuid_copy(*cpsi_pool_uuidp, ((struct cont_prop_set_v8_in *)in)->cpsi_pool_uuid); + if (cpsi_co_uuidp) + uuid_copy(*cpsi_co_uuidp, + ((struct cont_prop_set_v8_in *)in)->cpsi_op.ci_uuid); } else { *cpsi_propp = ((struct cont_prop_set_in *)in)->cpsi_prop; if (cpsi_pool_uuidp) uuid_copy(*cpsi_pool_uuidp, ((struct cont_prop_set_in *)in)->cpsi_pool_uuid); + if (cpsi_co_uuidp) + uuid_copy(*cpsi_co_uuidp, ((struct cont_prop_set_in *)in)->cpsi_op.ci_uuid); } } @@ -946,16 +966,42 @@ cont_prop_set_in_set_data(crt_rpc_t *rpc, crt_opcode_t opc, int cont_proto_ver, { void *in = crt_req_get(rpc); - if (cont_proto_ver >= CONT_PROTO_VER_WITH_SVC_OP_KEY) { + if (opc == CONT_PROP_SET_BYLABEL) { + ((struct cont_prop_set_bylabel_in *)in)->cpsi_prop = cpsi_prop; + uuid_copy(((struct cont_prop_set_bylabel_in *)in)->cpsi_pool_uuid, cpsi_pool_uuid); + } else if (cont_proto_ver >= CONT_PROTO_VER_WITH_SVC_OP_KEY) { ((struct cont_prop_set_v8_in *)in)->cpsi_prop = cpsi_prop; uuid_copy(((struct cont_prop_set_v8_in *)in)->cpsi_pool_uuid, cpsi_pool_uuid); - } else { ((struct cont_prop_set_in *)in)->cpsi_prop = cpsi_prop; uuid_copy(((struct cont_prop_set_in *)in)->cpsi_pool_uuid, cpsi_pool_uuid); } } +static inline void +cont_prop_set_in_set_cont_uuid(crt_rpc_t *rpc, crt_opcode_t opc, int cont_proto_ver, + uuid_t cont_uuid) +{ + void *in = crt_req_get(rpc); + + D_ASSERT(opc == CONT_PROP_SET); + if (cont_proto_ver >= CONT_PROTO_VER_WITH_SVC_OP_KEY) + uuid_copy(((struct cont_prop_set_v8_in *)in)->cpsi_op.ci_uuid, cont_uuid); + else + uuid_copy(((struct cont_prop_set_in *)in)->cpsi_op.ci_uuid, cont_uuid); +} + +static inline void +cont_prop_set_bylabel_in_set_label(crt_rpc_t *rpc, crt_opcode_t opc, int cont_proto_ver, + const char *label) +{ + void *in = crt_req_get(rpc); + + D_ASSERT(opc == CONT_PROP_SET_BYLABEL); + /* NB: prop set by label is on the server side only - no version variants */ + ((struct cont_prop_set_bylabel_in *)in)->cpsi_label = label; +} + /* clang-format off */ #define DAOS_ISEQ_CONT_ACL_UPDATE /* input fields */ \ diff --git a/src/container/srv_container.c b/src/container/srv_container.c index 051fd309ece..9071f8f731c 100644 --- a/src/container/srv_container.c +++ b/src/container/srv_container.c @@ -3671,8 +3671,7 @@ check_set_prop_label(struct rdb_tx *tx, struct cont *cont, } static int -set_prop(struct rdb_tx *tx, struct ds_pool *pool, - struct cont *cont, uint64_t sec_capas, uuid_t hdl_uuid, +set_prop(struct rdb_tx *tx, struct ds_pool *pool, struct cont *cont, uint64_t sec_capas, daos_prop_t *prop_in) { int rc; @@ -3739,10 +3738,9 @@ ds_cont_prop_set(struct rdb_tx *tx, struct ds_pool_hdl *pool_hdl, struct cont *c DP_CONT(pool_hdl->sph_pool->sp_uuid, in->cpsi_op.ci_uuid), rpc, DP_UUID(in->cpsi_op.ci_hdl)); - cont_prop_set_in_get_data(rpc, CONT_PROP_SET, cont_proto_ver, &prop_in, NULL); + cont_prop_set_in_get_data(rpc, CONT_PROP_SET, cont_proto_ver, &prop_in, NULL, NULL, NULL); - return set_prop(tx, pool_hdl->sph_pool, cont, hdl->ch_sec_capas, - in->cpsi_op.ci_hdl, prop_in); + return set_prop(tx, pool_hdl->sph_pool, cont, hdl->ch_sec_capas, prop_in); } static int @@ -3796,8 +3794,7 @@ set_acl(struct rdb_tx *tx, struct ds_pool_hdl *pool_hdl, if (prop->dpp_entries[0].dpe_val_ptr == NULL) D_GOTO(out_prop, rc = -DER_NOMEM); - rc = set_prop(tx, pool_hdl->sph_pool, cont, hdl->ch_sec_capas, - hdl_uuid, prop); + rc = set_prop(tx, pool_hdl->sph_pool, cont, hdl->ch_sec_capas, prop); out_prop: daos_prop_free(prop); @@ -5505,6 +5502,8 @@ cont_cli_opc_name(crt_opcode_t opc) case CONT_SNAP_CREATE: return "SNAP_CREATE"; case CONT_SNAP_DESTROY: return "SNAP_DESTROY"; case CONT_PROP_SET: return "PROP_SET"; + case CONT_PROP_SET_BYLABEL: + return "PROP_SET_BYLABEL"; case CONT_ACL_UPDATE: return "ACL_UPDATE"; case CONT_ACL_DELETE: return "ACL_DELETE"; case CONT_OPEN_BYLABEL: return "OPEN_BYLABEL"; @@ -5529,6 +5528,20 @@ ds_cont_op_handler(crt_rpc_t *rpc, int cont_proto_ver) struct cont_svc *svc; int rc; + /* + * Some mgmt RPCs may come from either client or server (admin/dRPC) calls. RPCs from + * servers don't contain pool/cont handles. + */ + if (!daos_rpc_from_client(rpc)) { + switch (opc) { + case CONT_PROP_SET: + return ds_cont_set_prop_srv_handler(rpc); + default: + D_ASSERTF(false, "unexpected server RPC %s (%d)", cont_cli_opc_name(opc), + opc); + } + } + pool_hdl = ds_pool_hdl_lookup(in->ci_pool_hdl); if (pool_hdl == NULL) D_GOTO(out, rc = -DER_NO_HDL); @@ -5675,19 +5688,25 @@ ds_cont_oid_fetch_add(uuid_t po_uuid, uuid_t co_uuid, uint64_t num_oids, uint64_ /* Send the RPC from a DAOS server instance to the container service */ int -ds_cont_svc_set_prop(uuid_t pool_uuid, uuid_t cont_uuid, - d_rank_list_t *ranks, daos_prop_t *prop) +ds_cont_svc_set_prop(uuid_t pool_uuid, const char *cont_id, d_rank_list_t *ranks, daos_prop_t *prop) { - int rc; - struct rsvc_client client; - crt_endpoint_t ep; - uuid_t null_uuid; - struct dss_module_info *info = dss_get_module_info(); - crt_rpc_t *rpc; - struct cont_prop_set_out *out; + int rc; + struct rsvc_client client; + crt_endpoint_t ep; + crt_opcode_t opc = CONT_PROP_SET; + uuid_t cont_uuid; + uuid_t null_uuid; + struct dss_module_info *info = dss_get_module_info(); + crt_rpc_t *rpc; + struct cont_prop_set_out *out; + + D_DEBUG(DB_MGMT, DF_UUID "/%s: Setting container prop\n", DP_UUID(pool_uuid), cont_id); - D_DEBUG(DB_MGMT, DF_CONT": Setting container prop\n", - DP_CONT(pool_uuid, cont_uuid)); + /* cont_id may be a UUID or label */ + if (uuid_parse(cont_id, cont_uuid) != 0) + opc = CONT_PROP_SET_BYLABEL; + + D_DEBUG(DB_MGMT, "using opcode %s (%d)\n", cont_cli_opc_name(opc), opc); uuid_clear(null_uuid); rc = rsvc_client_init(&client, ranks); @@ -5696,30 +5715,31 @@ ds_cont_svc_set_prop(uuid_t pool_uuid, uuid_t cont_uuid, rechoose: ep.ep_grp = NULL; /* primary group */ - rc = rsvc_client_choose(&client, &ep); + rc = rsvc_client_choose(&client, &ep); if (rc != 0) { - D_ERROR(DF_CONT": cannot find pool service: "DF_RC"\n", - DP_CONT(pool_uuid, cont_uuid), DP_RC(rc)); + DL_ERROR(rc, DF_UUID ": cannot find pool service", DP_UUID(pool_uuid)); D_GOTO(out_client, rc); } - rc = cont_req_create(info->dmi_ctx, &ep, CONT_PROP_SET, null_uuid, null_uuid, null_uuid, + rc = cont_req_create(info->dmi_ctx, &ep, opc, null_uuid, null_uuid, null_uuid, NULL /* req_timep */, &rpc); if (rc != 0) { - D_ERROR(DF_CONT": failed to create cont set prop rpc: %d\n", - DP_CONT(pool_uuid, cont_uuid), rc); + DL_ERROR(rc, DF_UUID "/%s: failed to create cont set prop rpc", DP_UUID(pool_uuid), + cont_id); D_GOTO(out_client, rc); } - cont_prop_set_in_set_data(rpc, CONT_PROP_SET, DAOS_CONT_VERSION, prop, pool_uuid); + cont_prop_set_in_set_data(rpc, opc, DAOS_CONT_VERSION, prop, pool_uuid); + if (opc == CONT_PROP_SET_BYLABEL) + cont_prop_set_bylabel_in_set_label(rpc, opc, DAOS_CONT_VERSION, cont_id); + else /* CONT_PROP_SET */ + cont_prop_set_in_set_cont_uuid(rpc, opc, DAOS_CONT_VERSION, cont_uuid); - rc = dss_rpc_send(rpc); + rc = dss_rpc_send(rpc); out = crt_reply_get(rpc); D_ASSERT(out != NULL); - rc = rsvc_client_complete_rpc(&client, &ep, rc, - out->cpso_op.co_rc, - &out->cpso_op.co_hint); + rc = rsvc_client_complete_rpc(&client, &ep, rc, out->cpso_op.co_rc, &out->cpso_op.co_hint); if (rc == RSVC_CLIENT_RECHOOSE) { crt_req_decref(rpc); dss_sleep(1000 /* ms */); @@ -5728,8 +5748,8 @@ ds_cont_svc_set_prop(uuid_t pool_uuid, uuid_t cont_uuid, rc = out->cpso_op.co_rc; if (rc != 0) { - D_ERROR(DF_CONT": failed to set prop for container: %d\n", - DP_CONT(pool_uuid, cont_uuid), rc); + DL_ERROR(rc, DF_UUID ": failed to set prop for container %s", DP_UUID(pool_uuid), + cont_id); } crt_req_decref(rpc); @@ -5740,61 +5760,72 @@ ds_cont_svc_set_prop(uuid_t pool_uuid, uuid_t cont_uuid, } void -ds_cont_set_prop_handler(crt_rpc_t *rpc) +ds_cont_set_prop_srv_handler(crt_rpc_t *rpc) { - int rc; - struct cont_svc *svc; - struct cont_prop_set_in *in = crt_req_get(rpc); - struct cont_prop_set_out *out = crt_reply_get(rpc); - struct rdb_tx tx; - uuid_t pool_uuid; - uuid_t cont_uuid; - daos_prop_t *prop; - struct cont *cont; - - /* Client RPCs go through the regular flow with pool/cont handles */ - if (daos_rpc_from_client(rpc)) { - ds_cont_op_handler(rpc, 7); - return; - } + int rc; + crt_opcode_t opc = opc_get(rpc->cr_opc); + struct cont_svc *svc; + struct cont_prop_set_out *out = crt_reply_get(rpc); + struct rdb_tx tx; + uuid_t pool_uuid; + uuid_t cont_uuid; + const char *cont_label = NULL; + char cont_id[DAOS_PROP_MAX_LABEL_BUF_LEN] = {0}; + daos_prop_t *prop; + struct cont *cont; /* * Server RPCs don't have pool or container handles. Just need the pool - * and container UUIDs. + * and container IDs. */ - cont_prop_set_in_get_data(rpc, CONT_PROP_SET, DAOS_CONT_VERSION, &prop, &pool_uuid); - uuid_copy(cont_uuid, in->cpsi_op.ci_uuid); + cont_prop_set_in_get_data(rpc, opc, DAOS_CONT_VERSION, &prop, &pool_uuid, &cont_uuid, + &cont_label); + if (opc == CONT_PROP_SET_BYLABEL) + strncpy(cont_id, cont_label, sizeof(cont_id) - 1); + else /* CONT_PROP_SET */ + uuid_unparse(cont_uuid, cont_id); - D_DEBUG(DB_MD, DF_CONT": processing cont set prop rpc %p\n", - DP_CONT(pool_uuid, cont_uuid), rpc); + D_DEBUG(DB_MD, DF_UUID "/%s: processing cont set prop (%s) rpc %p\n", DP_UUID(pool_uuid), + cont_id, cont_cli_opc_name(opc), rpc); - rc = cont_svc_lookup_leader(pool_uuid, 0 /* id */, - &svc, &out->cpso_op.co_hint); + rc = cont_svc_lookup_leader(pool_uuid, 0, &svc, &out->cpso_op.co_hint); if (rc != 0) { - D_ERROR(DF_CONT": Failed to look up cont svc: %d\n", - DP_CONT(pool_uuid, cont_uuid), rc); + DL_ERROR(rc, DF_UUID "/%s: failed to look up cont svc", DP_UUID(pool_uuid), + cont_id); D_GOTO(out, rc); } rc = rdb_tx_begin(svc->cs_rsvc->s_db, svc->cs_rsvc->s_term, &tx); - if (rc != 0) + if (rc != 0) { + DL_ERROR(rc, DF_UUID "/%s: failed to start RDB transaction", DP_UUID(pool_uuid), + cont_id); D_GOTO(out_svc, rc); + } ABT_rwlock_wrlock(svc->cs_lock); - rc = cont_lookup(&tx, svc, cont_uuid, &cont); - if (rc != 0) + /* cont_id may be a UUID or label */ + if (opc == CONT_PROP_SET) + rc = cont_lookup(&tx, svc, cont_uuid, &cont); + else /* CONT_PROP_SET_BYLABEL */ + rc = cont_lookup_bylabel(&tx, svc, cont_label, &cont); + if (rc != 0) { + DL_ERROR(rc, DF_UUID ": failed to look up container '%s'", DP_UUID(pool_uuid), + cont_id); D_GOTO(out_lock, rc); + } - rc = set_prop(&tx, svc->cs_pool, cont, ds_sec_get_admin_cont_capabilities(), cont_uuid, - prop); - if (rc != 0) + rc = set_prop(&tx, svc->cs_pool, cont, ds_sec_get_admin_cont_capabilities(), prop); + if (rc != 0) { + DL_ERROR(rc, DF_CONT ": failed to set properties", + DP_CONT(svc->cs_pool_uuid, cont->c_uuid)); D_GOTO(out_cont, rc); + } rc = rdb_tx_commit(&tx); if (rc != 0) - D_ERROR(DF_CONT": Unable to commit RDB transaction\n", - DP_CONT(pool_uuid, cont_uuid)); + DL_ERROR(rc, DF_CONT ": unable to commit RDB transaction", + DP_CONT(svc->cs_pool_uuid, cont->c_uuid)); out_cont: cont_put(cont); @@ -5805,8 +5836,8 @@ ds_cont_set_prop_handler(crt_rpc_t *rpc) ds_rsvc_set_hint(svc->cs_rsvc, &out->cpso_op.co_hint); cont_svc_put_leader(svc); out: - D_DEBUG(DB_MD, DF_CONT ": replying rpc: %p rc=%d\n", - DP_CONT(pool_uuid, in->cpsi_op.ci_uuid), rpc, rc); + D_DEBUG(DB_MD, DF_UUID "/%s: replying rpc: %p rc=%d\n", DP_UUID(pool_uuid), cont_id, rpc, + rc); out->cpso_op.co_rc = rc; crt_reply_send(rpc); diff --git a/src/container/srv_internal.h b/src/container/srv_internal.h index ac94db455ec..81527044b7f 100644 --- a/src/container/srv_internal.h +++ b/src/container/srv_internal.h @@ -187,7 +187,8 @@ void ds_cont_op_handler_v8(crt_rpc_t *rpc); void ds_cont_op_handler_v7(crt_rpc_t *rpc); void ds_cont_op_handler_v6(crt_rpc_t *rpc); -void ds_cont_set_prop_handler(crt_rpc_t *rpc); +void + ds_cont_set_prop_srv_handler(crt_rpc_t *rpc); int ds_cont_bcast_create(crt_context_t ctx, struct cont_svc *svc, crt_opcode_t opcode, crt_rpc_t **rpc); int ds_cont_oid_fetch_add(uuid_t poh_uuid, uuid_t co_uuid, uint64_t num_oids, uint64_t *oid); diff --git a/src/control/cmd/daos/acl.go b/src/control/cmd/daos/acl.go index 7cbd3f98d0e..34d5b8491f4 100644 --- a/src/control/cmd/daos/acl.go +++ b/src/control/cmd/daos/acl.go @@ -351,22 +351,30 @@ func (cmd *containerGetACLCmd) Execute(args []string) error { return errors.Wrapf(err, "failed to query ACL for container %s", cmd.contUUID) } - output := os.Stdout if cmd.File != "" { flags := os.O_CREATE | os.O_WRONLY if !cmd.Force { flags |= os.O_EXCL } - output, err = os.OpenFile(cmd.File, flags, 0644) + output, err := os.OpenFile(cmd.File, flags, 0644) if err != nil { return errors.Wrap(err, "failed to open ACL output file") } defer output.Close() + + if _, err := fmt.Fprint(output, control.FormatACL(acl, cmd.Verbose)); err != nil { + return errors.Wrapf(err, "failed to write ACL output file") + } } - return cmd.outputACL(output, acl, cmd.Verbose) + var buf strings.Builder + if err := cmd.outputACL(&buf, acl, cmd.Verbose); err != nil { + return err + } + cmd.Info(buf.String()) + return nil } type containerSetOwnerCmd struct { diff --git a/src/control/cmd/dmg/command_test.go b/src/control/cmd/dmg/command_test.go index 5121ba4dcae..f56714dfaee 100644 --- a/src/control/cmd/dmg/command_test.go +++ b/src/control/cmd/dmg/command_test.go @@ -147,7 +147,7 @@ func (bci *bridgeConnInvoker) InvokeUnaryRPC(ctx context.Context, uReq control.U case *control.ListPoolsReq: resp = control.MockMSResponse("", nil, &mgmtpb.ListPoolsResp{}) case *control.ContSetOwnerReq: - resp = control.MockMSResponse("", nil, &mgmtpb.ContSetOwnerResp{}) + resp = control.MockMSResponse("", nil, &mgmtpb.DaosResp{}) case *control.PoolQueryReq: resp = control.MockMSResponse("", nil, &mgmtpb.PoolQueryResp{}) case *control.PoolQueryTargetReq: diff --git a/src/control/cmd/dmg/cont.go b/src/control/cmd/dmg/cont.go index 8906773bd1a..afc117d3f38 100644 --- a/src/control/cmd/dmg/cont.go +++ b/src/control/cmd/dmg/cont.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2022 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -10,11 +10,24 @@ import ( "github.com/jessevdk/go-flags" "github.com/pkg/errors" - "github.com/daos-stack/daos/src/control/common/cmdutil" "github.com/daos-stack/daos/src/control/lib/control" "github.com/daos-stack/daos/src/control/lib/ui" ) +// ContID is a container label or UUID. +type ContID struct { + ui.LabelOrUUIDFlag +} + +// contCmd is the base struct for all container commands. +type contCmd struct { + poolCmd + + Args struct { + Cont ContID `positional-arg-name:"" required:"1"` + } `positional-args:"yes"` +} + // ContCmd is the struct representing the top-level container subcommand. type ContCmd struct { SetOwner ContSetOwnerCmd `command:"set-owner" description:"Change the owner for a DAOS container"` @@ -22,18 +35,14 @@ type ContCmd struct { // ContSetOwnerCmd is the struct representing the command to change the owner of a DAOS container. type ContSetOwnerCmd struct { - baseCmd - ctlInvokerCmd - cmdutil.JSONOutputCmd + contCmd GroupName ui.ACLPrincipalFlag `short:"g" long:"group" description:"New owner-group for the container, format name@domain"` UserName ui.ACLPrincipalFlag `short:"u" long:"user" description:"New owner-user for the container, format name@domain"` - ContUUID string `short:"c" long:"cont" required:"1" description:"UUID of the DAOS container"` - PoolUUID string `short:"p" long:"pool" required:"1" description:"UUID of the DAOS pool for the container"` } // Execute runs the container set-owner command -func (c *ContSetOwnerCmd) Execute(args []string) error { - if c.GroupName == "" && c.UserName == "" { +func (cmd *ContSetOwnerCmd) Execute(args []string) error { + if cmd.GroupName == "" && cmd.UserName == "" { return &flags.Error{ Type: flags.ErrRequired, Message: "at least one of `--user' or `--group' must be supplied", @@ -41,23 +50,23 @@ func (c *ContSetOwnerCmd) Execute(args []string) error { } msg := "SUCCEEDED" req := &control.ContSetOwnerReq{ - ContUUID: c.ContUUID, - PoolUUID: c.PoolUUID, - User: c.UserName.String(), - Group: c.GroupName.String(), + ContID: cmd.Args.Cont.String(), + PoolID: cmd.poolCmd.Args.Pool.String(), + User: cmd.UserName.String(), + Group: cmd.GroupName.String(), } - ctx := c.MustLogCtx() - err := control.ContSetOwner(ctx, c.ctlInvoker, req) + ctx := cmd.MustLogCtx() + err := control.ContSetOwner(ctx, cmd.ctlInvoker, req) if err != nil { msg = errors.WithMessage(err, "FAILED").Error() } - if c.JSONOutputEnabled() { - return c.OutputJSON(nil, err) + if cmd.JSONOutputEnabled() { + return cmd.OutputJSON(nil, err) } - c.Infof("Container-set-owner command %s\n", msg) + cmd.Infof("Container-set-owner command %s\n", msg) return err } diff --git a/src/control/cmd/dmg/cont_test.go b/src/control/cmd/dmg/cont_test.go index 9240dccdd1e..421f77477c5 100644 --- a/src/control/cmd/dmg/cont_test.go +++ b/src/control/cmd/dmg/cont_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2021 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -29,58 +29,58 @@ func TestContSetOwnerCommand(t *testing.T) { "Set owner with no arguments", "cont set-owner", "", - errMissingFlag, + errors.New("required arguments"), }, { "Set owner user", - fmt.Sprintf("cont set-owner --pool=%s --cont=%s --user=%s", testPoolUUID, testContUUID, testUser), + fmt.Sprintf("cont set-owner --user=%s %s %s", testUser, testPoolUUID, testContUUID), strings.Join([]string{ printRequest(t, &control.ContSetOwnerReq{ - PoolUUID: testPoolUUID.String(), - ContUUID: testContUUID.String(), - User: testUser, - Group: "", + PoolID: testPoolUUID.String(), + ContID: testContUUID.String(), + User: testUser, + Group: "", }), }, " "), nil, }, { "Set owner group", - fmt.Sprintf("cont set-owner --pool=%s --cont=%s --group=%s", testPoolUUID, testContUUID, testGroup), + fmt.Sprintf("cont set-owner --group=%s %s %s", testGroup, testPoolUUID, testContUUID), strings.Join([]string{ printRequest(t, &control.ContSetOwnerReq{ - PoolUUID: testPoolUUID.String(), - ContUUID: testContUUID.String(), - User: "", - Group: testGroup, + PoolID: testPoolUUID.String(), + ContID: testContUUID.String(), + User: "", + Group: testGroup, }), }, " "), nil, }, { "Set owner user and group", - fmt.Sprintf("cont set-owner --pool=%s --cont=%s --user=%s --group=%s", - testPoolUUID, testContUUID, testUser, testGroup), + fmt.Sprintf("cont set-owner --user=%s --group=%s %s %s", testUser, testGroup, + testPoolUUID, testContUUID), strings.Join([]string{ printRequest(t, &control.ContSetOwnerReq{ - PoolUUID: testPoolUUID.String(), - ContUUID: testContUUID.String(), - User: testUser, - Group: testGroup, + PoolID: testPoolUUID.String(), + ContID: testContUUID.String(), + User: testUser, + Group: testGroup, }), }, " "), nil, }, { "Bad owner principal", - fmt.Sprintf("cont set-owner --pool=%s --cont=%s --user=%s --group=%s", - testPoolUUID, testContUUID, "bad@@", testGroup), + fmt.Sprintf("cont set-owner --user=%s --group=%s %s %s", "bad@@", testGroup, + testPoolUUID, testContUUID), "", errors.New("invalid ACL principal"), }, { "Bad group principal", - fmt.Sprintf("cont set-owner --pool=%s --cont=%s --user=%s --group=%s", - testPoolUUID, testContUUID, testUser, "bad@@"), + fmt.Sprintf("cont set-owner --user=%s --group=%s %s %s", testUser, "bad@@", + testPoolUUID, testContUUID), "", errors.New("invalid ACL principal"), }, }) diff --git a/src/control/cmd/dmg/json_test.go b/src/control/cmd/dmg/json_test.go index 893a312509a..8187f5b1078 100644 --- a/src/control/cmd/dmg/json_test.go +++ b/src/control/cmd/dmg/json_test.go @@ -101,8 +101,7 @@ func TestDmg_JsonOutput(t *testing.T) { case "pool query-targets": testArgs = append(testArgs, test.MockUUID(), "--rank", "0", "--target-idx", "1,3,5,7") case "container set-owner": - testArgs = append(testArgs, "--user", "foo", "--pool", test.MockUUID(), - "--cont", test.MockUUID()) + testArgs = append(testArgs, "--user", "foo", test.MockUUID(), test.MockUUID()) case "telemetry metrics list", "telemetry metrics query": return // These commands query via http directly case "system cleanup": diff --git a/src/control/common/proto/mgmt/addons.go b/src/control/common/proto/mgmt/addons.go index 34299c3096c..7f049b29b39 100644 --- a/src/control/common/proto/mgmt/addons.go +++ b/src/control/common/proto/mgmt/addons.go @@ -197,12 +197,12 @@ func (r *ContSetOwnerReq) SetSvcRanks(rl []uint32) { // SetUUID sets the request's ID to a UUID. func (r *ContSetOwnerReq) SetUUID(id uuid.UUID) { - r.PoolUUID = id.String() + r.PoolId = id.String() } // GetId fetches the pool ID. func (r *ContSetOwnerReq) GetId() string { - return r.PoolUUID + return r.PoolId } // SetSvcRanks sets the request's Pool Service Ranks. diff --git a/src/control/common/proto/mgmt/cont.pb.go b/src/control/common/proto/mgmt/cont.pb.go index 86fcdb3fe41..9d261f47004 100644 --- a/src/control/common/proto/mgmt/cont.pb.go +++ b/src/control/common/proto/mgmt/cont.pb.go @@ -1,12 +1,12 @@ // -// (C) Copyright 2020-2021 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v3.5.0 // source: mgmt/cont.proto @@ -26,17 +26,17 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ContSetOwnerReq supplies new pool parameters. +// ContSetOwnerReq changes the ownership of a container. type ContSetOwnerReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Sys string `protobuf:"bytes,1,opt,name=sys,proto3" json:"sys,omitempty"` // DAOS system identifier - ContUUID string `protobuf:"bytes,2,opt,name=contUUID,proto3" json:"contUUID,omitempty"` // UUID of the container - PoolUUID string `protobuf:"bytes,3,opt,name=poolUUID,proto3" json:"poolUUID,omitempty"` // UUID of the pool that the container is in - Owneruser string `protobuf:"bytes,4,opt,name=owneruser,proto3" json:"owneruser,omitempty"` // formatted user e.g. "bob@" - Ownergroup string `protobuf:"bytes,5,opt,name=ownergroup,proto3" json:"ownergroup,omitempty"` // formatted group e.g. "builders@" + ContId string `protobuf:"bytes,2,opt,name=cont_id,json=contId,proto3" json:"cont_id,omitempty"` // UUID or label of the container + PoolId string `protobuf:"bytes,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` // UUID or label of the pool that the container is in + OwnerUser string `protobuf:"bytes,4,opt,name=owner_user,json=ownerUser,proto3" json:"owner_user,omitempty"` // formatted user e.g. "bob@" + OwnerGroup string `protobuf:"bytes,5,opt,name=owner_group,json=ownerGroup,proto3" json:"owner_group,omitempty"` // formatted group e.g. "builders@" SvcRanks []uint32 `protobuf:"varint,6,rep,packed,name=svc_ranks,json=svcRanks,proto3" json:"svc_ranks,omitempty"` // List of pool service ranks } @@ -79,30 +79,30 @@ func (x *ContSetOwnerReq) GetSys() string { return "" } -func (x *ContSetOwnerReq) GetContUUID() string { +func (x *ContSetOwnerReq) GetContId() string { if x != nil { - return x.ContUUID + return x.ContId } return "" } -func (x *ContSetOwnerReq) GetPoolUUID() string { +func (x *ContSetOwnerReq) GetPoolId() string { if x != nil { - return x.PoolUUID + return x.PoolId } return "" } -func (x *ContSetOwnerReq) GetOwneruser() string { +func (x *ContSetOwnerReq) GetOwnerUser() string { if x != nil { - return x.Owneruser + return x.OwnerUser } return "" } -func (x *ContSetOwnerReq) GetOwnergroup() string { +func (x *ContSetOwnerReq) GetOwnerGroup() string { if x != nil { - return x.Ownergroup + return x.OwnerGroup } return "" } @@ -114,73 +114,22 @@ func (x *ContSetOwnerReq) GetSvcRanks() []uint32 { return nil } -// ContSetOwnerResp returns created pool uuid and ranks. -type ContSetOwnerResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // DAOS error code -} - -func (x *ContSetOwnerResp) Reset() { - *x = ContSetOwnerResp{} - if protoimpl.UnsafeEnabled { - mi := &file_mgmt_cont_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContSetOwnerResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContSetOwnerResp) ProtoMessage() {} - -func (x *ContSetOwnerResp) ProtoReflect() protoreflect.Message { - mi := &file_mgmt_cont_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContSetOwnerResp.ProtoReflect.Descriptor instead. -func (*ContSetOwnerResp) Descriptor() ([]byte, []int) { - return file_mgmt_cont_proto_rawDescGZIP(), []int{1} -} - -func (x *ContSetOwnerResp) GetStatus() int32 { - if x != nil { - return x.Status - } - return 0 -} - var File_mgmt_cont_proto protoreflect.FileDescriptor var file_mgmt_cont_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x04, 0x6d, 0x67, 0x6d, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, + 0x6f, 0x12, 0x04, 0x6d, 0x67, 0x6d, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x1a, 0x0a, - 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x55, 0x55, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x55, 0x55, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x6f, - 0x6c, 0x55, 0x55, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x6f, - 0x6c, 0x55, 0x55, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x75, 0x73, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, - 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x3a, 0x5a, 0x38, + 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, + 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, @@ -199,10 +148,9 @@ func file_mgmt_cont_proto_rawDescGZIP() []byte { return file_mgmt_cont_proto_rawDescData } -var file_mgmt_cont_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_mgmt_cont_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_mgmt_cont_proto_goTypes = []interface{}{ - (*ContSetOwnerReq)(nil), // 0: mgmt.ContSetOwnerReq - (*ContSetOwnerResp)(nil), // 1: mgmt.ContSetOwnerResp + (*ContSetOwnerReq)(nil), // 0: mgmt.ContSetOwnerReq } var file_mgmt_cont_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -230,18 +178,6 @@ func file_mgmt_cont_proto_init() { return nil } } - file_mgmt_cont_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContSetOwnerResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -249,7 +185,7 @@ func file_mgmt_cont_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_mgmt_cont_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 1, NumExtensions: 0, NumServices: 0, }, diff --git a/src/control/common/proto/mgmt/mgmt.pb.go b/src/control/common/proto/mgmt/mgmt.pb.go index 9b0c52ed9a8..0b45d1cae25 100644 --- a/src/control/common/proto/mgmt/mgmt.pb.go +++ b/src/control/common/proto/mgmt/mgmt.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.5.0 // source: mgmt/mgmt.proto @@ -41,7 +41,7 @@ var file_mgmt_mgmt_proto_rawDesc = []byte{ 0x11, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x63, 0x68, 0x6b, 0x2f, 0x63, 0x68, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x63, 0x68, 0x6b, 0x2f, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x32, 0x98, 0x15, 0x0a, 0x07, 0x4d, 0x67, 0x6d, 0x74, 0x53, 0x76, 0x63, 0x12, + 0x6f, 0x74, 0x6f, 0x32, 0x90, 0x15, 0x0a, 0x07, 0x4d, 0x67, 0x6d, 0x74, 0x53, 0x76, 0x63, 0x12, 0x27, 0x0a, 0x04, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x6c, 0x75, 0x73, @@ -120,102 +120,101 @@ var file_mgmt_mgmt_proto_rawDesc = []byte{ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x11, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, + 0x00, 0x12, 0x37, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, - 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x12, 0x39, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x13, - 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, - 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, - 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, + 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, + 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x13, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, - 0x0b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x61, 0x73, 0x65, 0x12, 0x14, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x61, 0x73, 0x65, 0x52, - 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x45, 0x72, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x12, 0x16, 0x2e, 0x6d, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, + 0x72, 0x61, 0x73, 0x65, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x45, 0x72, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6c, 0x65, + 0x61, 0x6e, 0x75, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x3b, 0x0a, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, - 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x12, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, - 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x10, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x13, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0f, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x6f, 0x70, 0x12, - 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x6f, 0x70, - 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x10, 0x53, 0x79, - 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x13, - 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x14, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x53, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4b, - 0x0a, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x1a, - 0x18, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x11, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x61, 0x69, 0x72, - 0x12, 0x11, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x41, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x50, 0x6f, 0x6f, - 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, - 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, - 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x53, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, - 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x41, - 0x74, 0x74, 0x72, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x2e, 0x6d, + 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x12, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x10, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, + 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0f, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x10, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x17, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x17, + 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x52, 0x65, 0x70, 0x61, 0x69, 0x72, 0x12, 0x11, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x12, 0x14, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, + 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, + 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x39, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, + 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, + 0x74, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, + 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, - 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, + 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, + 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x12, + 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, + 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x11, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x2e, 0x63, 0x68, 0x6b, - 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x34, - 0x0a, 0x14, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x6f, 0x6f, - 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0a, 0x2e, 0x63, 0x68, 0x6b, 0x2e, 0x46, 0x61, 0x75, - 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x18, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x6a, - 0x65, 0x63, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, - 0x12, 0x0a, 0x2e, 0x63, 0x68, 0x6b, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x3a, - 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, - 0x73, 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x67, 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, + 0x11, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x12, 0x10, 0x2e, 0x63, 0x68, 0x6b, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x14, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, + 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0a, + 0x2e, 0x63, 0x68, 0x6b, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x18, + 0x46, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x50, + 0x6f, 0x6f, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0a, 0x2e, 0x63, 0x68, 0x6b, 0x2e, 0x46, + 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x44, 0x61, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, + 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x67, + 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_mgmt_mgmt_proto_goTypes = []interface{}{ @@ -279,22 +278,21 @@ var file_mgmt_mgmt_proto_goTypes = []interface{}{ (*GetAttachInfoResp)(nil), // 57: mgmt.GetAttachInfoResp (*ListPoolsResp)(nil), // 58: mgmt.ListPoolsResp (*ListContResp)(nil), // 59: mgmt.ListContResp - (*ContSetOwnerResp)(nil), // 60: mgmt.ContSetOwnerResp + (*DaosResp)(nil), // 60: mgmt.DaosResp (*SystemQueryResp)(nil), // 61: mgmt.SystemQueryResp (*SystemStopResp)(nil), // 62: mgmt.SystemStopResp (*SystemStartResp)(nil), // 63: mgmt.SystemStartResp (*SystemExcludeResp)(nil), // 64: mgmt.SystemExcludeResp (*SystemEraseResp)(nil), // 65: mgmt.SystemEraseResp (*SystemCleanupResp)(nil), // 66: mgmt.SystemCleanupResp - (*DaosResp)(nil), // 67: mgmt.DaosResp - (*CheckStartResp)(nil), // 68: mgmt.CheckStartResp - (*CheckStopResp)(nil), // 69: mgmt.CheckStopResp - (*CheckQueryResp)(nil), // 70: mgmt.CheckQueryResp - (*CheckGetPolicyResp)(nil), // 71: mgmt.CheckGetPolicyResp - (*CheckActResp)(nil), // 72: mgmt.CheckActResp - (*PoolUpgradeResp)(nil), // 73: mgmt.PoolUpgradeResp - (*SystemGetAttrResp)(nil), // 74: mgmt.SystemGetAttrResp - (*SystemGetPropResp)(nil), // 75: mgmt.SystemGetPropResp + (*CheckStartResp)(nil), // 67: mgmt.CheckStartResp + (*CheckStopResp)(nil), // 68: mgmt.CheckStopResp + (*CheckQueryResp)(nil), // 69: mgmt.CheckQueryResp + (*CheckGetPolicyResp)(nil), // 70: mgmt.CheckGetPolicyResp + (*CheckActResp)(nil), // 71: mgmt.CheckActResp + (*PoolUpgradeResp)(nil), // 72: mgmt.PoolUpgradeResp + (*SystemGetAttrResp)(nil), // 73: mgmt.SystemGetAttrResp + (*SystemGetPropResp)(nil), // 74: mgmt.SystemGetPropResp } var file_mgmt_mgmt_proto_depIdxs = []int32{ 0, // 0: mgmt.MgmtSvc.Join:input_type -> mgmt.JoinReq @@ -362,29 +360,29 @@ var file_mgmt_mgmt_proto_depIdxs = []int32{ 57, // 62: mgmt.MgmtSvc.GetAttachInfo:output_type -> mgmt.GetAttachInfoResp 58, // 63: mgmt.MgmtSvc.ListPools:output_type -> mgmt.ListPoolsResp 59, // 64: mgmt.MgmtSvc.ListContainers:output_type -> mgmt.ListContResp - 60, // 65: mgmt.MgmtSvc.ContSetOwner:output_type -> mgmt.ContSetOwnerResp + 60, // 65: mgmt.MgmtSvc.ContSetOwner:output_type -> mgmt.DaosResp 61, // 66: mgmt.MgmtSvc.SystemQuery:output_type -> mgmt.SystemQueryResp 62, // 67: mgmt.MgmtSvc.SystemStop:output_type -> mgmt.SystemStopResp 63, // 68: mgmt.MgmtSvc.SystemStart:output_type -> mgmt.SystemStartResp 64, // 69: mgmt.MgmtSvc.SystemExclude:output_type -> mgmt.SystemExcludeResp 65, // 70: mgmt.MgmtSvc.SystemErase:output_type -> mgmt.SystemEraseResp 66, // 71: mgmt.MgmtSvc.SystemCleanup:output_type -> mgmt.SystemCleanupResp - 67, // 72: mgmt.MgmtSvc.SystemCheckEnable:output_type -> mgmt.DaosResp - 67, // 73: mgmt.MgmtSvc.SystemCheckDisable:output_type -> mgmt.DaosResp - 68, // 74: mgmt.MgmtSvc.SystemCheckStart:output_type -> mgmt.CheckStartResp - 69, // 75: mgmt.MgmtSvc.SystemCheckStop:output_type -> mgmt.CheckStopResp - 70, // 76: mgmt.MgmtSvc.SystemCheckQuery:output_type -> mgmt.CheckQueryResp - 67, // 77: mgmt.MgmtSvc.SystemCheckSetPolicy:output_type -> mgmt.DaosResp - 71, // 78: mgmt.MgmtSvc.SystemCheckGetPolicy:output_type -> mgmt.CheckGetPolicyResp - 72, // 79: mgmt.MgmtSvc.SystemCheckRepair:output_type -> mgmt.CheckActResp - 73, // 80: mgmt.MgmtSvc.PoolUpgrade:output_type -> mgmt.PoolUpgradeResp - 67, // 81: mgmt.MgmtSvc.SystemSetAttr:output_type -> mgmt.DaosResp - 74, // 82: mgmt.MgmtSvc.SystemGetAttr:output_type -> mgmt.SystemGetAttrResp - 67, // 83: mgmt.MgmtSvc.SystemSetProp:output_type -> mgmt.DaosResp - 75, // 84: mgmt.MgmtSvc.SystemGetProp:output_type -> mgmt.SystemGetPropResp - 67, // 85: mgmt.MgmtSvc.FaultInjectReport:output_type -> mgmt.DaosResp - 67, // 86: mgmt.MgmtSvc.FaultInjectPoolFault:output_type -> mgmt.DaosResp - 67, // 87: mgmt.MgmtSvc.FaultInjectMgmtPoolFault:output_type -> mgmt.DaosResp + 60, // 72: mgmt.MgmtSvc.SystemCheckEnable:output_type -> mgmt.DaosResp + 60, // 73: mgmt.MgmtSvc.SystemCheckDisable:output_type -> mgmt.DaosResp + 67, // 74: mgmt.MgmtSvc.SystemCheckStart:output_type -> mgmt.CheckStartResp + 68, // 75: mgmt.MgmtSvc.SystemCheckStop:output_type -> mgmt.CheckStopResp + 69, // 76: mgmt.MgmtSvc.SystemCheckQuery:output_type -> mgmt.CheckQueryResp + 60, // 77: mgmt.MgmtSvc.SystemCheckSetPolicy:output_type -> mgmt.DaosResp + 70, // 78: mgmt.MgmtSvc.SystemCheckGetPolicy:output_type -> mgmt.CheckGetPolicyResp + 71, // 79: mgmt.MgmtSvc.SystemCheckRepair:output_type -> mgmt.CheckActResp + 72, // 80: mgmt.MgmtSvc.PoolUpgrade:output_type -> mgmt.PoolUpgradeResp + 60, // 81: mgmt.MgmtSvc.SystemSetAttr:output_type -> mgmt.DaosResp + 73, // 82: mgmt.MgmtSvc.SystemGetAttr:output_type -> mgmt.SystemGetAttrResp + 60, // 83: mgmt.MgmtSvc.SystemSetProp:output_type -> mgmt.DaosResp + 74, // 84: mgmt.MgmtSvc.SystemGetProp:output_type -> mgmt.SystemGetPropResp + 60, // 85: mgmt.MgmtSvc.FaultInjectReport:output_type -> mgmt.DaosResp + 60, // 86: mgmt.MgmtSvc.FaultInjectPoolFault:output_type -> mgmt.DaosResp + 60, // 87: mgmt.MgmtSvc.FaultInjectMgmtPoolFault:output_type -> mgmt.DaosResp 44, // [44:88] is the sub-list for method output_type 0, // [0:44] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name diff --git a/src/control/common/proto/mgmt/mgmt_grpc.pb.go b/src/control/common/proto/mgmt/mgmt_grpc.pb.go index 1c976e82251..bf69683f90c 100644 --- a/src/control/common/proto/mgmt/mgmt_grpc.pb.go +++ b/src/control/common/proto/mgmt/mgmt_grpc.pb.go @@ -121,7 +121,7 @@ type MgmtSvcClient interface { // List all containers in a pool ListContainers(ctx context.Context, in *ListContReq, opts ...grpc.CallOption) (*ListContResp, error) // Change the owner of a DAOS container - ContSetOwner(ctx context.Context, in *ContSetOwnerReq, opts ...grpc.CallOption) (*ContSetOwnerResp, error) + ContSetOwner(ctx context.Context, in *ContSetOwnerReq, opts ...grpc.CallOption) (*DaosResp, error) // Query DAOS system status SystemQuery(ctx context.Context, in *SystemQueryReq, opts ...grpc.CallOption) (*SystemQueryResp, error) // Stop DAOS system (shutdown data-plane instances) @@ -365,8 +365,8 @@ func (c *mgmtSvcClient) ListContainers(ctx context.Context, in *ListContReq, opt return out, nil } -func (c *mgmtSvcClient) ContSetOwner(ctx context.Context, in *ContSetOwnerReq, opts ...grpc.CallOption) (*ContSetOwnerResp, error) { - out := new(ContSetOwnerResp) +func (c *mgmtSvcClient) ContSetOwner(ctx context.Context, in *ContSetOwnerReq, opts ...grpc.CallOption) (*DaosResp, error) { + out := new(DaosResp) err := c.cc.Invoke(ctx, MgmtSvc_ContSetOwner_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -620,7 +620,7 @@ type MgmtSvcServer interface { // List all containers in a pool ListContainers(context.Context, *ListContReq) (*ListContResp, error) // Change the owner of a DAOS container - ContSetOwner(context.Context, *ContSetOwnerReq) (*ContSetOwnerResp, error) + ContSetOwner(context.Context, *ContSetOwnerReq) (*DaosResp, error) // Query DAOS system status SystemQuery(context.Context, *SystemQueryReq) (*SystemQueryResp, error) // Stop DAOS system (shutdown data-plane instances) @@ -735,7 +735,7 @@ func (UnimplementedMgmtSvcServer) ListPools(context.Context, *ListPoolsReq) (*Li func (UnimplementedMgmtSvcServer) ListContainers(context.Context, *ListContReq) (*ListContResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListContainers not implemented") } -func (UnimplementedMgmtSvcServer) ContSetOwner(context.Context, *ContSetOwnerReq) (*ContSetOwnerResp, error) { +func (UnimplementedMgmtSvcServer) ContSetOwner(context.Context, *ContSetOwnerReq) (*DaosResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ContSetOwner not implemented") } func (UnimplementedMgmtSvcServer) SystemQuery(context.Context, *SystemQueryReq) (*SystemQueryResp, error) { diff --git a/src/control/lib/control/cont.go b/src/control/lib/control/cont.go index a0398c115ae..d109f0e9ae1 100644 --- a/src/control/lib/control/cont.go +++ b/src/control/lib/control/cont.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2022 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -20,10 +20,10 @@ import ( type ContSetOwnerReq struct { msRequest unaryRequest - ContUUID string // Container UUID - PoolUUID string // UUID of the pool for the container - User string // User to own the container, or empty if none - Group string // Group to own the container, or empty if none + ContID string // Container UUID or label + PoolID string // UUID or label of the pool for the container + User string // User to own the container, or empty if none + Group string // Group to own the container, or empty if none } // ContSetOwner changes the owner user and/or group of a DAOS container. @@ -32,12 +32,12 @@ func ContSetOwner(ctx context.Context, rpcClient UnaryInvoker, req *ContSetOwner return errors.New("nil request") } - if err := checkUUID(req.ContUUID); err != nil { - return err + if req.PoolID == "" { + return errors.New("no pool label or UUID specified") } - if err := checkUUID(req.PoolUUID); err != nil { - return err + if req.ContID == "" { + return errors.New("no container label or UUID specified") } if req.User == "" && req.Group == "" { @@ -47,10 +47,10 @@ func ContSetOwner(ctx context.Context, rpcClient UnaryInvoker, req *ContSetOwner req.setRPC(func(ctx context.Context, conn *grpc.ClientConn) (proto.Message, error) { return mgmtpb.NewMgmtSvcClient(conn).ContSetOwner(ctx, &mgmtpb.ContSetOwnerReq{ Sys: req.getSystem(rpcClient), - ContUUID: req.ContUUID, - PoolUUID: req.PoolUUID, - Owneruser: req.User, - Ownergroup: req.Group, + ContId: req.ContID, + PoolId: req.PoolID, + OwnerUser: req.User, + OwnerGroup: req.Group, }) }) diff --git a/src/control/lib/control/cont_test.go b/src/control/lib/control/cont_test.go index 6bd6cdd8a10..05b005c547a 100644 --- a/src/control/lib/control/cont_test.go +++ b/src/control/lib/control/cont_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2022 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -22,10 +22,10 @@ func TestControl_ContSetOwner(t *testing.T) { testContUUID := uuid.New().String() validReq := &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - ContUUID: testContUUID, - User: "someuser@", - Group: "somegroup@", + PoolID: testPoolUUID, + ContID: testContUUID, + User: "someuser@", + Group: "somegroup@", } for name, tc := range map[string]struct { @@ -37,36 +37,22 @@ func TestControl_ContSetOwner(t *testing.T) { req: nil, expErr: errors.New("nil request"), }, - "bad container UUID": { + "no container ID": { req: &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - ContUUID: "junk", + PoolID: testPoolUUID, }, - expErr: errors.New("invalid UUID"), + expErr: errors.New("container label or UUID"), }, - "bad pool UUID": { + "no pool ID": { req: &ContSetOwnerReq{ - PoolUUID: "garbage", - ContUUID: testContUUID, + ContID: testContUUID, }, - expErr: errors.New("invalid UUID"), - }, - "no container UUID": { - req: &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - }, - expErr: errors.New("invalid UUID"), - }, - "no pool UUID": { - req: &ContSetOwnerReq{ - ContUUID: testContUUID, - }, - expErr: errors.New("invalid UUID"), + expErr: errors.New("pool label or UUID"), }, "no user or group": { req: &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - ContUUID: testContUUID, + PoolID: testPoolUUID, + ContID: testContUUID, }, expErr: errors.New("no user or group specified"), }, @@ -74,31 +60,31 @@ func TestControl_ContSetOwner(t *testing.T) { req: validReq, mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, - &mgmtpb.ContSetOwnerResp{}, + &mgmtpb.DaosResp{}, ), }, }, "user-only success": { req: &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - ContUUID: testContUUID, - User: "someuser@", + PoolID: testPoolUUID, + ContID: testContUUID, + User: "someuser@", }, mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, - &mgmtpb.ContSetOwnerResp{}, + &mgmtpb.DaosResp{}, ), }, }, "group-only success": { req: &ContSetOwnerReq{ - PoolUUID: testPoolUUID, - ContUUID: testContUUID, - Group: "somegroup@", + PoolID: testPoolUUID, + ContID: testContUUID, + Group: "somegroup@", }, mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, - &mgmtpb.ContSetOwnerResp{}, + &mgmtpb.DaosResp{}, ), }, }, @@ -116,6 +102,18 @@ func TestControl_ContSetOwner(t *testing.T) { }, expErr: errors.New("remote failed"), }, + "labels OK": { + req: &ContSetOwnerReq{ + PoolID: "pool1", + ContID: "cont1", + User: "someuser@", + }, + mic: &MockInvokerConfig{ + UnaryResponse: MockMSResponse("host1", nil, + &mgmtpb.DaosResp{}, + ), + }, + }, } { t.Run(name, func(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) diff --git a/src/control/server/mgmt_cont.go b/src/control/server/mgmt_cont.go index 75706a6a1ae..4cc712d44a9 100644 --- a/src/control/server/mgmt_cont.go +++ b/src/control/server/mgmt_cont.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2022 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -36,7 +36,7 @@ func (svc *mgmtSvc) ListContainers(ctx context.Context, req *mgmtpb.ListContReq) } // ContSetOwner forwards a gRPC request to the DAOS I/O Engine to change a container's ownership. -func (svc *mgmtSvc) ContSetOwner(ctx context.Context, req *mgmtpb.ContSetOwnerReq) (*mgmtpb.ContSetOwnerResp, error) { +func (svc *mgmtSvc) ContSetOwner(ctx context.Context, req *mgmtpb.ContSetOwnerReq) (*mgmtpb.DaosResp, error) { if err := svc.checkReplicaRequest(req); err != nil { return nil, err } @@ -46,7 +46,7 @@ func (svc *mgmtSvc) ContSetOwner(ctx context.Context, req *mgmtpb.ContSetOwnerRe return nil, err } - resp := &mgmtpb.ContSetOwnerResp{} + resp := &mgmtpb.DaosResp{} if err = proto.Unmarshal(dresp.Body, resp); err != nil { return nil, errors.Wrap(err, "unmarshal ContSetOwner response") } diff --git a/src/control/server/mgmt_cont_test.go b/src/control/server/mgmt_cont_test.go index 5542fe40c52..46ed2002968 100644 --- a/src/control/server/mgmt_cont_test.go +++ b/src/control/server/mgmt_cont_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2018-2022 Intel Corporation. +// (C) Copyright 2018-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -153,10 +153,10 @@ func TestMgmt_ContSetOwner(t *testing.T) { validContSetOwnerReq := func() *mgmtpb.ContSetOwnerReq { return &mgmtpb.ContSetOwnerReq{ Sys: build.DefaultSystemName, - ContUUID: "contUUID", - PoolUUID: mockUUID, - Owneruser: "user@", - Ownergroup: "group@", + ContId: "contUUID", + PoolId: mockUUID, + OwnerUser: "user@", + OwnerGroup: "group@", } } @@ -164,7 +164,7 @@ func TestMgmt_ContSetOwner(t *testing.T) { createMS func(*testing.T, logging.Logger) *mgmtSvc setupDrpc func(*testing.T, *mgmtSvc) req *mgmtpb.ContSetOwnerReq - expResp *mgmtpb.ContSetOwnerResp + expResp *mgmtpb.DaosResp expErr error }{ "nil req": { @@ -173,10 +173,10 @@ func TestMgmt_ContSetOwner(t *testing.T) { "pool svc not found": { req: &mgmtpb.ContSetOwnerReq{ Sys: build.DefaultSystemName, - ContUUID: "contUUID", - PoolUUID: "fake", - Owneruser: "user@", - Ownergroup: "group@", + ContId: "contUUID", + PoolId: "fake", + OwnerUser: "user@", + OwnerGroup: "group@", }, expErr: errors.New("unable to find pool"), }, @@ -207,10 +207,10 @@ func TestMgmt_ContSetOwner(t *testing.T) { }, "success": { setupDrpc: func(t *testing.T, svc *mgmtSvc) { - setupSvcDrpcClient(svc, 0, getMockDrpcClient(&mgmtpb.ContSetOwnerResp{}, nil)) + setupSvcDrpcClient(svc, 0, getMockDrpcClient(&mgmtpb.DaosResp{}, nil)) }, req: validContSetOwnerReq(), - expResp: &mgmtpb.ContSetOwnerResp{ + expResp: &mgmtpb.DaosResp{ Status: 0, }, }, diff --git a/src/include/daos_srv/container.h b/src/include/daos_srv/container.h index d44931ae4cf..940d02fdc25 100644 --- a/src/include/daos_srv/container.h +++ b/src/include/daos_srv/container.h @@ -32,8 +32,9 @@ int ds_cont_svc_init(struct cont_svc **svcp, const uuid_t pool_uuid, void ds_cont_svc_fini(struct cont_svc **svcp); int ds_cont_svc_step_up(struct cont_svc *svc); void ds_cont_svc_step_down(struct cont_svc *svc); -int ds_cont_svc_set_prop(uuid_t pool_uuid, uuid_t cont_uuid, - d_rank_list_t *ranks, daos_prop_t *prop); +int + ds_cont_svc_set_prop(uuid_t pool_uuid, const char *cont_id, d_rank_list_t *ranks, + daos_prop_t *prop); int ds_cont_list(uuid_t pool_uuid, struct daos_pool_cont_info **conts, uint64_t *ncont); int ds_cont_filter(uuid_t pool_uuid, daos_pool_cont_filter_t *filt, struct daos_pool_cont_info2 **conts, uint64_t *ncont); diff --git a/src/mgmt/cont.pb-c.c b/src/mgmt/cont.pb-c.c index 8517129b4a8..ff2c38b76ea 100644 --- a/src/mgmt/cont.pb-c.c +++ b/src/mgmt/cont.pb-c.c @@ -52,51 +52,6 @@ void mgmt__cont_set_owner_req__free_unpacked assert(message->base.descriptor == &mgmt__cont_set_owner_req__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void mgmt__cont_set_owner_resp__init - (Mgmt__ContSetOwnerResp *message) -{ - static const Mgmt__ContSetOwnerResp init_value = MGMT__CONT_SET_OWNER_RESP__INIT; - *message = init_value; -} -size_t mgmt__cont_set_owner_resp__get_packed_size - (const Mgmt__ContSetOwnerResp *message) -{ - assert(message->base.descriptor == &mgmt__cont_set_owner_resp__descriptor); - return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); -} -size_t mgmt__cont_set_owner_resp__pack - (const Mgmt__ContSetOwnerResp *message, - uint8_t *out) -{ - assert(message->base.descriptor == &mgmt__cont_set_owner_resp__descriptor); - return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); -} -size_t mgmt__cont_set_owner_resp__pack_to_buffer - (const Mgmt__ContSetOwnerResp *message, - ProtobufCBuffer *buffer) -{ - assert(message->base.descriptor == &mgmt__cont_set_owner_resp__descriptor); - return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); -} -Mgmt__ContSetOwnerResp * - mgmt__cont_set_owner_resp__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data) -{ - return (Mgmt__ContSetOwnerResp *) - protobuf_c_message_unpack (&mgmt__cont_set_owner_resp__descriptor, - allocator, len, data); -} -void mgmt__cont_set_owner_resp__free_unpacked - (Mgmt__ContSetOwnerResp *message, - ProtobufCAllocator *allocator) -{ - if(!message) - return; - assert(message->base.descriptor == &mgmt__cont_set_owner_resp__descriptor); - protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); -} static const ProtobufCFieldDescriptor mgmt__cont_set_owner_req__field_descriptors[6] = { { @@ -112,48 +67,48 @@ static const ProtobufCFieldDescriptor mgmt__cont_set_owner_req__field_descriptor 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "contUUID", + "cont_id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(Mgmt__ContSetOwnerReq, contuuid), + offsetof(Mgmt__ContSetOwnerReq, cont_id), NULL, &protobuf_c_empty_string, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "poolUUID", + "pool_id", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(Mgmt__ContSetOwnerReq, pooluuid), + offsetof(Mgmt__ContSetOwnerReq, pool_id), NULL, &protobuf_c_empty_string, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "owneruser", + "owner_user", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(Mgmt__ContSetOwnerReq, owneruser), + offsetof(Mgmt__ContSetOwnerReq, owner_user), NULL, &protobuf_c_empty_string, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ownergroup", + "owner_group", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(Mgmt__ContSetOwnerReq, ownergroup), + offsetof(Mgmt__ContSetOwnerReq, owner_group), NULL, &protobuf_c_empty_string, 0, /* flags */ @@ -173,10 +128,10 @@ static const ProtobufCFieldDescriptor mgmt__cont_set_owner_req__field_descriptor }, }; static const unsigned mgmt__cont_set_owner_req__field_indices_by_name[] = { - 1, /* field[1] = contUUID */ - 4, /* field[4] = ownergroup */ - 3, /* field[3] = owneruser */ - 2, /* field[2] = poolUUID */ + 1, /* field[1] = cont_id */ + 4, /* field[4] = owner_group */ + 3, /* field[3] = owner_user */ + 2, /* field[2] = pool_id */ 5, /* field[5] = svc_ranks */ 0, /* field[0] = sys */ }; @@ -200,41 +155,3 @@ const ProtobufCMessageDescriptor mgmt__cont_set_owner_req__descriptor = (ProtobufCMessageInit) mgmt__cont_set_owner_req__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__cont_set_owner_resp__field_descriptors[1] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__ContSetOwnerResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__cont_set_owner_resp__field_indices_by_name[] = { - 0, /* field[0] = status */ -}; -static const ProtobufCIntRange mgmt__cont_set_owner_resp__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor mgmt__cont_set_owner_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ContSetOwnerResp", - "ContSetOwnerResp", - "Mgmt__ContSetOwnerResp", - "mgmt", - sizeof(Mgmt__ContSetOwnerResp), - 1, - mgmt__cont_set_owner_resp__field_descriptors, - mgmt__cont_set_owner_resp__field_indices_by_name, - 1, mgmt__cont_set_owner_resp__number_ranges, - (ProtobufCMessageInit) mgmt__cont_set_owner_resp__init, - NULL,NULL,NULL /* reserved[123] */ -}; diff --git a/src/mgmt/cont.pb-c.h b/src/mgmt/cont.pb-c.h index cf435513a91..49f17aca154 100644 --- a/src/mgmt/cont.pb-c.h +++ b/src/mgmt/cont.pb-c.h @@ -16,7 +16,6 @@ PROTOBUF_C__BEGIN_DECLS typedef struct _Mgmt__ContSetOwnerReq Mgmt__ContSetOwnerReq; -typedef struct _Mgmt__ContSetOwnerResp Mgmt__ContSetOwnerResp; /* --- enums --- */ @@ -25,7 +24,7 @@ typedef struct _Mgmt__ContSetOwnerResp Mgmt__ContSetOwnerResp; /* --- messages --- */ /* - * ContSetOwnerReq supplies new pool parameters. + * ContSetOwnerReq changes the ownership of a container. */ struct _Mgmt__ContSetOwnerReq { @@ -35,21 +34,21 @@ struct _Mgmt__ContSetOwnerReq */ char *sys; /* - * UUID of the container + * UUID or label of the container */ - char *contuuid; + char *cont_id; /* - * UUID of the pool that the container is in + * UUID or label of the pool that the container is in */ - char *pooluuid; + char *pool_id; /* * formatted user e.g. "bob@" */ - char *owneruser; + char *owner_user; /* * formatted group e.g. "builders@" */ - char *ownergroup; + char *owner_group; /* * List of pool service ranks */ @@ -61,22 +60,6 @@ struct _Mgmt__ContSetOwnerReq , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0,NULL } -/* - * ContSetOwnerResp returns created pool uuid and ranks. - */ -struct _Mgmt__ContSetOwnerResp -{ - ProtobufCMessage base; - /* - * DAOS error code - */ - int32_t status; -}; -#define MGMT__CONT_SET_OWNER_RESP__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&mgmt__cont_set_owner_resp__descriptor) \ - , 0 } - - /* Mgmt__ContSetOwnerReq methods */ void mgmt__cont_set_owner_req__init (Mgmt__ContSetOwnerReq *message); @@ -96,33 +79,11 @@ Mgmt__ContSetOwnerReq * void mgmt__cont_set_owner_req__free_unpacked (Mgmt__ContSetOwnerReq *message, ProtobufCAllocator *allocator); -/* Mgmt__ContSetOwnerResp methods */ -void mgmt__cont_set_owner_resp__init - (Mgmt__ContSetOwnerResp *message); -size_t mgmt__cont_set_owner_resp__get_packed_size - (const Mgmt__ContSetOwnerResp *message); -size_t mgmt__cont_set_owner_resp__pack - (const Mgmt__ContSetOwnerResp *message, - uint8_t *out); -size_t mgmt__cont_set_owner_resp__pack_to_buffer - (const Mgmt__ContSetOwnerResp *message, - ProtobufCBuffer *buffer); -Mgmt__ContSetOwnerResp * - mgmt__cont_set_owner_resp__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); -void mgmt__cont_set_owner_resp__free_unpacked - (Mgmt__ContSetOwnerResp *message, - ProtobufCAllocator *allocator); /* --- per-message closures --- */ typedef void (*Mgmt__ContSetOwnerReq_Closure) (const Mgmt__ContSetOwnerReq *message, void *closure_data); -typedef void (*Mgmt__ContSetOwnerResp_Closure) - (const Mgmt__ContSetOwnerResp *message, - void *closure_data); /* --- services --- */ @@ -130,7 +91,6 @@ typedef void (*Mgmt__ContSetOwnerResp_Closure) /* --- descriptors --- */ extern const ProtobufCMessageDescriptor mgmt__cont_set_owner_req__descriptor; -extern const ProtobufCMessageDescriptor mgmt__cont_set_owner_resp__descriptor; PROTOBUF_C__END_DECLS diff --git a/src/mgmt/srv_container.c b/src/mgmt/srv_container.c index d3dfcae265b..ec61969def7 100644 --- a/src/mgmt/srv_container.c +++ b/src/mgmt/srv_container.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2020-2022 Intel Corporation. + * (C) Copyright 2020-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -13,34 +13,19 @@ #include "srv_internal.h" -static int -cont_set_prop(uuid_t pool_uuid, d_rank_list_t *svc_ranks, - uuid_t cont_uuid, daos_prop_t *prop) -{ - int rc = 0; - - rc = ds_cont_svc_set_prop(pool_uuid, cont_uuid, svc_ranks, prop); - if (rc != 0) - goto out; - -out: - return rc; -} - int -ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, - uuid_t cont_uuid, const char *user, - const char *group) +ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, const char *cont_id, + const char *user, const char *group) { - int rc = 0; - daos_prop_t *prop; - uint32_t prop_nr = 0; - uint32_t i = 0; - bool user_set = false; - bool grp_set = false; + int rc = 0; + daos_prop_t *prop; + uint32_t prop_nr = 0; + uint32_t i = 0; + bool user_set = false; + bool grp_set = false; - D_DEBUG(DB_MGMT, "Setting owner for container "DF_UUID" in pool " - DF_UUID"\n", DP_UUID(cont_uuid), DP_UUID(pool_uuid)); + D_DEBUG(DB_MGMT, DF_UUID ": Setting owner for container '%s'\n", DP_UUID(pool_uuid), + cont_id); user_set = user != NULL && strnlen(user, DAOS_ACL_MAX_PRINCIPAL_LEN) > 0; grp_set = group != NULL && strnlen(group, DAOS_ACL_MAX_PRINCIPAL_LEN) > 0; @@ -76,7 +61,7 @@ ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, i++; } - rc = cont_set_prop(pool_uuid, svc_ranks, cont_uuid, prop); + rc = ds_cont_svc_set_prop(pool_uuid, cont_id, svc_ranks, prop); out_prop: daos_prop_free(prop); return rc; diff --git a/src/mgmt/srv_drpc.c b/src/mgmt/srv_drpc.c index ab55671c74d..de4a951a050 100644 --- a/src/mgmt/srv_drpc.c +++ b/src/mgmt/srv_drpc.c @@ -2456,11 +2456,11 @@ ds_mgmt_drpc_cont_set_owner(Drpc__Call *drpc_req, Drpc__Response *drpc_resp) { struct drpc_alloc alloc = PROTO_ALLOCATOR_INIT(alloc); Mgmt__ContSetOwnerReq *req = NULL; - Mgmt__ContSetOwnerResp resp = MGMT__CONT_SET_OWNER_RESP__INIT; + Mgmt__DaosResp resp = MGMT__DAOS_RESP__INIT; uint8_t *body; - size_t len; - uuid_t pool_uuid, cont_uuid; + size_t len; d_rank_list_t *svc_ranks = NULL; + uuid_t pool_uuid; int rc = 0; req = mgmt__cont_set_owner_req__unpack(&alloc.alloc, drpc_req->body.len, @@ -2472,39 +2472,33 @@ ds_mgmt_drpc_cont_set_owner(Drpc__Call *drpc_req, Drpc__Response *drpc_resp) return; } - D_INFO("Received request to change container owner\n"); - - if (uuid_parse(req->contuuid, cont_uuid) != 0) { - rc = -DER_INVAL; - DL_ERROR(rc, "Container UUID is invalid"); - goto out; - } + D_INFO("Received request to change owner for container '%s' in pool '%s'\n", req->cont_id, + req->pool_id); - if (uuid_parse(req->pooluuid, pool_uuid) != 0) { - rc = -DER_INVAL; - DL_ERROR(rc, "Pool UUID is invalid"); - goto out; + if (uuid_parse(req->pool_id, pool_uuid) != 0) { + DL_ERROR(-DER_INVAL, "Pool UUID is invalid"); + D_GOTO(out, rc = -DER_INVAL); } svc_ranks = uint32_array_to_rank_list(req->svc_ranks, req->n_svc_ranks); if (svc_ranks == NULL) D_GOTO(out, rc = -DER_NOMEM); - rc = ds_mgmt_cont_set_owner(pool_uuid, svc_ranks, cont_uuid, - req->owneruser, req->ownergroup); + rc = ds_mgmt_cont_set_owner(pool_uuid, svc_ranks, req->cont_id, req->owner_user, + req->owner_group); if (rc != 0) - D_ERROR("Set owner failed: %d\n", rc); + D_ERROR("Container set owner failed: " DF_RC "\n", DP_RC(rc)); d_rank_list_free(svc_ranks); out: resp.status = rc; - len = mgmt__cont_set_owner_resp__get_packed_size(&resp); + len = mgmt__daos_resp__get_packed_size(&resp); D_ALLOC(body, len); if (body == NULL) { drpc_resp->status = DRPC__STATUS__FAILED_MARSHAL; } else { - mgmt__cont_set_owner_resp__pack(&resp, body); + mgmt__daos_resp__pack(&resp, body); drpc_resp->body.len = len; drpc_resp->body.data = body; } diff --git a/src/mgmt/srv_internal.h b/src/mgmt/srv_internal.h index 6f8303ea8f2..88f7e901008 100644 --- a/src/mgmt/srv_internal.h +++ b/src/mgmt/srv_internal.h @@ -119,9 +119,9 @@ int ds_mgmt_pool_query(uuid_t pool_uuid, d_rank_list_t *svc_ranks, d_rank_list_t int ds_mgmt_pool_query_targets(uuid_t pool_uuid, d_rank_list_t *svc_ranks, d_rank_t rank, d_rank_list_t *tgts, daos_target_info_t **infos); -int ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, - uuid_t cont_uuid, const char *user, - const char *group); +int + ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, const char *cont_id, + const char *user, const char *group); /** srv_chk.c */ int ds_mgmt_check_start(uint32_t rank_nr, d_rank_t *ranks, uint32_t policy_nr, diff --git a/src/mgmt/tests/mocks.c b/src/mgmt/tests/mocks.c index 3b62d64d6a5..eace651e60b 100644 --- a/src/mgmt/tests/mocks.c +++ b/src/mgmt/tests/mocks.c @@ -370,18 +370,17 @@ mock_ds_mgmt_pool_query_targets_teardown(void) } } -int ds_mgmt_cont_set_owner_return; -uuid_t ds_mgmt_cont_set_owner_pool; -uuid_t ds_mgmt_cont_set_owner_cont; +int ds_mgmt_cont_set_owner_return; +uuid_t ds_mgmt_cont_set_owner_pool; +char *ds_mgmt_cont_set_owner_cont; char *ds_mgmt_cont_set_owner_user; char *ds_mgmt_cont_set_owner_group; int -ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, - uuid_t cont_uuid, const char *user, - const char *group) +ds_mgmt_cont_set_owner(uuid_t pool_uuid, d_rank_list_t *svc_ranks, const char *cont_id, + const char *user, const char *group) { uuid_copy(ds_mgmt_cont_set_owner_pool, pool_uuid); - uuid_copy(ds_mgmt_cont_set_owner_cont, cont_uuid); + D_STRNDUP(ds_mgmt_cont_set_owner_cont, cont_id, DAOS_PROP_LABEL_MAX_LEN); if (user != NULL) D_STRNDUP(ds_mgmt_cont_set_owner_user, user, DAOS_ACL_MAX_PRINCIPAL_LEN); @@ -398,12 +397,13 @@ mock_ds_mgmt_cont_set_owner_setup(void) ds_mgmt_cont_set_owner_return = 0; uuid_clear(ds_mgmt_cont_set_owner_pool); - uuid_clear(ds_mgmt_cont_set_owner_cont); + ds_mgmt_cont_set_owner_cont = NULL; ds_mgmt_cont_set_owner_user = NULL; ds_mgmt_cont_set_owner_group = NULL; } void mock_ds_mgmt_cont_set_owner_teardown(void) { + D_FREE(ds_mgmt_cont_set_owner_cont); D_FREE(ds_mgmt_cont_set_owner_user); D_FREE(ds_mgmt_cont_set_owner_group); } diff --git a/src/mgmt/tests/mocks.h b/src/mgmt/tests/mocks.h index 385986f6dda..4f4ddbc9522 100644 --- a/src/mgmt/tests/mocks.h +++ b/src/mgmt/tests/mocks.h @@ -137,11 +137,11 @@ void mock_ds_mgmt_pool_evict_setup(void); /* * Mock ds_mgmt_cont_set_owner */ -extern int ds_mgmt_cont_set_owner_return; -extern uuid_t ds_mgmt_cont_set_owner_pool; -extern uuid_t ds_mgmt_cont_set_owner_cont; -extern char *ds_mgmt_cont_set_owner_user; -extern char *ds_mgmt_cont_set_owner_group; +extern int ds_mgmt_cont_set_owner_return; +extern uuid_t ds_mgmt_cont_set_owner_pool; +extern char *ds_mgmt_cont_set_owner_cont; +extern char *ds_mgmt_cont_set_owner_user; +extern char *ds_mgmt_cont_set_owner_group; void mock_ds_mgmt_cont_set_owner_setup(void); void mock_ds_mgmt_cont_set_owner_teardown(void); void mock_ds_mgmt_pool_query_targets_gen_infos(uint32_t n_infos); diff --git a/src/mgmt/tests/srv_drpc_tests.c b/src/mgmt/tests/srv_drpc_tests.c index 4d93b5e6728..599eb8db77e 100644 --- a/src/mgmt/tests/srv_drpc_tests.c +++ b/src/mgmt/tests/srv_drpc_tests.c @@ -2423,17 +2423,16 @@ static void expect_drpc_cont_set_owner_resp_with_status(Drpc__Response *resp, int expected_err) { - Mgmt__ContSetOwnerResp *payload_resp = NULL; + Mgmt__DaosResp *payload_resp = NULL; assert_int_equal(resp->status, DRPC__STATUS__SUCCESS); assert_non_null(resp->body.data); - payload_resp = mgmt__cont_set_owner_resp__unpack(NULL, resp->body.len, - resp->body.data); + payload_resp = mgmt__daos_resp__unpack(NULL, resp->body.len, resp->body.data); assert_non_null(payload_resp); assert_int_equal(payload_resp->status, expected_err); - mgmt__cont_set_owner_resp__free_unpacked(payload_resp, NULL); + mgmt__daos_resp__free_unpacked(payload_resp, NULL); } static void @@ -2443,10 +2442,10 @@ test_drpc_cont_set_owner_bad_pool_uuid(void **state) Drpc__Response resp = DRPC__RESPONSE__INIT; Mgmt__ContSetOwnerReq req = MGMT__CONT_SET_OWNER_REQ__INIT; - req.pooluuid = "this isn't really a uuid"; - req.contuuid = "11111111-1111-1111-1111-111111111111"; - req.owneruser = "user@"; - req.ownergroup = "group@"; + req.pool_id = "this isn't really a uuid"; + req.cont_id = "11111111-1111-1111-1111-111111111111"; + req.owner_user = "user@"; + req.owner_group = "group@"; setup_cont_set_owner_drpc_call(&call, &req); @@ -2459,22 +2458,32 @@ test_drpc_cont_set_owner_bad_pool_uuid(void **state) } static void -test_drpc_cont_set_owner_bad_cont_uuid(void **state) +test_drpc_cont_set_owner_cont_label(void **state) { Drpc__Call call = DRPC__CALL__INIT; Drpc__Response resp = DRPC__RESPONSE__INIT; Mgmt__ContSetOwnerReq req = MGMT__CONT_SET_OWNER_REQ__INIT; + uuid_t pool_uuid; - req.pooluuid = "11111111-1111-1111-1111-111111111111"; - req.contuuid = "this isn't really a uuid"; - req.owneruser = "user@"; - req.ownergroup = "group@"; + req.pool_id = "11111111-1111-1111-1111-111111111111"; + req.cont_id = "cont_label"; + req.owner_user = "user@"; + req.owner_group = "group@"; setup_cont_set_owner_drpc_call(&call, &req); ds_mgmt_drpc_cont_set_owner(&call, &resp); - expect_drpc_cont_set_owner_resp_with_status(&resp, -DER_INVAL); + expect_drpc_cont_set_owner_resp_with_status(&resp, 0); + + /* Verify mgmt_cont_set_owner called with correct params */ + assert_int_equal(uuid_parse(req.pool_id, pool_uuid), 0); + assert_int_equal(uuid_compare(pool_uuid, ds_mgmt_cont_set_owner_pool), 0); + assert_string_equal(req.cont_id, ds_mgmt_cont_set_owner_cont); + assert_non_null(ds_mgmt_cont_set_owner_user); + assert_string_equal(req.owner_user, ds_mgmt_cont_set_owner_user); + assert_non_null(ds_mgmt_cont_set_owner_group); + assert_string_equal(req.owner_group, ds_mgmt_cont_set_owner_group); D_FREE(call.body.data); D_FREE(resp.body.data); @@ -2488,10 +2497,10 @@ test_drpc_cont_set_owner_failed(void **state) Mgmt__ContSetOwnerReq req = MGMT__CONT_SET_OWNER_REQ__INIT; int exp_rc = -DER_MISC; - req.pooluuid = "11111111-1111-1111-1111-111111111111"; - req.contuuid = "22222222-2222-2222-2222-222222222222"; - req.owneruser = "user@"; - req.ownergroup = "group@"; + req.pool_id = "11111111-1111-1111-1111-111111111111"; + req.cont_id = "22222222-2222-2222-2222-222222222222"; + req.owner_user = "user@"; + req.owner_group = "group@"; setup_cont_set_owner_drpc_call(&call, &req); ds_mgmt_cont_set_owner_return = exp_rc; @@ -2510,22 +2519,17 @@ test_drpc_cont_set_owner_success(void **state) Drpc__Call call = DRPC__CALL__INIT; Drpc__Response resp = DRPC__RESPONSE__INIT; Mgmt__ContSetOwnerReq req = MGMT__CONT_SET_OWNER_REQ__INIT; - char *pool_uuid_str; - uuid_t pool_uuid; - char *cont_uuid_str; - uuid_t cont_uuid; + char *pool_uuid_str; + char *cont_uuid_str; + uuid_t pool_uuid; pool_uuid_str = "11111111-1111-1111-1111-111111111111"; - if (uuid_parse(pool_uuid_str, pool_uuid)) - return; cont_uuid_str = "22222222-2222-2222-2222-222222222222"; - if (uuid_parse(cont_uuid_str, cont_uuid)) - return; - req.pooluuid = pool_uuid_str; - req.contuuid = cont_uuid_str; - req.owneruser = "user@"; - req.ownergroup = "group@"; + req.pool_id = pool_uuid_str; + req.cont_id = cont_uuid_str; + req.owner_user = "user@"; + req.owner_group = "group@"; setup_cont_set_owner_drpc_call(&call, &req); @@ -2534,14 +2538,13 @@ test_drpc_cont_set_owner_success(void **state) expect_drpc_cont_set_owner_resp_with_status(&resp, 0); /* Verify mgmt_cont_set_owner called with correct params */ - assert_int_equal(uuid_compare(pool_uuid, ds_mgmt_cont_set_owner_pool), - 0); - assert_int_equal(uuid_compare(cont_uuid, ds_mgmt_cont_set_owner_cont), - 0); + assert_int_equal(uuid_parse(pool_uuid_str, pool_uuid), 0); + assert_int_equal(uuid_compare(pool_uuid, ds_mgmt_cont_set_owner_pool), 0); + assert_string_equal(cont_uuid_str, ds_mgmt_cont_set_owner_cont); assert_non_null(ds_mgmt_cont_set_owner_user); - assert_string_equal(req.owneruser, ds_mgmt_cont_set_owner_user); + assert_string_equal(req.owner_user, ds_mgmt_cont_set_owner_user); assert_non_null(ds_mgmt_cont_set_owner_group); - assert_string_equal(req.ownergroup, ds_mgmt_cont_set_owner_group); + assert_string_equal(req.owner_group, ds_mgmt_cont_set_owner_group); D_FREE(call.body.data); D_FREE(resp.body.data); @@ -3128,7 +3131,7 @@ main(void) PING_RANK_TEST(test_drpc_ping_rank_success), PREP_SHUTDOWN_TEST(test_drpc_prep_shutdown_success), SET_LOG_MASKS_TEST(test_drpc_set_log_masks_success), - CONT_SET_OWNER_TEST(test_drpc_cont_set_owner_bad_cont_uuid), + CONT_SET_OWNER_TEST(test_drpc_cont_set_owner_cont_label), CONT_SET_OWNER_TEST(test_drpc_cont_set_owner_bad_pool_uuid), CONT_SET_OWNER_TEST(test_drpc_cont_set_owner_failed), CONT_SET_OWNER_TEST(test_drpc_cont_set_owner_success), diff --git a/src/proto/mgmt/cont.proto b/src/proto/mgmt/cont.proto index f90a35528d6..4e6c2a52a57 100644 --- a/src/proto/mgmt/cont.proto +++ b/src/proto/mgmt/cont.proto @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2021 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -12,17 +12,12 @@ option go_package = "github.com/daos-stack/daos/src/control/common/proto/mgmt"; // Management Service Protobuf Definitions related to interactions between // DAOS control server and DAOS containers. -// ContSetOwnerReq supplies new pool parameters. +// ContSetOwnerReq changes the ownership of a container. message ContSetOwnerReq { string sys = 1; // DAOS system identifier - string contUUID = 2; // UUID of the container - string poolUUID = 3; // UUID of the pool that the container is in - string owneruser = 4; // formatted user e.g. "bob@" - string ownergroup = 5; // formatted group e.g. "builders@" + string cont_id = 2; // UUID or label of the container + string pool_id = 3; // UUID or label of the pool that the container is in + string owner_user = 4; // formatted user e.g. "bob@" + string owner_group = 5; // formatted group e.g. "builders@" repeated uint32 svc_ranks = 6; // List of pool service ranks } - -// ContSetOwnerResp returns created pool uuid and ranks. -message ContSetOwnerResp { - int32 status = 1; // DAOS error code -} diff --git a/src/proto/mgmt/mgmt.proto b/src/proto/mgmt/mgmt.proto index d58c8115fa8..82a83aa36f9 100644 --- a/src/proto/mgmt/mgmt.proto +++ b/src/proto/mgmt/mgmt.proto @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2022 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -70,7 +70,7 @@ service MgmtSvc { // List all containers in a pool rpc ListContainers(ListContReq) returns (ListContResp) {} // Change the owner of a DAOS container - rpc ContSetOwner(ContSetOwnerReq) returns (ContSetOwnerResp) {} + rpc ContSetOwner(ContSetOwnerReq) returns (DaosResp) {} // Query DAOS system status rpc SystemQuery(SystemQueryReq) returns(SystemQueryResp) {} // Stop DAOS system (shutdown data-plane instances) diff --git a/src/tests/ftest/security/cont_get_acl.yaml b/src/tests/ftest/security/cont_get_acl.yaml index c82bcaddb70..afc21101c9b 100644 --- a/src/tests/ftest/security/cont_get_acl.yaml +++ b/src/tests/ftest/security/cont_get_acl.yaml @@ -15,6 +15,7 @@ server_config: 0: class: ram scm_mount: /mnt/daos + scm_size: 6 system_ram_reserved: 1 pool: control_method: dmg diff --git a/src/tests/ftest/security/cont_owner.py b/src/tests/ftest/security/cont_owner.py index 7935a6b9bc5..b4ec4f0d526 100644 --- a/src/tests/ftest/security/cont_owner.py +++ b/src/tests/ftest/security/cont_owner.py @@ -30,6 +30,18 @@ def _create_cont_with_acl(self, cont_type): self.container = self.create_container_with_daos(self.pool, acl_file=acl_file_name, cont_type=cont_type) + def _get_ownership(self): + result = self.container.get_acl() + return { + "user": result['response']['owner_user'], + "group": result['response']['owner_group'], + } + + def _check_ownership(self, exp_user, exp_group): + ownership = self._get_ownership() + self.assertEqual(ownership["user"], exp_user, "user owner doesn't match") + self.assertEqual(ownership["group"], exp_group, "group owner doesn't match") + def test_container_set_owner_no_check_non_posix(self): """ Description: @@ -125,3 +137,66 @@ def test_container_set_owner_no_check_posix(self): no_check=True) self.verify_daos_pool_cont_result(result, "set owner with uid/gid with no-check", "pass", None) + + def test_dmg_cont_set_owner(self): + """ + Description: + Verify dmg container set-owner + + :avocado: tags=all,full_regression + :avocado: tags=vm + :avocado: tags=security,control,container,cont_sec,cont_set_owner + :avocado: tags=DaosContainerOwnerTest,test_dmg_cont_set_owner + """ + test_user = "fakeuser@" + test_group = "fakegroup@" + + self._create_cont_with_acl(cont_type="python") + orig_owner = self._get_ownership() + + # No user/group + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.identifier, + self.container.identifier) + self.verify_daos_pool_cont_result(result, "set owner with no user or group", "fail", + "at least one") + self._check_ownership(orig_owner["user"], orig_owner["group"]) # expect unchanged + + # User only - not locally checked + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.identifier, + self.container.identifier, + user=test_user) + self.verify_daos_pool_cont_result(result, "set owner user", "pass", None) + self._check_ownership(test_user, orig_owner["group"]) + + # Group only - not locally checked + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.identifier, + self.container.identifier, + group=test_group) + self.verify_daos_pool_cont_result(result, "set owner group", "pass", None) + self._check_ownership(test_user, test_group) + + # User and group + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.identifier, + self.container.identifier, + user="fakeuser2", group="fakegroup2") + self.verify_daos_pool_cont_result(result, "set owner user and group", "pass", None) + self._check_ownership("fakeuser2@", "fakegroup2@") + + # Labels as IDs + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.label.value, + self.container.label.value, + user=orig_owner["user"]) + self.verify_daos_pool_cont_result(result, "set owner user with labels", "pass", None) + self._check_ownership(orig_owner["user"], "fakegroup2@") + + # UUIDs as IDs + with self.dmg.no_exception(): + result = self.get_dmg_command().cont_set_owner(self.pool.uuid, self.container.uuid, + group=orig_owner["group"]) + self.verify_daos_pool_cont_result(result, "set owner group with UUIDs", "pass", None) + self._check_ownership(orig_owner["user"], orig_owner["group"]) diff --git a/src/tests/ftest/util/cont_security_test_base.py b/src/tests/ftest/util/cont_security_test_base.py index 28e714052a5..0a9058f87d8 100644 --- a/src/tests/ftest/util/cont_security_test_base.py +++ b/src/tests/ftest/util/cont_security_test_base.py @@ -83,9 +83,7 @@ def get_container_acl_list(self, container, verbose=False, outfile=None): result = container.get_acl(verbose, outfile) cont_permission_list = [] - for line in result.stdout_text.splitlines(): - if not line.startswith("A:"): - continue + for line in result['response']['entries']: if line.startswith("A::"): found_user = re.search(r"A::(.+)@:(.*)", line) if found_user: diff --git a/src/tests/ftest/util/daos_utils.py b/src/tests/ftest/util/daos_utils.py index efe76b199d9..c916761b25d 100644 --- a/src/tests/ftest/util/daos_utils.py +++ b/src/tests/ftest/util/daos_utils.py @@ -194,7 +194,7 @@ def container_get_acl(self, pool, cont, verbose=False, outfile=None): CommandFailure: if the daos container get-acl command fails. """ - return self._get_result( + return self._get_json_result( ("container", "get-acl"), pool=pool, cont=cont, verbose=verbose, outfile=outfile) diff --git a/src/tests/ftest/util/dmg_utils.py b/src/tests/ftest/util/dmg_utils.py index 0fbc91b38da..34e21f66d0a 100644 --- a/src/tests/ftest/util/dmg_utils.py +++ b/src/tests/ftest/util/dmg_utils.py @@ -957,12 +957,12 @@ def pool_reintegrate(self, pool, rank, tgt_idx=None): return self._get_result( ("pool", "reintegrate"), pool=pool, rank=rank, tgt_idx=tgt_idx) - def cont_set_owner(self, pool, cont, user, group): + def cont_set_owner(self, pool, cont, user=None, group=None): """Dmg container set-owner to the specified new user/group. Args: - pool (str): Pool uuid. - cont (str): Container uuid. + pool (str): Pool label or UUID. + cont (str): Container label or UUID. user (str): new user for the container. group (str): new group for the container. @@ -974,7 +974,7 @@ def cont_set_owner(self, pool, cont, user, group): CommandFailure: if the dmg pool reintegrate command fails. """ - return self._get_result( + return self._get_json_result( ("cont", "set-owner"), pool=pool, cont=cont, user=user, group=group) def system_cleanup(self, machinename=None, verbose=True): diff --git a/src/tests/ftest/util/dmg_utils_base.py b/src/tests/ftest/util/dmg_utils_base.py index 43272eac510..31ba1b50f33 100644 --- a/src/tests/ftest/util/dmg_utils_base.py +++ b/src/tests/ftest/util/dmg_utils_base.py @@ -254,18 +254,18 @@ def get_sub_command_class(self): # pylint: disable=redefined-variable-type """Get the dmg cont sub command object.""" if self.sub_command.value == "set-owner": - self.sub_command_class = self.SetownerSubCommand() + self.sub_command_class = self.SetOwnerSubCommand() else: self.sub_command_class = None - class SetownerSubCommand(CommandWithParameters): + class SetOwnerSubCommand(CommandWithParameters): """Defines an object for the dmg cont set-owner command.""" def __init__(self): """Create a dmg cont set-owner command object.""" super().__init__("/run/dmg/cont/set-owner/*", "set-owner") - self.pool = FormattedParameter("--pool={}", None) - self.cont = FormattedParameter("--cont={}", None) + self.pool = BasicParameter(None, position=1) + self.cont = BasicParameter(None, position=2) self.user = FormattedParameter("--user={}", None) self.group = FormattedParameter("--group={}", None)