func (p *PullPolicy) Type() string {
	return "string"
}
Type implements the Type() function of pflags.Value interface
package source2image
import (
	"fmt"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type RunState string
const (
	ResourceKindS2iBuilder = "S2iBuilder"
	ResourceSingularS2iBuilder = "s2ibuilder"
	ResourcePluralS2iBuilder = "s2ibuilders"
)
const (
	NotRunning RunState = "Not Running Yet"
	Running RunState = "Running"
	Successful RunState = "Successful"
	Failed RunState = "Failed"
	Unknown RunState = "Unknown"
)
const (
	AutoScaleAnnotations             = "devops.kubesphere.io/autoscale"
	S2iRunLabel                      = "devops.kubesphere.io/s2ir"
	S2irCompletedScaleAnnotations    = "devops.kubesphere.io/completedscale"
	WorkLoadCompletedInitAnnotations = "devops.kubesphere.io/inithasbeencomplted"
	S2iRunDoNotAutoScaleAnnotations  = "devops.kubesphere.io/donotautoscale"
	DescriptionAnnotations           = "desc"
)
const (
	KindDeployment  = "Deployment"
	KindStatefulSet = "StatefulSet"
)
type EnvironmentSpec struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}
type ProxyConfig struct {
	HTTPProxy  string `json:"httpProxy,omitempty"`
	HTTPSProxy string `json:"httpsProxy,omitempty"`
}
type CGroupLimits struct {
	MemoryLimitBytes int64  `json:"memoryLimitBytes"`
	CPUShares        int64  `json:"cpuShares"`
	CPUPeriod        int64  `json:"cpuPeriod"`
	CPUQuota         int64  `json:"cpuQuota"`
	MemorySwap       int64  `json:"memorySwap"`
	Parent           string `json:"parent"`
}
type VolumeSpec struct {
	Source string `json:"source,omitempty"`
	Destination string `json:"destination,omitempty"`
	Keep bool `json:"keep,omitempty"`
}
type DockerConfig struct {
	Endpoint string `json:"endPoint"`
	CertFile string `json:"certFile"`
	KeyFile string `json:"keyFile"`
	CAFile string `json:"caFile"`
	UseTLS bool `json:"useTLS"`
	TLSVerify bool `json:"tlsVerify"`
}
type AuthConfig struct {
	Username      string                       `json:"username,omitempty"`
	Password      string                       `json:"password,omitempty"`
	Email         string                       `json:"email,omitempty"`
	ServerAddress string                       `json:"serverAddress,omitempty"`
	SecretRef     *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}
type ContainerConfig struct {
	Labels map[string]string
	Env    []string
}
type PullPolicy string
const (
	PullAlways PullPolicy = "always"
	PullNever PullPolicy = "never"
	PullIfNotPresent PullPolicy = "if-not-present"
	DefaultBuilderPullPolicy = PullIfNotPresent
	DefaultRuntimeImagePullPolicy = PullIfNotPresent
	DefaultPreviousImagePullPolicy = PullIfNotPresent
)
type DockerNetworkMode string
const (
	DockerNetworkModeHost DockerNetworkMode = "host"
	DockerNetworkModeBridge DockerNetworkMode = "bridge"
	DockerNetworkModeContainerPrefix string = "container:"
	DockerNetworkModeNetworkNamespacePrefix string = "netns:"
)
type TriggerSource string
const (
	Default TriggerSource = "Manual"
	Github  TriggerSource = "Github"
	Gitlab  TriggerSource = "Gitlab"
	SVN     TriggerSource = "SVN"
	Others  TriggerSource = "Others"
)
func NewDockerNetworkModeContainer(id string) DockerNetworkMode {
	return DockerNetworkMode(DockerNetworkModeContainerPrefix + id)
}
func (p *PullPolicy) String() string {
	if len(string(*p)) == 0 {
		return string(DefaultBuilderPullPolicy)
	}
	return string(*p)
}