Fix func to determine default login (#29)

only add default login if auth profided or no login entry exist

Reviewed-on: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/pulls/29
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
6543
2022-10-11 11:38:36 +02:00
parent 5868a6e6a8
commit fca44ab7ae
6 changed files with 108 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ import (
// Plugin implements drone.Plugin to provide the plugin implementation.
type Plugin struct {
settings Settings
settings *Settings
pipeline drone.Pipeline
network drone.Network
}
@@ -14,8 +14,15 @@ type Plugin struct {
// New initializes a plugin from the given Settings, Pipeline, and Network.
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) drone.Plugin {
return &Plugin{
settings: settings,
settings: &settings,
pipeline: pipeline,
network: network,
}
}
// newSettingsOnly initializes a plugin from the given Settings only.
func newSettingsOnly(settings *Settings) drone.Plugin {
return &Plugin{
settings: settings,
}
}