in internal/plugin/plugin.go [153:178]
func invokeOperation(ctx context.Context, in *Input, debugLog *log.Logger) error {
switch in.Operation {
case "PushContainerImage":
s, err := in.Configuration.newAWSSession()
if err != nil {
return err
}
ls := lightsail.New(s)
internal.CheckForUpdates(ctx, debugLog, ls, internal.Version)
r, err := parsePushContainerImagePayload(in.Payload)
if err != nil {
return fmt.Errorf("unable to parse the input's payload field: %w", err)
}
dc, err := cs.NewDockerEngine(ctx)
if err != nil {
return err
}
if err := cs.PushImage(ctx, r, ls, dc); err != nil {
return err
}
default:
return fmt.Errorf("unknown plugin operation: %q", in.Operation)
}
return nil
}