feat: add a post-registry-login trigger

This allows other plugins to execute commands after a registry has been authenticated against.
This commit is contained in:
Jose Diaz-Gonzalez
2024-01-18 22:25:23 -05:00
parent d89e2ba2bb
commit 98d0a95ae6
3 changed files with 33 additions and 0 deletions

View File

@@ -53,6 +53,19 @@ func CommandLogin(server string, username string, password string, passwordStdin
return errors.New("Failed to log into registry")
}
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "post-registry-login",
Args: []string{server, username},
StreamStdio: true,
CaptureOutput: false,
Env: map[string]string{
"DOCKER_REGISTRY_PASS": password,
},
})
if err != nil {
return err
}
return nil
}