47
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonannotations.go
generated
vendored
Normal file
47
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonannotations.go
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const commonAnnotationFieldSpecs = `
|
||||
commonAnnotations:
|
||||
- path: metadata/annotations
|
||||
create: true
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
version: v1
|
||||
kind: ReplicationController
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
create: true
|
||||
group: batch
|
||||
kind: Job
|
||||
|
||||
- path: spec/jobTemplate/metadata/annotations
|
||||
create: true
|
||||
group: batch
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/metadata/annotations
|
||||
create: true
|
||||
group: batch
|
||||
kind: CronJob
|
||||
|
||||
`
|
||||
159
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonlabels.go
generated
vendored
Normal file
159
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonlabels.go
generated
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const commonLabelFieldSpecs = `
|
||||
commonLabels:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
|
||||
- path: spec/selector
|
||||
create: true
|
||||
version: v1
|
||||
kind: Service
|
||||
|
||||
- path: spec/selector
|
||||
create: true
|
||||
version: v1
|
||||
kind: ReplicationController
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
version: v1
|
||||
kind: ReplicationController
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: true
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/affinity/podAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/affinity/podAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/affinity/podAntiAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/affinity/podAntiAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/topologySpreadConstraints/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: true
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: true
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: true
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/affinity/podAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/affinity/podAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/affinity/podAntiAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/affinity/podAntiAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/topologySpreadConstraints/labelSelector/matchLabels
|
||||
create: false
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/volumeClaimTemplates[]/metadata/labels
|
||||
create: true
|
||||
group: apps
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: false
|
||||
group: batch
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
group: batch
|
||||
kind: Job
|
||||
|
||||
- path: spec/jobTemplate/spec/selector/matchLabels
|
||||
create: false
|
||||
group: batch
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/metadata/labels
|
||||
create: true
|
||||
group: batch
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/metadata/labels
|
||||
create: true
|
||||
group: batch
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/selector/matchLabels
|
||||
create: false
|
||||
group: policy
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
- path: spec/podSelector/matchLabels
|
||||
create: false
|
||||
group: networking.k8s.io
|
||||
kind: NetworkPolicy
|
||||
|
||||
- path: spec/ingress/from/podSelector/matchLabels
|
||||
create: false
|
||||
group: networking.k8s.io
|
||||
kind: NetworkPolicy
|
||||
|
||||
- path: spec/egress/to/podSelector/matchLabels
|
||||
create: false
|
||||
group: networking.k8s.io
|
||||
kind: NetworkPolicy
|
||||
`
|
||||
38
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/defaultconfig.go
generated
vendored
Normal file
38
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/defaultconfig.go
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
// GetDefaultFieldSpecs returns default fieldSpecs.
|
||||
func GetDefaultFieldSpecs() []byte {
|
||||
configData := [][]byte{
|
||||
[]byte(namePrefixFieldSpecs),
|
||||
[]byte(commonLabelFieldSpecs),
|
||||
[]byte(commonAnnotationFieldSpecs),
|
||||
[]byte(namespaceFieldSpecs),
|
||||
[]byte(varReferenceFieldSpecs),
|
||||
[]byte(nameReferenceFieldSpecs),
|
||||
[]byte(imagesFieldSpecs),
|
||||
[]byte(replicasFieldSpecs),
|
||||
}
|
||||
return bytes.Join(configData, []byte("\n"))
|
||||
}
|
||||
|
||||
// GetDefaultFieldSpecsAsMap returns default fieldSpecs
|
||||
// as a string->string map.
|
||||
func GetDefaultFieldSpecsAsMap() map[string]string {
|
||||
result := make(map[string]string)
|
||||
result["nameprefix"] = namePrefixFieldSpecs
|
||||
result["commonlabels"] = commonLabelFieldSpecs
|
||||
result["commonannotations"] = commonAnnotationFieldSpecs
|
||||
result["namespace"] = namespaceFieldSpecs
|
||||
result["varreference"] = varReferenceFieldSpecs
|
||||
result["namereference"] = nameReferenceFieldSpecs
|
||||
result["images"] = imagesFieldSpecs
|
||||
result["replicas"] = replicasFieldSpecs
|
||||
return result
|
||||
}
|
||||
8
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/doc.go
generated
vendored
Normal file
8
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/doc.go
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package builtinpluginconsts provides builtin plugin
|
||||
// configuration data. Builtin plugins can also be
|
||||
// configured individually with plugin config files,
|
||||
// in which case the constants in this package are ignored.
|
||||
package builtinpluginconsts
|
||||
18
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/images.go
generated
vendored
Normal file
18
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/images.go
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const (
|
||||
imagesFieldSpecs = `
|
||||
images:
|
||||
- path: spec/containers[]/image
|
||||
create: true
|
||||
- path: spec/initContainers[]/image
|
||||
create: true
|
||||
- path: spec/template/spec/containers[]/image
|
||||
create: true
|
||||
- path: spec/template/spec/initContainers[]/image
|
||||
create: true
|
||||
`
|
||||
)
|
||||
11
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/nameprefix.go
generated
vendored
Normal file
11
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/nameprefix.go
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const (
|
||||
namePrefixFieldSpecs = `
|
||||
namePrefix:
|
||||
- path: metadata/name
|
||||
`
|
||||
)
|
||||
403
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namereference.go
generated
vendored
Normal file
403
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namereference.go
generated
vendored
Normal file
@@ -0,0 +1,403 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
// TODO: rename 'fieldSpecs' to 'referrers' for clarity.
|
||||
// This will, however, break anyone using a custom config.
|
||||
|
||||
const (
|
||||
nameReferenceFieldSpecs = `
|
||||
nameReference:
|
||||
- kind: Deployment
|
||||
fieldSpecs:
|
||||
- path: spec/scaleTargetRef/name
|
||||
kind: HorizontalPodAutoscaler
|
||||
|
||||
- kind: ReplicationController
|
||||
fieldSpecs:
|
||||
- path: spec/scaleTargetRef/name
|
||||
kind: HorizontalPodAutoscaler
|
||||
|
||||
- kind: ReplicaSet
|
||||
fieldSpecs:
|
||||
- path: spec/scaleTargetRef/name
|
||||
kind: HorizontalPodAutoscaler
|
||||
|
||||
- kind: StatefulSet
|
||||
fieldSpecs:
|
||||
- path: spec/scaleTargetRef/name
|
||||
kind: HorizontalPodAutoscaler
|
||||
|
||||
- kind: ConfigMap
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/volumes/configMap/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/containers/envFrom/configMapRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/initContainers/envFrom/configMapRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/volumes/projected/sources/configMap/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: template/spec/volumes/configMap/name
|
||||
kind: PodTemplate
|
||||
- path: spec/template/spec/volumes/configMap/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/volumes/configMap/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/volumes/configMap/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/volumes/configMap/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/volumes/configMap/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: Job
|
||||
- path: spec/jobTemplate/spec/template/spec/volumes/configMap/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/volumes/projected/sources/configMap/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/env/valueFrom/configMapKeyRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/envFrom/configMapRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/envFrom/configMapRef/name
|
||||
kind: CronJob
|
||||
- path: spec/configSource/configMap
|
||||
kind: Node
|
||||
- path: rules/resourceNames
|
||||
kind: Role
|
||||
- path: rules/resourceNames
|
||||
kind: ClusterRole
|
||||
- path: metadata/annotations/nginx.ingress.kubernetes.io\/fastcgi-params-configmap
|
||||
kind: Ingress
|
||||
|
||||
- kind: Secret
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/volumes/secret/secretName
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/containers/env/valueFrom/secretKeyRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/containers/envFrom/secretRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/initContainers/envFrom/secretRef/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/imagePullSecrets/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/volumes/projected/sources/secret/name
|
||||
version: v1
|
||||
kind: Pod
|
||||
- path: spec/template/spec/volumes/secret/secretName
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/imagePullSecrets/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/volumes/secret/secretName
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/imagePullSecrets/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: ReplicaSet
|
||||
- path: spec/template/spec/volumes/secret/secretName
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/imagePullSecrets/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: DaemonSet
|
||||
- path: spec/template/spec/volumes/secret/secretName
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/imagePullSecrets/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/volumes/secret/secretName
|
||||
kind: Job
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/imagePullSecrets/name
|
||||
kind: Job
|
||||
- path: spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: Job
|
||||
- path: spec/jobTemplate/spec/template/spec/volumes/secret/secretName
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/volumes/projected/sources/secret/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/envFrom/secretRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/envFrom/secretRef/name
|
||||
kind: CronJob
|
||||
- path: spec/jobTemplate/spec/template/spec/imagePullSecrets/name
|
||||
kind: CronJob
|
||||
- path: spec/tls/secretName
|
||||
kind: Ingress
|
||||
- path: metadata/annotations/ingress.kubernetes.io\/auth-secret
|
||||
kind: Ingress
|
||||
- path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-secret
|
||||
kind: Ingress
|
||||
- path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-tls-secret
|
||||
kind: Ingress
|
||||
- path: spec/tls/secretName
|
||||
kind: Ingress
|
||||
- path: imagePullSecrets/name
|
||||
kind: ServiceAccount
|
||||
- path: parameters/secretName
|
||||
kind: StorageClass
|
||||
- path: parameters/adminSecretName
|
||||
kind: StorageClass
|
||||
- path: parameters/userSecretName
|
||||
kind: StorageClass
|
||||
- path: parameters/secretRef
|
||||
kind: StorageClass
|
||||
- path: rules/resourceNames
|
||||
kind: Role
|
||||
- path: rules/resourceNames
|
||||
kind: ClusterRole
|
||||
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||
kind: Service
|
||||
group: serving.knative.dev
|
||||
version: v1
|
||||
- path: spec/azureFile/secretName
|
||||
kind: PersistentVolume
|
||||
|
||||
- kind: Service
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/serviceName
|
||||
kind: StatefulSet
|
||||
group: apps
|
||||
- path: spec/rules/http/paths/backend/serviceName
|
||||
kind: Ingress
|
||||
- path: spec/backend/serviceName
|
||||
kind: Ingress
|
||||
- path: spec/rules/http/paths/backend/service/name
|
||||
kind: Ingress
|
||||
- path: spec/defaultBackend/service/name
|
||||
kind: Ingress
|
||||
- path: spec/service/name
|
||||
kind: APIService
|
||||
group: apiregistration.k8s.io
|
||||
- path: webhooks/clientConfig/service
|
||||
kind: ValidatingWebhookConfiguration
|
||||
group: admissionregistration.k8s.io
|
||||
- path: webhooks/clientConfig/service
|
||||
kind: MutatingWebhookConfiguration
|
||||
group: admissionregistration.k8s.io
|
||||
|
||||
- kind: Role
|
||||
group: rbac.authorization.k8s.io
|
||||
fieldSpecs:
|
||||
- path: roleRef/name
|
||||
kind: RoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
|
||||
- kind: ClusterRole
|
||||
group: rbac.authorization.k8s.io
|
||||
fieldSpecs:
|
||||
- path: roleRef/name
|
||||
kind: RoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
- path: roleRef/name
|
||||
kind: ClusterRoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
|
||||
- kind: ServiceAccount
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: subjects
|
||||
kind: RoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
- path: subjects
|
||||
kind: ClusterRoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
- path: spec/serviceAccountName
|
||||
kind: Pod
|
||||
- path: spec/template/spec/serviceAccountName
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/serviceAccountName
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/serviceAccountName
|
||||
kind: ReplicationController
|
||||
- path: spec/jobTemplate/spec/template/spec/serviceAccountName
|
||||
kind: CronJob
|
||||
- path: spec/template/spec/serviceAccountName
|
||||
kind: Job
|
||||
- path: spec/template/spec/serviceAccountName
|
||||
kind: DaemonSet
|
||||
|
||||
- kind: PersistentVolumeClaim
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: Pod
|
||||
- path: spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: ReplicationController
|
||||
- path: spec/jobTemplate/spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: CronJob
|
||||
- path: spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: Job
|
||||
- path: spec/template/spec/volumes/persistentVolumeClaim/claimName
|
||||
kind: DaemonSet
|
||||
|
||||
- kind: PersistentVolume
|
||||
version: v1
|
||||
fieldSpecs:
|
||||
- path: spec/volumeName
|
||||
kind: PersistentVolumeClaim
|
||||
- path: rules/resourceNames
|
||||
kind: ClusterRole
|
||||
|
||||
- kind: StorageClass
|
||||
version: v1
|
||||
group: storage.k8s.io
|
||||
fieldSpecs:
|
||||
- path: spec/storageClassName
|
||||
kind: PersistentVolume
|
||||
- path: spec/storageClassName
|
||||
kind: PersistentVolumeClaim
|
||||
- path: spec/volumeClaimTemplates/spec/storageClassName
|
||||
kind: StatefulSet
|
||||
|
||||
- kind: PriorityClass
|
||||
version: v1
|
||||
group: scheduling.k8s.io
|
||||
fieldSpecs:
|
||||
- path: spec/priorityClassName
|
||||
kind: Pod
|
||||
- path: spec/template/spec/priorityClassName
|
||||
kind: StatefulSet
|
||||
- path: spec/template/spec/priorityClassName
|
||||
kind: Deployment
|
||||
- path: spec/template/spec/priorityClassName
|
||||
kind: ReplicationController
|
||||
- path: spec/jobTemplate/spec/template/spec/priorityClassName
|
||||
kind: CronJob
|
||||
- path: spec/template/spec/priorityClassName
|
||||
kind: Job
|
||||
- path: spec/template/spec/priorityClassName
|
||||
kind: DaemonSet
|
||||
|
||||
- kind: IngressClass
|
||||
version: v1
|
||||
group: networking.k8s.io/v1
|
||||
fieldSpecs:
|
||||
- path: spec/ingressClassName
|
||||
kind: Ingress
|
||||
`
|
||||
)
|
||||
26
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namespace.go
generated
vendored
Normal file
26
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namespace.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const (
|
||||
namespaceFieldSpecs = `
|
||||
namespace:
|
||||
- path: metadata/namespace
|
||||
create: true
|
||||
- path: metadata/name
|
||||
kind: Namespace
|
||||
create: true
|
||||
- path: subjects
|
||||
kind: RoleBinding
|
||||
- path: subjects
|
||||
kind: ClusterRoleBinding
|
||||
- path: spec/service/namespace
|
||||
group: apiregistration.k8s.io
|
||||
kind: APIService
|
||||
create: true
|
||||
- path: spec/conversion/webhook/clientConfig/service/namespace
|
||||
group: apiextensions.k8s.io
|
||||
kind: CustomResourceDefinition
|
||||
`
|
||||
)
|
||||
23
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/replicas.go
generated
vendored
Normal file
23
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/replicas.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const replicasFieldSpecs = `
|
||||
replicas:
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: ReplicationController
|
||||
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: StatefulSet
|
||||
`
|
||||
223
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/varreference.go
generated
vendored
Normal file
223
vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/varreference.go
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package builtinpluginconsts
|
||||
|
||||
const (
|
||||
varReferenceFieldSpecs = `
|
||||
varReference:
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/args
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/command
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/env/value
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/args
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/command
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/env/value
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/jobTemplate/spec/template/volumes/nfs/server
|
||||
kind: CronJob
|
||||
|
||||
- path: spec/template/spec/containers/args
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/containers/command
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/containers/env/value
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/initContainers/args
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/initContainers/command
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/initContainers/env/value
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/volumes/nfs/server
|
||||
kind: DaemonSet
|
||||
|
||||
- path: spec/template/spec/containers/args
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/containers/command
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/containers/env/value
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/initContainers/args
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/initContainers/command
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/initContainers/env/value
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/spec/volumes/nfs/server
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/template/metadata/annotations
|
||||
kind: Deployment
|
||||
|
||||
- path: spec/rules/host
|
||||
kind: Ingress
|
||||
|
||||
- path: spec/tls/hosts
|
||||
kind: Ingress
|
||||
|
||||
- path: spec/tls/secretName
|
||||
kind: Ingress
|
||||
|
||||
- path: spec/template/spec/containers/args
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/containers/command
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/containers/env/value
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/initContainers/args
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/initContainers/command
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/initContainers/env/value
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: Job
|
||||
|
||||
- path: spec/template/spec/volumes/nfs/server
|
||||
kind: Job
|
||||
|
||||
- path: spec/containers/args
|
||||
kind: Pod
|
||||
|
||||
- path: spec/containers/command
|
||||
kind: Pod
|
||||
|
||||
- path: spec/containers/env/value
|
||||
kind: Pod
|
||||
|
||||
- path: spec/containers/volumeMounts/mountPath
|
||||
kind: Pod
|
||||
|
||||
- path: spec/initContainers/args
|
||||
kind: Pod
|
||||
|
||||
- path: spec/initContainers/command
|
||||
kind: Pod
|
||||
|
||||
- path: spec/initContainers/env/value
|
||||
kind: Pod
|
||||
|
||||
- path: spec/initContainers/volumeMounts/mountPath
|
||||
kind: Pod
|
||||
|
||||
- path: spec/volumes/nfs/server
|
||||
kind: Pod
|
||||
|
||||
- path: spec/template/spec/containers/args
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/containers/command
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/containers/env/value
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/initContainers/args
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/initContainers/command
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/initContainers/env/value
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/template/spec/volumes/nfs/server
|
||||
kind: ReplicaSet
|
||||
|
||||
- path: spec/ports/port
|
||||
kind: Service
|
||||
|
||||
- path: spec/ports/targetPort
|
||||
kind: Service
|
||||
|
||||
- path: spec/template/spec/containers/args
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/containers/command
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/containers/env/value
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/containers/volumeMounts/mountPath
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/initContainers/args
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/initContainers/command
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/initContainers/env/value
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/template/spec/initContainers/volumeMounts/mountPath
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/volumeClaimTemplates/spec/nfs/server
|
||||
kind: StatefulSet
|
||||
|
||||
- path: spec/nfs/server
|
||||
kind: PersistentVolume
|
||||
|
||||
- path: metadata/labels
|
||||
|
||||
- path: metadata/annotations
|
||||
`
|
||||
)
|
||||
6
vendor/sigs.k8s.io/kustomize/api/konfig/doc.go
generated
vendored
Normal file
6
vendor/sigs.k8s.io/kustomize/api/konfig/doc.go
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package konfig provides configuration methods and constants
|
||||
// for the kustomize API.
|
||||
package konfig
|
||||
48
vendor/sigs.k8s.io/kustomize/api/konfig/general.go
generated
vendored
Normal file
48
vendor/sigs.k8s.io/kustomize/api/konfig/general.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package konfig
|
||||
|
||||
// RecognizedKustomizationFileNames is a list of file names
|
||||
// that kustomize recognizes.
|
||||
// To avoid ambiguity, a kustomization directory may not
|
||||
// contain more than one match to this list.
|
||||
func RecognizedKustomizationFileNames() []string {
|
||||
return []string{
|
||||
"kustomization.yaml",
|
||||
"kustomization.yml",
|
||||
"Kustomization",
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultKustomizationFileName() string {
|
||||
return RecognizedKustomizationFileNames()[0]
|
||||
}
|
||||
|
||||
const (
|
||||
// An environment variable to consult for kustomization
|
||||
// configuration data. See:
|
||||
// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
XdgConfigHomeEnv = "XDG_CONFIG_HOME"
|
||||
|
||||
// Use this when XdgConfigHomeEnv not defined.
|
||||
XdgConfigHomeEnvDefault = ".config"
|
||||
|
||||
// A program name, for use in help, finding the XDG_CONFIG_DIR, etc.
|
||||
ProgramName = "kustomize"
|
||||
|
||||
// ConfigAnnoDomain is configuration-related annotation namespace.
|
||||
ConfigAnnoDomain = "config.kubernetes.io"
|
||||
|
||||
// If a resource has this annotation, kustomize will drop it.
|
||||
IgnoredByKustomizeAnnotation = ConfigAnnoDomain + "/local-config"
|
||||
|
||||
// Label key that indicates the resources are built from Kustomize
|
||||
ManagedbyLabelKey = "app.kubernetes.io/managed-by"
|
||||
|
||||
// An environment variable to turn on/off adding the ManagedByLabelKey
|
||||
EnableManagedbyLabelEnv = "KUSTOMIZE_ENABLE_MANAGEDBY_LABEL"
|
||||
|
||||
// Label key that indicates the resources are validated by a validator
|
||||
ValidatedByLabelKey = "validated-by"
|
||||
)
|
||||
138
vendor/sigs.k8s.io/kustomize/api/konfig/plugins.go
generated
vendored
Normal file
138
vendor/sigs.k8s.io/kustomize/api/konfig/plugins.go
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package konfig
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/filesys"
|
||||
"sigs.k8s.io/kustomize/api/types"
|
||||
)
|
||||
|
||||
const (
|
||||
// Symbol that must be used inside Go plugins.
|
||||
PluginSymbol = "KustomizePlugin"
|
||||
|
||||
// Name of environment variable used to set AbsPluginHome.
|
||||
// See that variable for an explanation.
|
||||
KustomizePluginHomeEnv = "KUSTOMIZE_PLUGIN_HOME"
|
||||
|
||||
// Relative path below XDG_CONFIG_HOME/kustomize to find plugins.
|
||||
// e.g. AbsPluginHome = XDG_CONFIG_HOME/kustomize/plugin
|
||||
RelPluginHome = "plugin"
|
||||
|
||||
// Location of builtin plugins below AbsPluginHome.
|
||||
BuiltinPluginPackage = "builtin"
|
||||
|
||||
// The value of kubernetes ApiVersion to use in configuration
|
||||
// files for builtin plugins.
|
||||
// The value for non-builtins can be anything.
|
||||
BuiltinPluginApiVersion = BuiltinPluginPackage
|
||||
|
||||
// Domain from which kustomize code is imported, for locating
|
||||
// plugin source code under $GOPATH when GOPATH is defined.
|
||||
DomainName = "sigs.k8s.io"
|
||||
|
||||
// Injected into plugin paths when plugins are disabled.
|
||||
// Provides a clue in flows that shouldn't happen.
|
||||
NoPluginHomeSentinal = "/No/non-builtin/plugins!"
|
||||
)
|
||||
|
||||
type NotedFunc struct {
|
||||
Note string
|
||||
F func() string
|
||||
}
|
||||
|
||||
// DefaultAbsPluginHome returns the absolute path in the given file
|
||||
// system to first directory that looks like a good candidate for
|
||||
// the home of kustomize plugins.
|
||||
func DefaultAbsPluginHome(fSys filesys.FileSystem) (string, error) {
|
||||
return FirstDirThatExistsElseError(
|
||||
"plugin root", fSys, []NotedFunc{
|
||||
{
|
||||
Note: "homed in $" + KustomizePluginHomeEnv,
|
||||
F: func() string {
|
||||
return os.Getenv(KustomizePluginHomeEnv)
|
||||
},
|
||||
},
|
||||
{
|
||||
Note: "homed in $" + XdgConfigHomeEnv,
|
||||
F: func() string {
|
||||
if root := os.Getenv(XdgConfigHomeEnv); root != "" {
|
||||
return filepath.Join(root, ProgramName, RelPluginHome)
|
||||
}
|
||||
// do not look in "kustomize/plugin" if XdgConfigHomeEnv is unset
|
||||
return ""
|
||||
},
|
||||
},
|
||||
{
|
||||
Note: "homed in default value of $" + XdgConfigHomeEnv,
|
||||
F: func() string {
|
||||
return filepath.Join(
|
||||
HomeDir(), XdgConfigHomeEnvDefault,
|
||||
ProgramName, RelPluginHome)
|
||||
},
|
||||
},
|
||||
{
|
||||
Note: "homed in home directory",
|
||||
F: func() string {
|
||||
return filepath.Join(
|
||||
HomeDir(), ProgramName, RelPluginHome)
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// FirstDirThatExistsElseError tests different path functions for
|
||||
// existence, returning the first that works, else error if all fail.
|
||||
func FirstDirThatExistsElseError(
|
||||
what string,
|
||||
fSys filesys.FileSystem,
|
||||
pathFuncs []NotedFunc) (string, error) {
|
||||
var nope []types.Pair
|
||||
for _, dt := range pathFuncs {
|
||||
if dir := dt.F(); dir != "" {
|
||||
if fSys.Exists(dir) {
|
||||
return dir, nil
|
||||
}
|
||||
nope = append(nope, types.Pair{Key: dt.Note, Value: dir})
|
||||
} else {
|
||||
nope = append(nope, types.Pair{Key: dt.Note, Value: "<no value>"})
|
||||
}
|
||||
}
|
||||
return "", types.NewErrUnableToFind(what, nope)
|
||||
}
|
||||
|
||||
func HomeDir() string {
|
||||
home := os.Getenv(homeEnv())
|
||||
if len(home) > 0 {
|
||||
return home
|
||||
}
|
||||
return "~"
|
||||
}
|
||||
|
||||
func homeEnv() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return "USERPROFILE"
|
||||
}
|
||||
return "HOME"
|
||||
}
|
||||
|
||||
func CurrentWorkingDir() string {
|
||||
// Try for full path first to be explicit.
|
||||
pwd := os.Getenv(pwdEnv())
|
||||
if len(pwd) > 0 {
|
||||
return pwd
|
||||
}
|
||||
return filesys.SelfDir
|
||||
}
|
||||
|
||||
func pwdEnv() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return "CD"
|
||||
}
|
||||
return "PWD"
|
||||
}
|
||||
Reference in New Issue
Block a user