mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Merge pull request #373 from Liujingfang1/pathconfigmore
add default configurations for different transformers
This commit is contained in:
60
pkg/transformerconfig/defaultconfig/commonannotations.go
Normal file
60
pkg/transformerconfig/defaultconfig/commonannotations.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package defaultconfig
|
||||||
|
|
||||||
|
const commonAnnotationPathConfigs = `
|
||||||
|
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
|
||||||
|
|
||||||
|
`
|
||||||
152
pkg/transformerconfig/defaultconfig/commonlabels.go
Normal file
152
pkg/transformerconfig/defaultconfig/commonlabels.go
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package defaultconfig
|
||||||
|
|
||||||
|
const commonLabelPathConfigs = `
|
||||||
|
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/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/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/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
|
||||||
|
`
|
||||||
@@ -26,6 +26,11 @@ import (
|
|||||||
func GetDefaultPathConfigs() []byte {
|
func GetDefaultPathConfigs() []byte {
|
||||||
configData := [][]byte{
|
configData := [][]byte{
|
||||||
[]byte(namePrefixPathConfigs),
|
[]byte(namePrefixPathConfigs),
|
||||||
|
[]byte(commonLabelPathConfigs),
|
||||||
|
[]byte(commonAnnotationPathConfigs),
|
||||||
|
[]byte(namespacePathConfigs),
|
||||||
|
[]byte(varReferencePathConfigs),
|
||||||
|
[]byte(nameReferencePathConfigs),
|
||||||
}
|
}
|
||||||
return bytes.Join(configData, []byte(`\n`))
|
return bytes.Join(configData, []byte(`\n`))
|
||||||
}
|
}
|
||||||
|
|||||||
306
pkg/transformerconfig/defaultconfig/namereference.go
Normal file
306
pkg/transformerconfig/defaultconfig/namereference.go
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package defaultconfig
|
||||||
|
|
||||||
|
const (
|
||||||
|
nameReferencePathConfigs = `
|
||||||
|
nameReference:
|
||||||
|
- kind: Deployment
|
||||||
|
pathConfigs:
|
||||||
|
- path: spec/scaleTargetRef/name
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
|
||||||
|
- kind: ReplicationController
|
||||||
|
pathConfigs:
|
||||||
|
- path: spec/scaleTargetRef/name
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
|
||||||
|
- kind: ReplicaSet
|
||||||
|
pathConfigs:
|
||||||
|
- path: spec/scaleTargetRef/name
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
|
||||||
|
- kind: ConfigMap
|
||||||
|
version: v1
|
||||||
|
pathConfigs:
|
||||||
|
- 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/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/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/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/jobTemplate/spec/template/spec/volumes/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
|
||||||
|
|
||||||
|
- kind: Secret
|
||||||
|
version: v1
|
||||||
|
pathConfigs:
|
||||||
|
- 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/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/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/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/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/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/jobTemplate/spec/template/sepc/volumes/secret/secretName
|
||||||
|
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: imagePullSecrets/name
|
||||||
|
kind: ServiceAccount
|
||||||
|
- path: parameters/secretName
|
||||||
|
kind: StorageClass
|
||||||
|
- path: parameters/adminSecretName
|
||||||
|
kind: StorageClass
|
||||||
|
- path: parameters/userSecretName
|
||||||
|
kind: StorageClass
|
||||||
|
- path: parameters/secretRef
|
||||||
|
kind: StorageClass
|
||||||
|
|
||||||
|
- kind: Service
|
||||||
|
version: v1
|
||||||
|
pathConfigs:
|
||||||
|
- path: spec/serviceName
|
||||||
|
kind: StatefulSet
|
||||||
|
group: apps
|
||||||
|
- path: spec/rules/http/paths/backend/serviceName
|
||||||
|
kind: Ingress
|
||||||
|
- path: spec/backend/serviceName
|
||||||
|
kind: Ingress
|
||||||
|
|
||||||
|
- kind: Role
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
pathConfigs:
|
||||||
|
- path: roleRef/name
|
||||||
|
kind: RoleBinding
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
|
||||||
|
- kind: ClusterRole
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
pathConfigs:
|
||||||
|
- path: roleRef/name
|
||||||
|
kind: RoleBinding
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
- path: roleRef/name
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
|
||||||
|
- kind: ServiceAccount
|
||||||
|
version: v1
|
||||||
|
pathConfigs:
|
||||||
|
- path: subjects/name
|
||||||
|
kind: RoleBinding
|
||||||
|
group: rbac.authorization.k8s.io
|
||||||
|
- path: subjects/name
|
||||||
|
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
|
||||||
|
pathConfigs:
|
||||||
|
- 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
|
||||||
|
pathConfigs:
|
||||||
|
- path: spec/volumeName
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
`
|
||||||
|
)
|
||||||
24
pkg/transformerconfig/defaultconfig/namespace.go
Normal file
24
pkg/transformerconfig/defaultconfig/namespace.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package defaultconfig
|
||||||
|
|
||||||
|
const (
|
||||||
|
namespacePathConfigs = `
|
||||||
|
namespace:
|
||||||
|
- path: metadata/namespace
|
||||||
|
`
|
||||||
|
)
|
||||||
85
pkg/transformerconfig/defaultconfig/varreference.go
Normal file
85
pkg/transformerconfig/defaultconfig/varreference.go
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package defaultconfig
|
||||||
|
|
||||||
|
const (
|
||||||
|
varReferencePathConfigs = `
|
||||||
|
varReference:
|
||||||
|
- path: spec/template/spec/initContainers/command
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/command
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/initContainers/command
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/command
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/command
|
||||||
|
kind: Job
|
||||||
|
|
||||||
|
- path: spec/jobTemplate/spec/template/spec/containers/command
|
||||||
|
kind: CronJob
|
||||||
|
|
||||||
|
- path: spec/template/spec/initContainers/args
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/args
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/initContainers/args
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/args
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/args
|
||||||
|
kind: Job
|
||||||
|
|
||||||
|
- path: spec/jobTemplate/spec/template/spec/containers/args
|
||||||
|
kind: CronJob
|
||||||
|
|
||||||
|
- path: spec/template/spec/initContainers/env/value
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/env/value
|
||||||
|
kind: StatefulSet
|
||||||
|
|
||||||
|
- path: spec/template/spec/initContainers/env/value
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/env/value
|
||||||
|
kind: Deployment
|
||||||
|
|
||||||
|
- path: spec/template/spec/containers/env/value
|
||||||
|
kind: Job
|
||||||
|
|
||||||
|
- path: spec/jobTemplate/spec/template/spec/containers/env/value
|
||||||
|
kind: CronJob
|
||||||
|
|
||||||
|
- path: spec/containers/command
|
||||||
|
kind: Pod
|
||||||
|
|
||||||
|
- path: spec/containers/args
|
||||||
|
kind: Pod
|
||||||
|
|
||||||
|
- path: spec/containers/env/value
|
||||||
|
kind: Pod
|
||||||
|
`
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user