mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
protobuf: remove gogoproto
Removes gogo/protobuf from buildx and updates to a version of moby/buildkit where gogo is removed. This also changes how the proto files are generated. This is because newer versions of protobuf are more strict about name conflicts. If two files have the same name (even if they are relative paths) and are used in different protoc commands, they'll conflict in the registry. Since protobuf file generation doesn't work very well with `paths=source_relative`, this removes the `go:generate` expression and just relies on the dockerfile to perform the generation. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
@ -31,7 +31,7 @@ type MonitorBuildResult struct {
|
||||
}
|
||||
|
||||
// RunMonitor provides an interactive session for running and managing containers via specified IO.
|
||||
func RunMonitor(ctx context.Context, curRef string, options *controllerapi.BuildOptions, invokeConfig controllerapi.InvokeConfig, c control.BuildxController, stdin io.ReadCloser, stdout io.WriteCloser, stderr console.File, progress *progress.Printer) (*MonitorBuildResult, error) {
|
||||
func RunMonitor(ctx context.Context, curRef string, options *controllerapi.BuildOptions, invokeConfig *controllerapi.InvokeConfig, c control.BuildxController, stdin io.ReadCloser, stdout io.WriteCloser, stderr console.File, progress *progress.Printer) (*MonitorBuildResult, error) {
|
||||
defer func() {
|
||||
if err := c.Disconnect(ctx, curRef); err != nil {
|
||||
logrus.Warnf("disconnect error: %v", err)
|
||||
@ -244,7 +244,7 @@ type monitor struct {
|
||||
lastBuildResult *MonitorBuildResult
|
||||
}
|
||||
|
||||
func (m *monitor) Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (ref string, resp *client.SolveResponse, input *build.Inputs, err error) {
|
||||
func (m *monitor) Build(ctx context.Context, options *controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (ref string, resp *client.SolveResponse, input *build.Inputs, err error) {
|
||||
ref, resp, _, err = m.BuildxController.Build(ctx, options, in, progress)
|
||||
m.lastBuildResult = &MonitorBuildResult{Resp: resp, Err: err} // Record build result
|
||||
return
|
||||
@ -262,19 +262,19 @@ func (m *monitor) AttachedSessionID() string {
|
||||
return m.ref.Load().(string)
|
||||
}
|
||||
|
||||
func (m *monitor) Rollback(ctx context.Context, cfg controllerapi.InvokeConfig) string {
|
||||
func (m *monitor) Rollback(ctx context.Context, cfg *controllerapi.InvokeConfig) string {
|
||||
pid := identity.NewID()
|
||||
cfg1 := cfg
|
||||
cfg1.Rollback = true
|
||||
return m.startInvoke(ctx, pid, cfg1)
|
||||
}
|
||||
|
||||
func (m *monitor) Exec(ctx context.Context, cfg controllerapi.InvokeConfig) string {
|
||||
func (m *monitor) Exec(ctx context.Context, cfg *controllerapi.InvokeConfig) string {
|
||||
return m.startInvoke(ctx, identity.NewID(), cfg)
|
||||
}
|
||||
|
||||
func (m *monitor) Attach(ctx context.Context, pid string) {
|
||||
m.startInvoke(ctx, pid, controllerapi.InvokeConfig{})
|
||||
m.startInvoke(ctx, pid, &controllerapi.InvokeConfig{})
|
||||
}
|
||||
|
||||
func (m *monitor) Detach() {
|
||||
@ -291,7 +291,7 @@ func (m *monitor) close() {
|
||||
m.Detach()
|
||||
}
|
||||
|
||||
func (m *monitor) startInvoke(ctx context.Context, pid string, cfg controllerapi.InvokeConfig) string {
|
||||
func (m *monitor) startInvoke(ctx context.Context, pid string, cfg *controllerapi.InvokeConfig) string {
|
||||
if m.invokeCancel != nil {
|
||||
m.invokeCancel() // Finish existing attach
|
||||
}
|
||||
@ -317,7 +317,7 @@ func (m *monitor) startInvoke(ctx context.Context, pid string, cfg controllerapi
|
||||
return pid
|
||||
}
|
||||
|
||||
func (m *monitor) invoke(ctx context.Context, pid string, cfg controllerapi.InvokeConfig) error {
|
||||
func (m *monitor) invoke(ctx context.Context, pid string, cfg *controllerapi.InvokeConfig) error {
|
||||
m.muxIO.Enable(1)
|
||||
defer m.muxIO.Disable(1)
|
||||
if err := m.muxIO.SwitchTo(1); err != nil {
|
||||
|
Reference in New Issue
Block a user