podman

Форк
0
45 строк · 1.4 Кб
1
package config
2

3
import (
4
	"errors"
5
	"fmt"
6
	"os"
7

8
	dockerclient "github.com/fsouza/go-dockerclient"
9
	"github.com/openshift/imagebuilder"
10
)
11

12
// configOnlyExecutor implements the Executor interface that an
13
// imagebuilder.Builder expects to be able to call to do some heavy lifting,
14
// but it just refuses to do the work of ADD, COPY, or RUN.  It also doesn't
15
// care if the working directory exists in a container, because it's really
16
// only concerned with letting the Builder's RunConfig get updated by changes
17
// from a Dockerfile.  Try anything more than that and it'll return an error.
18
type configOnlyExecutor struct{}
19

20
func (g *configOnlyExecutor) Preserve(path string) error {
21
	return errors.New("ADD/COPY/RUN not supported as changes")
22
}
23

24
func (g *configOnlyExecutor) EnsureContainerPath(path string) error {
25
	return nil
26
}
27

28
func (g *configOnlyExecutor) EnsureContainerPathAs(path, user string, mode *os.FileMode) error {
29
	return nil
30
}
31

32
func (g *configOnlyExecutor) Copy(excludes []string, copies ...imagebuilder.Copy) error {
33
	if len(copies) == 0 {
34
		return nil
35
	}
36
	return errors.New("ADD/COPY not supported as changes")
37
}
38

39
func (g *configOnlyExecutor) Run(run imagebuilder.Run, config dockerclient.Config) error {
40
	return errors.New("RUN not supported as changes")
41
}
42

43
func (g *configOnlyExecutor) UnrecognizedInstruction(step *imagebuilder.Step) error {
44
	return fmt.Errorf("did not understand change instruction %q", step.Original)
45
}
46

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.