github.com/GoogleContainerTools/skaffold@v1.39.18/pkg/skaffold/constants/constants.go (about) 1 /* 2 Copyright 2019 The Skaffold Authors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package constants 18 19 import ( 20 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" 21 ) 22 23 const ( 24 // These are phases in Skaffold 25 DevLoop = Phase("DevLoop") 26 Init = Phase("Init") 27 Build = Phase("Build") 28 Test = Phase("Test") 29 Render = Phase("Render") 30 Deploy = Phase("Deploy") 31 StatusCheck = Phase("StatusCheck") 32 PortForward = Phase("PortForward") 33 Sync = Phase("Sync") 34 DevInit = Phase("DevInit") 35 Cleanup = Phase("Cleanup") 36 37 // DefaultDockerfilePath is the dockerfile path is given relative to the 38 // context directory 39 DefaultDockerfilePath = "Dockerfile" 40 41 DefaultMinikubeContext = "minikube" 42 DefaultDockerForDesktopContext = "docker-for-desktop" 43 DefaultDockerDesktopContext = "docker-desktop" 44 GCSBucketSuffix = "_cloudbuild" 45 46 HelmOverridesFilename = "skaffold-overrides.yaml" 47 48 DefaultKustomizationPath = "." 49 50 DefaultBusyboxImage = "gcr.io/k8s-skaffold/skaffold-helpers/busybox" 51 52 // DefaultDebugHelpersRegistry is the default location used for the helper images for `debug`. 53 DefaultDebugHelpersRegistry = "gcr.io/k8s-skaffold/skaffold-debug-support" 54 55 DefaultSkaffoldDir = ".skaffold" 56 DefaultCacheFile = "cache" 57 DefaultMetricFile = "metrics" 58 59 DefaultPortForwardAddress = "127.0.0.1" 60 61 DefaultProjectDescriptor = "project.toml" 62 63 LeeroyAppResponse = "leeroooooy app!!\n" 64 65 GithubIssueLink = "https://github.com/GoogleContainerTools/skaffold/issues/new" 66 67 Windows = "windows" 68 69 // HaTS is the HaTS Survey ID 70 HaTS = "hats" 71 72 // SubtaskIDNone is the value used for Event API messages when there is no 73 // corresponding subtask 74 SubtaskIDNone = "-1" 75 ) 76 77 type Phase string 78 79 var ( 80 Pod latest.ResourceType = "pod" 81 Service latest.ResourceType = "service" 82 83 DefaultLocalConcurrency = 1 84 ) 85 86 var ( 87 // Image is an environment variable key, whose value is the fully qualified image name passed in to a custom build script. 88 Image = "IMAGE" 89 90 // PushImage lets the custom build script know if the image is expected to be pushed to a remote registry 91 PushImage = "PUSH_IMAGE" 92 93 // BuildContext is the absolute path to a directory this artifact is meant to be built from for custom artifacts 94 BuildContext = "BUILD_CONTEXT" 95 96 // SkipTest is Whether to skip the tests after building passing into a custom build script 97 SkipTest = "SKIP_TEST" 98 99 // Platforms is the set of platforms to build the image for. 100 Platforms = "PLATFORMS" 101 102 // KubeContext is the expected kubecontext to build an artifact with a custom build script on cluster 103 KubeContext = "KUBE_CONTEXT" 104 105 // Namespace is the expected namespace to build an artifact with a custom build script on cluster. 106 Namespace = "NAMESPACE" 107 108 // PullSecretName is the secret with authentication required to pull a base image/push the final image built on cluster. 109 PullSecretName = "PULL_SECRET_NAME" 110 111 // DockerConfigSecretName is the secret containing any required docker authentication for custom builds on cluster. 112 DockerConfigSecretName = "DOCKER_CONFIG_SECRET_NAME" 113 114 // Timeout is the amount of time an on cluster build is allowed to run. 115 Timeout = "TIMEOUT" 116 117 AllowedUsers = map[string]struct{}{ 118 "vsc": {}, 119 "intellij": {}, 120 "gcloud": {}, 121 "cloud-deploy": {}, 122 } 123 124 AllowedUserPattern = `^%v(\/.+)?$` 125 ) 126 127 var ImageRef = struct { 128 Repo string 129 Tag string 130 Digest string 131 }{ 132 Repo: "IMAGE_REPO", 133 Tag: "IMAGE_TAG", 134 Digest: "IMAGE_DIGEST", 135 } 136 var DefaultKubectlManifests = []string{"k8s/*.yaml"} 137 138 var Labels = struct { 139 TagPolicy string 140 Deployer string 141 Builder string 142 DockerAPIVersion string 143 }{ 144 TagPolicy: "skaffold.dev/tag-policy", 145 Deployer: "skaffold.dev/deployer", 146 Builder: "skaffold.dev/builder", 147 DockerAPIVersion: "skaffold.dev/docker-api-version", 148 }