podman

Форк
0
50 строк · 1.4 Кб
1
package define
2

3
import (
4
	"fmt"
5
)
6

7
// PullPolicy takes the value PullIfMissing, PullAlways, PullIfNewer, or PullNever.
8
type PullPolicy int
9

10
const (
11
	// PullIfMissing is one of the values that BuilderOptions.PullPolicy
12
	// can take, signalling that the source image should be pulled from a
13
	// registry if a local copy of it is not already present.
14
	PullIfMissing PullPolicy = iota
15
	// PullAlways is one of the values that BuilderOptions.PullPolicy can
16
	// take, signalling that a fresh, possibly updated, copy of the image
17
	// should be pulled from a registry before the build proceeds.
18
	PullAlways
19
	// PullIfNewer is one of the values that BuilderOptions.PullPolicy
20
	// can take, signalling that the source image should only be pulled
21
	// from a registry if a local copy is not already present or if a
22
	// newer version the image is present on the repository.
23
	PullIfNewer
24
	// PullNever is one of the values that BuilderOptions.PullPolicy can
25
	// take, signalling that the source image should not be pulled from a
26
	// registry.
27
	PullNever
28
)
29

30
// String converts a PullPolicy into a string.
31
func (p PullPolicy) String() string {
32
	switch p {
33
	case PullIfMissing:
34
		return "missing"
35
	case PullAlways:
36
		return "always"
37
	case PullIfNewer:
38
		return "ifnewer"
39
	case PullNever:
40
		return "never"
41
	}
42
	return fmt.Sprintf("unrecognized policy %d", p)
43
}
44

45
var PolicyMap = map[string]PullPolicy{
46
	"missing": PullIfMissing,
47
	"always":  PullAlways,
48
	"never":   PullNever,
49
	"ifnewer": PullIfNewer,
50
}
51

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

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

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

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