mirror of
https://github.com/thegeeklab/drone-docker-buildx.git
synced 2024-06-19 16:50:54 +02:00
lint
This commit is contained in:
parent
d85ae1c6a7
commit
06513ea73e
|
@ -296,7 +296,7 @@ properties:
|
||||||
|
|
||||||
- name: registries
|
- name: registries
|
||||||
description: |
|
description: |
|
||||||
Credentials for registries. Ignored if password was set.
|
Credentials for registries.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
|
@ -45,7 +45,7 @@ type RegistryData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RegistriesYaml struct {
|
type RegistriesYaml struct {
|
||||||
Registries []RegistryData
|
Registries []RegistryData `yaml:"registries"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build defines Docker build parameters.
|
// Build defines Docker build parameters.
|
||||||
|
@ -186,8 +186,8 @@ func (p *Plugin) Execute() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.settings.Login.RegistriesYaml != "" {
|
if p.settings.Login.RegistriesYaml != "" {
|
||||||
if p.settings.Login.Password == "" {
|
|
||||||
var t RegistriesYaml
|
var t RegistriesYaml
|
||||||
|
|
||||||
err := yaml.Unmarshal([]byte(p.settings.Login.RegistriesYaml), &t)
|
err := yaml.Unmarshal([]byte(p.settings.Login.RegistriesYaml), &t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error unmarshal registries: %w", err)
|
return fmt.Errorf("error unmarshal registries: %w", err)
|
||||||
|
@ -199,14 +199,12 @@ func (p *Plugin) Execute() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := commandLogin(registryData)
|
cmd := commandLogin(registryData)
|
||||||
|
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error authenticating: %w", err)
|
return fmt.Errorf("error authenticating: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
logrus.Warn("Cannot use password and registries at same time!")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.settings.Daemon.BuildkitConfig != "" {
|
if p.settings.Daemon.BuildkitConfig != "" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user