forked from TrueCloudLab/frostfs-s3-gw
[#409] authmate: Fix container ID parsing
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
58ce884eab
commit
c9126fc0a9
1 changed files with 3 additions and 2 deletions
|
@ -245,8 +245,9 @@ It will be ceil rounded to the nearest amount of epoch.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
agent := authmate.New(log, neoFS)
|
agent := authmate.New(log, neoFS)
|
||||||
var containerID cid.ID
|
var containerID *cid.ID // keep nil value if container flag is not set
|
||||||
if len(containerIDFlag) > 0 {
|
if len(containerIDFlag) > 0 {
|
||||||
|
containerID = new(cid.ID)
|
||||||
if err = containerID.DecodeString(containerIDFlag); err != nil {
|
if err = containerID.DecodeString(containerIDFlag); err != nil {
|
||||||
return cli.Exit(fmt.Sprintf("failed to parse auth container id: %s", err), 3)
|
return cli.Exit(fmt.Sprintf("failed to parse auth container id: %s", err), 3)
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,7 @@ It will be ceil rounded to the nearest amount of epoch.`,
|
||||||
|
|
||||||
issueSecretOptions := &authmate.IssueSecretOptions{
|
issueSecretOptions := &authmate.IssueSecretOptions{
|
||||||
Container: authmate.ContainerOptions{
|
Container: authmate.ContainerOptions{
|
||||||
ID: &containerID,
|
ID: containerID,
|
||||||
FriendlyName: containerFriendlyName,
|
FriendlyName: containerFriendlyName,
|
||||||
PlacementPolicy: containerPlacementPolicy,
|
PlacementPolicy: containerPlacementPolicy,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue