Skip to content
Snippets Groups Projects
Unverified Commit c5dd1a77 authored by Jess's avatar Jess Committed by GitHub
Browse files

Merge pull request #126 from hausdorff/beta.3

Transition system templates to beta.3
parents 57079c8e 4275521f
No related branches found
No related tags found
No related merge requests found
......@@ -11,33 +11,13 @@ var defaultPrototypes = []*SpecificationSchema{
Description: `A simple namespace. Labels are automatically populated from the name of the
namespace.`,
ShortDescription: `Namespace with labels automatically populated from the name`,
YAMLBody: []string{
"kind: Namespace",
"apiVersion: v1",
"metadata:",
" name: ${name}",
" labels:",
" name: ${name}",
},
JSONBody: []string{
`{`,
` "kind": "Namespace",`,
` "apiVersion": "v1",`,
` "metadata": {`,
` "name": ${name},`,
` "labels": {`,
` "name": ${name}`,
` }`,
` }`,
`}`,
},
JsonnetBody: []string{
`local k = import "k.libsonnet";`,
`local ns = k.core.v1.namespace;`,
`local namespace = k.core.v1.namespace;`,
``,
`ns.new() +`,
`ns.mixin.metadata.name(import 'param://name') +`,
`ns.mixin.metadata.labels({name: import 'param://name'})`,
`namespace`,
` .new(import 'param://name')`,
` .withLabels({name: import 'param://name'})`,
},
},
},
......@@ -60,51 +40,17 @@ will typically look something like:
ks prototype use service --targetLabelSelector "{app: 'nginx'}" [...]`,
ShortDescription: `Service that exposes a single port`,
YAMLBody: []string{
`kind: Service`,
`apiVersion: v1`,
`metadata:`,
` name: ${name}`,
`spec:`,
` selector:`,
` ${targetLabelSelector}`,
` type: ${type}`,
` ports:`,
` - protocol: ${protocol}`,
` port: ${servicePort}`,
` targetPort: ${targetPort}`,
},
JSONBody: []string{
`{`,
` "kind": "Service",`,
` "apiVersion": "v1",`,
` "metadata": {`,
` "name": ${name}`,
` },`,
` "spec": {`,
` "selector":`,
` ${targetLabelSelector},`,
` "type": ${type},`,
` "ports": [`,
` {`,
` "protocol": ${protocol},`,
` "port": ${servicePort},`,
` "targetPort": ${targetPort}`,
` }`,
` ]`,
` }`,
`}`,
},
JsonnetBody: []string{
`local k = import "k.libsonnet";`,
`local service = k.core.v1.service;`,
`local port = k.core.v1.service.mixin.spec.portsType;`,
``,
`service.new(`,
` import 'param://name',`,
` import 'param://targetLabelSelector',`,
` port.new(import 'param://servicePort', import 'param://targetPort')) +`,
`service.mixin.spec.type(import 'param://type')`,
`service`,
` .new(`,
` import 'param://name',`,
` import 'param://targetLabelSelector',`,
` port.new(import 'param://servicePort', import 'param://targetPort'))`,
` .withType(import 'param://type')`,
},
},
},
......@@ -123,95 +69,6 @@ will typically look something like:
Description: `A service that exposes 'servicePort', and directs traffic
to 'targetLabelSelector', at 'targetPort'.`,
ShortDescription: `A deployment exposed with a service`,
YAMLBody: []string{
`apiVersion: v1`,
`items:`,
` - apiVersion: v1`,
` kind: Service`,
` metadata:`,
` name: ${name}`,
` spec:`,
` ports:`,
` - port: ${servicePort}`,
` targetPort: ${containerPort}`,
` selector:`,
` app: ${name}`,
` type: ${type}`,
` - apiVersion: apps/v1beta1`,
` kind: Deployment`,
` metadata:`,
` name: ${name}`,
` spec:`,
` replicas: ${replicas}`,
` template:`,
` metadata:`,
` labels:`,
` app: ${name}`,
` spec:`,
` containers:`,
` - image: ${name}`,
` name: ${image}`,
` ports:`,
` - containerPort: ${containerPort}`,
`kind: List`,
},
JSONBody: []string{
`{`,
` "apiVersion": "v1",`,
` "items": [`,
` {`,
` "apiVersion": "v1",`,
` "kind": "Service",`,
` "metadata": {`,
` "name": ${name}`,
` },`,
` "spec": {`,
` "ports": [`,
` {`,
` "port": ${servicePort},`,
` "targetPort": ${containerPort}`,
` }`,
` ],`,
` "selector": {`,
` "app": ${name}`,
` },`,
` "type": ${type}`,
` }`,
` },`,
` {`,
` "apiVersion": "apps/v1beta1",`,
` "kind": "Deployment",`,
` "metadata": {`,
` "name": ${name}`,
` },`,
` "spec": {`,
` "replicas": ${replicas},`,
` "template": {`,
` "metadata": {`,
` "labels": {`,
` "app": ${name}`,
` }`,
` },`,
` "spec": {`,
` "containers": [`,
` {`,
` "image": ${name},`,
` "name": ${image},`,
` "ports": [`,
` {`,
` "containerPort": ${containerPort}`,
` }`,
` ]`,
` }`,
` ]`,
` }`,
` }`,
` }`,
` }`,
` ],`,
` "kind": "List"`,
`}`,
},
JsonnetBody: []string{
`local k = import "k.libsonnet";`,
`local deployment = k.apps.v1beta1.deployment;`,
......@@ -223,18 +80,21 @@ to 'targetLabelSelector', at 'targetPort'.`,
`local targetPort = import 'param://containerPort';`,
`local labels = {app: import 'param://name'};`,
``,
`local appService = service.new(`,
` import 'param://name',`,
` labels,`,
` servicePort.new(import 'param://servicePort', targetPort)) +`,
`service.mixin.spec.type(import 'param://type');`,
`local appService = service`,
` .new(`,
` import 'param://name',`,
` labels,`,
` servicePort.new(import 'param://servicePort', targetPort))`,
` .withType(import 'param://type');`,
``,
`local appDeployment = deployment.new(`,
` import 'param://name',`,
` import 'param://replicas',`,
` container.new(import 'param://name', import 'param://image') +`,
` container.ports(containerPort.new(targetPort)),`,
` labels);`,
`local appDeployment = deployment`,
` .new(`,
` import 'param://name',`,
` import 'param://replicas',`,
` container`,
` .new(import 'param://name', import 'param://image')`,
` .withPorts(containerPort.new(targetPort)),`,
` labels);`,
``,
`k.core.v1.list.new([appService, appDeployment])`,
},
......@@ -250,30 +110,11 @@ to 'targetLabelSelector', at 'targetPort'.`,
Template: SnippetSchema{
Description: `A simple config map with optional user-specified data.`,
ShortDescription: `A simple config map with optional user-specified data`,
YAMLBody: []string{
"apiVersion: v1",
"kind: ConfigMap",
"metadata:",
" name: ${name}",
"data: ${data}",
},
JSONBody: []string{
`{`,
` "apiVersion": "v1",`,
` "kind": "ConfigMap",`,
` "metadata": {`,
` "name": ${name}`,
` },`,
` "data": ${data}`,
`}`,
},
JsonnetBody: []string{
`local k = import "k.libsonnet";`,
`local configMap = k.core.v1.configMap;`,
``,
`configMap.new() +`,
`configMap.mixin.metadata.name(import 'param://name') +`,
`configMap.data(import 'param://data')`,
`configMap.new(import 'param://name', import 'param://data')`,
},
},
},
......@@ -291,56 +132,6 @@ to 'targetLabelSelector', at 'targetPort'.`,
(default: 1), and exposes a port (default: 80). Labels are automatically
populated from 'name'.`,
ShortDescription: `Replicates a container n times, exposes a single port`,
YAMLBody: []string{
"apiVersion: apps/v1beta1",
"kind: Deployment",
"metadata:",
" name: ${name}",
"spec:",
" replicas: ${replicas:1}",
" template:",
" metadata:",
" labels:",
" app: ${name}",
" spec:",
" containers:",
" - name: ${name}",
" image: ${image}",
" ports:",
" - containerPort: ${port:80}",
},
JSONBody: []string{
`{`,
` "apiVersion": "apps/v1beta1",`,
` "kind": "Deployment",`,
` "metadata": {`,
` "name": ${name}`,
` },`,
` "spec": {`,
` "replicas": ${replicas:1},`,
` "template": {`,
` "metadata": {`,
` "labels": {`,
` "app": ${name}`,
` }`,
` },`,
` "spec": {`,
` "containers": [`,
` {`,
` "name": ${name},`,
` "image": ${image},`,
` "ports": [`,
` {`,
` "containerPort": ${port:80}`,
` }`,
` ]`,
` }`,
` ]`,
` }`,
` }`,
` }`,
`}`,
},
JsonnetBody: []string{
`local k = import "k.libsonnet";`,
`local deployment = k.apps.v1beta1.deployment;`,
......@@ -350,8 +141,9 @@ populated from 'name'.`,
`deployment.new(`,
` import 'param://name',`,
` import 'param://replicas',`,
` container.new(import 'param://name', import 'param://image') +`,
` container.ports(port.new(import 'param://port')),`,
` container`,
` .new(import 'param://name', import 'param://image')`,
` .withPorts(port.new(import 'param://port')),`,
` {app: import 'param://name'})`,
},
},
......
......@@ -35,6 +35,14 @@ type FuncParam string
// Kubernetes version. For example, `fooAPI` becomes `fooApi`.
type Identifier string
func (id Identifier) ToSetterID() Identifier {
return Identifier("with" + strings.Title(string(id)))
}
func (id Identifier) ToMixinID() Identifier {
return Identifier("with" + strings.Title(string(id)) + "Mixin")
}
// RewriteAsFieldKey takes a `PropertyName` and converts it to a valid
// Jsonnet field name. For example, if the `PropertyName` has a value
// of `"error"`, then this would generate an invalid object, `{error:
......
......@@ -601,8 +601,10 @@ func (ao *apiObject) emitConstructor(
"Attempted to create constructor, but property '%s' does not exist",
param.ID)
}
k8sVersion := ao.root().spec.Info.Version
propMethodName := jsonnet.RewriteAsIdentifier(k8sVersion, prop.name).ToSetterID()
setters = append(
setters, fmt.Sprintf("self.%s(%s)", prop.name, param.ID))
setters, fmt.Sprintf("self.%s(%s)", propMethodName, param.ID))
} else {
// TODO(hausdorff): We may want to verify this relative path
// exists.
......@@ -788,10 +790,12 @@ func (p *property) emitHelper(
p.comments.emit(m)
k8sVersion := p.root().spec.Info.Version
functionName := jsonnet.RewriteAsIdentifier(k8sVersion, p.name)
setterFunctionName := jsonnet.RewriteAsIdentifier(k8sVersion, p.name).ToSetterID()
mixinFunctionName := jsonnet.RewriteAsIdentifier(k8sVersion, p.name).ToMixinID()
paramName := jsonnet.RewriteAsFuncParam(k8sVersion, p.name)
fieldName := jsonnet.RewriteAsFieldKey(p.name)
signature := fmt.Sprintf("%s(%s)::", functionName, paramName)
setterSignature := fmt.Sprintf("%s(%s)::", setterFunctionName, paramName)
mixinSignature := fmt.Sprintf("%s(%s)::", mixinFunctionName, paramName)
if isMixinRef(p.ref) {
parsedRefPath := p.ref.Name().Parse()
......@@ -804,21 +808,41 @@ func (p *property) emitHelper(
} else {
body = fmt.Sprintf("%s({%s: %s})", *parentMixinName, fieldName, paramName)
}
line := fmt.Sprintf("%s %s,", signature, body)
line := fmt.Sprintf("%s %s,", setterSignature, body)
m.writeLine(line)
} else if p.schemaType != nil {
paramType := *p.schemaType
var body string
//
// Generate both setter and mixin functions for some property. For
// example, we emit both `metadata.setAnnotations({foo: "bar"})`
// (which replaces a set of annotations with given object) and
// `metadata.mixinAnnotations({foo: "bar"})` (which replaces only
// the `foo` key, if it exists.)
//
var setterBody string
var mixinBody string
emitMixin := false
switch paramType {
case "array":
emitMixin = true
if parentMixinName == nil {
body = fmt.Sprintf(
setterBody = fmt.Sprintf(
"if std.type(%s) == \"array\" then {%s: %s} else {%s: [%s]}",
paramName, fieldName, paramName, fieldName, paramName,
)
mixinBody = fmt.Sprintf(
"if std.type(%s) == \"array\" then {%s+: %s} else {%s+: [%s]}",
paramName, fieldName, paramName, fieldName, paramName,
)
} else {
body = fmt.Sprintf(
setterBody = fmt.Sprintf(
"if std.type(%s) == \"array\" then %s({%s: %s}) else %s({%s: [%s]})",
paramName, *parentMixinName, fieldName, paramName, *parentMixinName,
fieldName, paramName,
)
mixinBody = fmt.Sprintf(
"if std.type(%s) == \"array\" then %s({%s+: %s}) else %s({%s+: [%s]})",
paramName, *parentMixinName, fieldName, paramName, *parentMixinName,
fieldName, paramName,
......@@ -826,22 +850,35 @@ func (p *property) emitHelper(
}
case "integer", "string", "boolean":
if parentMixinName == nil {
body = fmt.Sprintf("{%s: %s}", fieldName, paramName)
setterBody = fmt.Sprintf("{%s: %s}", fieldName, paramName)
} else {
body = fmt.Sprintf("%s({%s: %s})", *parentMixinName, fieldName, paramName)
setterBody = fmt.Sprintf("%s({%s: %s})", *parentMixinName, fieldName, paramName)
}
case "object":
emitMixin = true
if parentMixinName == nil {
body = fmt.Sprintf("{%s+: %s}", fieldName, paramName)
setterBody = fmt.Sprintf("{%s: %s}", fieldName, paramName)
mixinBody = fmt.Sprintf("{%s+: %s}", fieldName, paramName)
} else {
body = fmt.Sprintf("%s({%s+: %s})", *parentMixinName, fieldName, paramName)
setterBody = fmt.Sprintf("%s({%s: %s})", *parentMixinName, fieldName, paramName)
mixinBody = fmt.Sprintf("%s({%s+: %s})", *parentMixinName, fieldName, paramName)
}
default:
log.Panicf("Unrecognized type '%s'", paramType)
}
line := fmt.Sprintf("%s %s,", signature, body)
//
// Emit.
//
line := fmt.Sprintf("%s self + %s,", setterSignature, setterBody)
m.writeLine(line)
if emitMixin {
p.comments.emit(m)
line = fmt.Sprintf("%s self + %s,", mixinSignature, mixinBody)
m.writeLine(line)
}
} else {
log.Panicf("Neither a type nor a ref")
}
......
......@@ -72,6 +72,74 @@ var versions = map[string]versionData{
"local": "localStorage",
},
constructorSpecs: map[string][]CustomConstructorSpec{
//
// Apps namespace.
//
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment": v1beta1Deployment,
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.DeploymentList": objectList,
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.DeploymentRollback": v1beta1DeploymentRollback,
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.Scale": v1beta1Scale,
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSet": v1beta1StatefulSet,
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSetList": objectList,
//
// Extensions namespace.
//
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Deployment": v1beta1Deployment,
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentList": objectList,
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentRollback": v1beta1DeploymentRollback,
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Scale": v1beta1Scale,
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.StatefulSet": v1beta1StatefulSet,
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.StatefulSetList": objectList,
//
// Authentication namespace.
//
"io.k8s.kubernetes.pkg.apis.authentication.v1.TokenReview": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("token", "mixin.spec.withToken")),
},
"io.k8s.kubernetes.pkg.apis.authentication.v1beta1.TokenReview": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("token", "mixin.spec.withToken")),
},
//
// Autoscaling namespace.
//
"io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscalerList": objectList,
"io.k8s.kubernetes.pkg.apis.autoscaling.v1.Scale": v1beta1Scale,
"io.k8s.kubernetes.pkg.apis.autoscaling.v2alpha1.HorizontalPodAutoscalerList": objectList,
//
// Batch namespace.
//
"io.k8s.kubernetes.pkg.apis.batch.v1.JobList": objectList,
"io.k8s.kubernetes.pkg.apis.batch.v2alpha1.CronJobList": objectList,
//
// Certificates namespace.
//
"io.k8s.kubernetes.pkg.apis.certificates.v1beta1.CertificateSigningRequestList": objectList,
//
// Core namespace.
//
"io.k8s.kubernetes.pkg.api.v1.ConfigMap": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName"),
newParam("data")),
},
"io.k8s.kubernetes.pkg.api.v1.ConfigMapList": objectList,
"io.k8s.kubernetes.pkg.api.v1.Container": []CustomConstructorSpec{
newConstructor("new", newParam("name"), newParam("image")),
},
......@@ -79,28 +147,64 @@ var versions = map[string]versionData{
newConstructor("new", newParam("containerPort")),
newConstructor("newNamed", newParam("name"), newParam("containerPort")),
},
"io.k8s.kubernetes.pkg.api.v1.EndpointsList": objectList,
"io.k8s.kubernetes.pkg.api.v1.EnvVar": []CustomConstructorSpec{
newConstructor("new", newParam("name"), newParam("value")),
newConstructor(
"fromSecretRef",
newParam("name"),
newParamNestedRef("secretRefName", "mixin.valueFrom.secretKeyRef.name"),
newParamNestedRef("secretRefKey", "mixin.valueFrom.secretKeyRef.key")),
newParamNestedRef("secretRefName", "mixin.valueFrom.secretKeyRef.withName"),
newParamNestedRef("secretRefKey", "mixin.valueFrom.secretKeyRef.withKey")),
newConstructor(
"fromFieldPath",
newParam("name"),
newParamNestedRef("fieldPath", "mixin.valueFrom.fieldRef.fieldPath")),
newParamNestedRef("fieldPath", "mixin.valueFrom.fieldRef.withFieldPath")),
},
"io.k8s.kubernetes.pkg.api.v1.EventList": objectList,
"io.k8s.kubernetes.pkg.api.v1.KeyToPath": []CustomConstructorSpec{
newConstructor("new", newParam("key"), newParam("path")),
},
"io.k8s.kubernetes.pkg.api.v1.LimitRangeList": objectList,
"io.k8s.kubernetes.pkg.api.v1.Namespace": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName")),
},
"io.k8s.kubernetes.pkg.api.v1.NamespaceList": objectList,
"io.k8s.kubernetes.pkg.api.v1.NodeList": objectList,
"io.k8s.kubernetes.pkg.api.v1.PersistentVolumeClaimList": objectList,
"io.k8s.kubernetes.pkg.api.v1.PersistentVolumeList": objectList,
"io.k8s.kubernetes.pkg.api.v1.PodList": objectList,
"io.k8s.kubernetes.pkg.api.v1.PodTemplateList": objectList,
"io.k8s.kubernetes.pkg.api.v1.ReplicationControllerList": objectList,
"io.k8s.kubernetes.pkg.api.v1.ResourceQuotaList": objectList,
"io.k8s.kubernetes.pkg.api.v1.Secret": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName"),
newParam("data"),
newParamWithDefault("type", "\"Opaque\"")),
newConstructor(
"fromString",
newParamNestedRef("name", "mixin.metadata.withName"),
newParam("stringData"),
newParamWithDefault("type", "\"Opaque\"")),
},
"io.k8s.kubernetes.pkg.api.v1.SecretList": objectList,
"io.k8s.kubernetes.pkg.api.v1.Service": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.name"),
newParamNestedRef("selector", "mixin.spec.selector"),
newParamNestedRef("ports", "mixin.spec.ports")),
newParamNestedRef("name", "mixin.metadata.withName"),
newParamNestedRef("selector", "mixin.spec.withSelector"),
newParamNestedRef("ports", "mixin.spec.withPorts")),
},
"io.k8s.kubernetes.pkg.api.v1.ServiceAccount": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName")),
},
"io.k8s.kubernetes.pkg.api.v1.ServiceAccountList": objectList,
"io.k8s.kubernetes.pkg.api.v1.ServiceList": objectList,
"io.k8s.kubernetes.pkg.api.v1.ServicePort": []CustomConstructorSpec{
newConstructor("new", newParam("port"), newParam("targetPort")),
newConstructor("newNamed", newParam("name"), newParam("port"), newParam("targetPort")),
......@@ -109,8 +213,8 @@ var versions = map[string]versionData{
newConstructor(
"fromConfigMap",
newParam("name"),
newParamNestedRef("configMapName", "mixin.configMap.name"),
newParamNestedRef("configMapItems", "mixin.configMap.items")),
newParamNestedRef("configMapName", "mixin.configMap.withName"),
newParamNestedRef("configMapItems", "mixin.configMap.withItems")),
newConstructor(
"fromEmptyDir",
newParam("name"),
......@@ -118,32 +222,21 @@ var versions = map[string]versionData{
newConstructor(
"fromPersistentVolumeClaim",
newParam("name"),
newParamNestedRef("claimName", "mixin.persistentVolumeClaim.claimName")),
newParamNestedRef("claimName", "mixin.persistentVolumeClaim.withClaimName")),
newConstructor(
"fromHostPath",
newParam("name"),
newParamNestedRef("hostPath", "mixin.hostPath.path")),
newParamNestedRef("hostPath", "mixin.hostPath.withPath")),
newConstructor(
"fromSecret",
newParam("name"),
newParamNestedRef("secretName", "mixin.secret.withSecretName")),
},
"io.k8s.kubernetes.pkg.api.v1.VolumeMount": []CustomConstructorSpec{
newConstructor("new", newParam("name"), newParam("mountPath"), newParamWithDefault("readOnly", "false")),
},
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.name"),
newParamNestedRef("replicas", "mixin.spec.replicas"),
newParamNestedRef("containers", "mixin.spec.template.spec.containers"),
newParamNestedRefDefault("podLabels", "mixin.spec.template.metadata.labels", "{}")),
},
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Deployment": []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.name"),
newParamNestedRef("replicas", "mixin.spec.replicas"),
newParamNestedRef("containers", "mixin.spec.template.spec.containers"),
newParamNestedRefDefault("podLabels", "mixin.spec.template.metadata.labels", "{}")),
},
},
propertyBlacklist: map[string]propertySet{
// Metadata fields.
"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": newPropertySet(
......@@ -336,3 +429,46 @@ k8s + {
`,
},
}
//-----------------------------------------------------------------------------
// Utility specs, for duplicated objects.
//-----------------------------------------------------------------------------
var objectList = []CustomConstructorSpec{
newConstructor(
"new",
newParam("items")),
}
var v1beta1Deployment = []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName"),
newParamNestedRef("replicas", "mixin.spec.withReplicas"),
newParamNestedRef("containers", "mixin.spec.template.spec.withContainers"),
newParamNestedRefDefault(
"podLabels",
"mixin.spec.template.metadata.withLabels",
"{app: name}")),
}
var v1beta1DeploymentRollback = []CustomConstructorSpec{
newConstructor(
"new",
newParam("name")),
}
var v1beta1Scale = []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("replicas", "mixin.spec.withReplicas")),
}
var v1beta1StatefulSet = []CustomConstructorSpec{
newConstructor(
"new",
newParamNestedRef("name", "mixin.metadata.withName"),
newParamNestedRef("replicas", "mixin.spec.withReplicas"),
newParamNestedRef("containers", "mixin.spec.template.spec.withContainers"),
newParamNestedRef("volumeClaims", "mixin.spec.withVolumeClaimTemplates"),
newParamNestedRefDefault(
"podLabels",
"mixin.spec.template.metadata.withLabels",
"{app: name}")),
}
......@@ -257,28 +257,28 @@
"revisionTime": "2017-03-14T01:17:55Z"
},
{
"checksumSHA1": "wX+GmcWpMzCIcxR9YtN1FCM9BEE=",
"checksumSHA1": "ia91LEEbuaR5os39J+5MzEi1xnY=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/jsonnet",
"revision": "b27d2d7778c12c3d762d24c1b9fd4c41da6c73c7",
"revisionTime": "2017-09-10T05:18:39Z"
"revision": "46d8bb9e605dc3d3977e2e2054e921ed32dd699f",
"revisionTime": "2017-11-21T00:39:10Z"
},
{
"checksumSHA1": "zJx/j+IS6qd0P5h2m8WEQEtrACU=",
"checksumSHA1": "ZQxcZOI8LKx+lAZ9MAW1yb579zo=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/ksonnet",
"revision": "b27d2d7778c12c3d762d24c1b9fd4c41da6c73c7",
"revisionTime": "2017-09-10T05:18:39Z"
"revision": "46d8bb9e605dc3d3977e2e2054e921ed32dd699f",
"revisionTime": "2017-11-21T00:39:10Z"
},
{
"checksumSHA1": "BiiHRiYpSOb+vHiP6h/A9lRotEY=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec",
"revision": "b27d2d7778c12c3d762d24c1b9fd4c41da6c73c7",
"revisionTime": "2017-09-10T05:18:39Z"
"revision": "46d8bb9e605dc3d3977e2e2054e921ed32dd699f",
"revisionTime": "2017-11-21T00:39:10Z"
},
{
"checksumSHA1": "lr+Bx7/N2KHk9dOrsWfLYBPjbdQ=",
"checksumSHA1": "hEIHBY6IrJscUYUlgFPCHuW4yBs=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubeversion",
"revision": "b27d2d7778c12c3d762d24c1b9fd4c41da6c73c7",
"revisionTime": "2017-09-10T05:18:39Z"
"revision": "46d8bb9e605dc3d3977e2e2054e921ed32dd699f",
"revisionTime": "2017-11-21T00:39:10Z"
},
{
"checksumSHA1": "T8soMJArSZrYnhmdpAnq1bVxQ6Q=",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment