grim/convey
Clone
Summary
Browse
Changes
Graph
Update to Go 1.21 and use some new helpers
5 months ago, Elliott Sales de Andrade
adb6eb2a7d21
Update to Go 1.21 and use some new helpers
`strings.Cut` was added in 1.18, and `maps`/`slices` in 1.21.
Testing Done:
Ran `go test ./...`
Reviewed at https://reviews.imfreedom.org/r/2870/
package
docker
import
(
"fmt"
log
"github.com/sirupsen/logrus"
"keep.imfreedom.org/grim/convey/environment"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/runtime"
)
type
Login
struct
{
Server
string
`yaml:"server"`
Username
string
`yaml:"username"`
Password
string
`yaml:"password"`
realLogin
*
podman
.
Login
}
func
(
l
*
Login
)
Execute
(
name
string
,
logger
*
log
.
Entry
,
stageEnv
environment
.
Environment
,
rt
*
runtime
.
Runtime
)
error
{
return
l
.
realLogin
.
Execute
(
name
,
logger
,
stageEnv
,
rt
)
}
func
(
l
*
Login
)
New
()
runtime
.
Task
{
return
&
Login
{}
}
func
(
l
*
Login
)
Valid
()
error
{
l
.
realLogin
=
&
podman
.
Login
{
Registry
:
l
.
Server
,
Username
:
l
.
Username
,
Password
:
l
.
Password
,
}
return
l
.
realLogin
.
Valid
()
}
func
(
l
*
Login
)
Deprecated
()
error
{
return
fmt
.
Errorf
(
"docker/login has been deprecated in favor of podman/login since 0.15.0"
)
}