Skip to content
Snippets Groups Projects
Commit 651c24cd authored by Alex Clemmer's avatar Alex Clemmer Committed by GitHub
Browse files

Merge pull request #88 from hausdorff/ks-gen

Implement `init`; bring synchronization primitives to spec
parents b4883e32 af3f0f6c
No related branches found
No related tags found
No related merge requests found
Showing
with 2198 additions and 0 deletions
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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 jsonnet contains a collection of simple rewriting
// facilities that allow us to easily map text from the OpenAPI spec
// to things that are Jsonnet-friendly (e.g., renaming identifiers
// that are Jsonnet keywords, lowerCamelCase'ing names, and so on).
package jsonnet
import (
"fmt"
"log"
"strings"
"github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec"
"github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubeversion"
)
// FieldKey represents the literal text of a key for some JSON object
// field, after rewriting to avoid collisions with Jsonnet keywords.
// For example, for `{foo: ...}`, the `FieldKey` would be `foo`, while
// for `{error: ...}`, the `FieldKey` would be `"error"` (with
// quotation marks, to avoid collisions).
type FieldKey string
// FuncParam represents the parameter to a Jsonnet function, after
// being rewritten to avoid collisions with Jsonnet keywords and
// normalized to fit the Jsonnet style (i.e., lowerCamelCase) using a
// manual set of custom transformations that change per Kubernetes
// version. For example, in `foo(BarAPI) {...}`, `FuncParam` would be
// `barApi`, and in `foo(error) {...}`, `FuncParam` would be
// `errorParam`.
type FuncParam string
// Identifier represents any identifier in a Jsonnet program, after
// being normalized to fit the Jsonnet style (i.e., lowerCamelCase)
// using a manual set of custom transformations that change per
// Kubernetes version. For example, `fooAPI` becomes `fooApi`.
type Identifier string
// 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:
// ...}`. Hence, this function will quote this string, so that it ends
// up like: `{"error": ...}`.
func RewriteAsFieldKey(text kubespec.PropertyName) FieldKey {
// NOTE: Because the field needs to have precisely the same text as
// the Kubernetes API spec, we do not compute a version-specific ID
// alias as we do for other rewrites.
if _, ok := jsonnetKeywordSet[text]; ok {
return FieldKey(fmt.Sprintf("\"%s\"", text))
}
return FieldKey(text)
}
// RewriteAsFuncParam takes a `PropertyName` and converts it to a
// valid Jsonnet function parameter. For example, if the
// `PropertyName` has a value of `"error"`, then this would generate
// an invalid function parameter, `function(error) ...`. Hence, this
// function will alter the identifier, so that it ends up like:
// `function(errorParam) ...`.
//
// NOTE: This transformation involves a hand-curated style change to
// lowerCamelCase (e.g., `fooAPI` -> `fooApi`). This list changes per
// Kubernetes version, according to identifiers that don't conform to
// this style.
func RewriteAsFuncParam(
k8sVersion string, text kubespec.PropertyName,
) FuncParam {
id := RewriteAsIdentifier(k8sVersion, text)
if _, ok := jsonnetKeywordSet[kubespec.PropertyName(id)]; ok {
return FuncParam(fmt.Sprintf("%sParam", id))
}
return FuncParam(id)
}
// RewriteAsIdentifier takes a `GroupName`, `ObjectKind`,
// `PropertyName`, or `string`, and converts it to a Jsonnet-style
// Identifier. Typically this includes lower-casing the first letter,
// but also changing initialisms like fooAPI -> fooApi.
//
// NOTE: This transformation involves a hand-curated style change to
// lowerCamelCase (e.g., `fooAPI` -> `fooApi`). This list changes per
// Kubernetes version, according to identifiers that don't conform to
// this style.
func RewriteAsIdentifier(
k8sVersion string, rawID fmt.Stringer,
) Identifier {
var id = rawID.String()
if len(id) == 0 {
log.Fatalf("Can't lowercase first letter of 0-rune string")
}
kindString := kubeversion.MapIdentifier(k8sVersion, id)
upper := strings.ToLower(kindString[:1])
return Identifier(upper + kindString[1:])
}
var jsonnetKeywordSet = map[kubespec.PropertyName]string{
"assert": "assert",
"else": "else",
"error": "error",
"false": "false",
"for": "for",
"function": "function",
"if": "if",
"import": "import",
"importstr": "importstr",
"in": "in",
"local": "local",
"null": "null",
"tailstrict": "tailstrict",
"then": "then",
"self": "self",
"super": "super",
"true": "true",
}
package ksonnet
import (
"bytes"
"fmt"
"strings"
)
// indentWriter abstracts the task of writing out indented text to a
// buffer. Different components can call `indent` and `dedent` as
// appropriate to specify how indentation needs to change, rather than
// to keep track of the current indentation.
//
// For example, if one component is responsible for writing an array,
// and an element in that array is a function, the component
// responsible for the array need only know to call `indent` after the
// '[' character and `dedent` before the ']' character, while the
// routine responsible for writing out the function can handle its own
// indentation independently.
type indentWriter struct {
depth int
err error
buffer bytes.Buffer
}
func newIndentWriter() *indentWriter {
var buffer bytes.Buffer
return &indentWriter{
depth: 0,
err: nil,
buffer: buffer,
}
}
func (m *indentWriter) writeLine(text string) {
if m.err != nil {
return
}
prefix := strings.Repeat(" ", m.depth)
line := fmt.Sprintf("%s%s\n", prefix, text)
_, m.err = m.buffer.WriteString(line)
}
func (m *indentWriter) bytes() ([]byte, error) {
if m.err != nil {
return nil, m.err
}
return m.buffer.Bytes(), nil
}
func (m *indentWriter) indent() {
m.depth++
}
func (m *indentWriter) dedent() {
m.depth--
}
This diff is collapsed.
package ksonnet
import (
"github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec"
)
const constructorName = "new"
// isMixinRef will check whether a `ObjectRef` refers to an API object
// that can be turned into a mixin. This should be true of the vast
// majority of non-nil `ObjectRef`s. The most common exception is
// `IntOrString`, which should not be turned into a mixin, and should
// instead by transformed into a property method that behaves
// identically to one taking an int or a ref as argument.
func isMixinRef(or *kubespec.ObjectRef) bool {
return or != nil && *or != "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
}
var specialProperties = map[kubespec.PropertyName]kubespec.PropertyName{
"apiVersion": "apiVersion",
"kind": "kind",
}
var specialPropertiesList = []string{"apiVersion", "kind"}
func isSpecialProperty(pn kubespec.PropertyName) bool {
_, ok := specialProperties[pn]
return ok
}
package kubespec
import (
"fmt"
"log"
"strings"
)
//-----------------------------------------------------------------------------
// Utility methods for `DefinitionName` and `ObjectRef`.
//-----------------------------------------------------------------------------
// Parse will parse a `DefinitionName` into a structured
// `ParsedDefinitionName`.
func (dn *DefinitionName) Parse() *ParsedDefinitionName {
split := strings.Split(string(*dn), ".")
if len(split) < 6 {
log.Fatalf("Failed to parse definition name '%s'", string(*dn))
} else if split[0] != "io" || split[1] != "k8s" || split[3] != "pkg" {
log.Fatalf("Failed to parse definition name '%s'", string(*dn))
}
codebase := split[2]
if split[4] == "api" {
// Name is something like: `io.k8s.kubernetes.pkg.api.v1.LimitRangeSpec`.
if len(split) < 7 {
log.Fatalf(
"Expected >= 7 path components for package 'api' in path: '%s'",
string(*dn))
}
versionString := VersionString(split[5])
return &ParsedDefinitionName{
PackageType: Core,
Codebase: codebase,
Group: nil,
Version: &versionString,
Kind: ObjectKind(split[6]),
}
} else if split[4] == "apis" {
// Name is something like: `io.k8s.kubernetes.pkg.apis.batch.v1.JobList`.
if len(split) < 8 {
log.Fatalf(
"Expected >= 8 path components for package 'apis' in path: '%s'",
string(*dn))
}
groupName := GroupName(split[5])
versionString := VersionString(split[6])
return &ParsedDefinitionName{
PackageType: APIs,
Codebase: codebase,
Group: &groupName,
Version: &versionString,
Kind: ObjectKind(split[7]),
}
} else if split[4] == "util" {
if len(split) < 7 {
log.Fatalf(
"Expected >= 7 path components for package 'api' in path: '%s'",
string(*dn))
}
versionString := VersionString(split[5])
return &ParsedDefinitionName{
PackageType: Util,
Codebase: codebase,
Group: nil,
Version: &versionString,
Kind: ObjectKind(split[6]),
}
} else if split[4] == "runtime" {
// Name is something like: `io.k8s.apimachinery.pkg.runtime.RawExtension`.
return &ParsedDefinitionName{
PackageType: Runtime,
Codebase: codebase,
Group: nil,
Version: nil,
Kind: ObjectKind(split[5]),
}
} else if split[4] == "version" {
// Name is something like: `io.k8s.apimachinery.pkg.version.Info`.
return &ParsedDefinitionName{
PackageType: Version,
Codebase: codebase,
Group: nil,
Version: nil,
Kind: ObjectKind(split[5]),
}
}
log.Fatalf("Unknown package name '%s' in path: '%s'", split[4], string(*dn))
return nil
}
// Name parses a `DefinitionName` from an `ObjectRef`. `ObjectRef`s
// that refer to a definition contain two parts: (1) a special prefix,
// and (2) a `DefinitionName`, so this function simply strips the
// prefix off.
func (or *ObjectRef) Name() *DefinitionName {
defn := "#/definitions/"
ref := string(*or)
if !strings.HasPrefix(ref, defn) {
log.Fatalln(ref)
}
name := DefinitionName(strings.TrimPrefix(ref, defn))
return &name
}
func (dn DefinitionName) AsObjectRef() *ObjectRef {
or := ObjectRef("#/definitions/" + dn)
return &or
}
//-----------------------------------------------------------------------------
// Parsed definition name.
//-----------------------------------------------------------------------------
// Package represents the type of the definition, either `APIs`, which
// have API groups (e.g., extensions, apps, meta, and so on), or
// `Core`, which does not.
type Package int
const (
// Core is a package that contains the Kubernetes Core objects.
Core Package = iota
// APIs is a set of non-core packages grouped loosely by semantic
// functionality (e.g., apps, extensions, and so on).
APIs
//
// Internal packages.
//
// Util is a package that contains utilities used for both testing
// and running Kubernetes.
Util
// Runtime is a package that contains various utilities used in the
// Kubernetes runtime.
Runtime
// Version is a package that supplies version information collected
// at build time.
Version
)
// ParsedDefinitionName is a parsed version of a fully-qualified
// OpenAPI spec name. For example,
// `io.k8s.kubernetes.pkg.api.v1.Container` would parse into an
// instance of the struct below.
type ParsedDefinitionName struct {
PackageType Package
Codebase string
Group *GroupName // Pointer because it's optional.
Version *VersionString // Pointer because it's optional.
Kind ObjectKind
}
// GroupName represetents a Kubernetes group name (e.g., apps,
// extensions, etc.)
type GroupName string
func (gn GroupName) String() string {
return string(gn)
}
// ObjectKind represents the `kind` of a Kubernetes API object (e.g.,
// Service, Deployment, etc.)
type ObjectKind string
func (ok ObjectKind) String() string {
return string(ok)
}
// VersionString is the string representation of an API version (e.g.,
// v1, v1beta1, etc.)
type VersionString string
func (vs VersionString) String() string {
return string(vs)
}
// Unparse transforms a `ParsedDefinitionName` back into its
// corresponding string, e.g.,
// `io.k8s.kubernetes.pkg.api.v1.Container`.
func (p *ParsedDefinitionName) Unparse() DefinitionName {
switch p.PackageType {
case Core:
{
return DefinitionName(fmt.Sprintf(
"io.k8s.%s.pkg.api.%s.%s",
p.Codebase,
*p.Version,
p.Kind))
}
case Util:
{
return DefinitionName(fmt.Sprintf(
"io.k8s.%s.pkg.util.%s.%s",
p.Codebase,
*p.Version,
p.Kind))
}
case APIs:
{
return DefinitionName(fmt.Sprintf(
"io.k8s.%s.pkg.apis.%s.%s.%s",
p.Codebase,
*p.Group,
*p.Version,
p.Kind))
}
case Version:
{
return DefinitionName(fmt.Sprintf(
"io.k8s.%s.pkg.version.%s",
p.Codebase,
p.Kind))
}
case Runtime:
{
return DefinitionName(fmt.Sprintf(
"io.k8s.%s.pkg.runtime.%s",
p.Codebase,
p.Kind))
}
default:
{
log.Fatalf(
"Failed to unparse definition name, did not recognize kind '%d'",
p.PackageType)
return ""
}
}
}
package kubespec
// APISpec represents an OpenAPI specification of an API.
type APISpec struct {
SwaggerVersion string `json:"swagger"`
Info *SchemaInfo `json:"info"`
Definitions SchemaDefinitions `json:"definitions"`
// Fields we currently ignore:
// - paths
// - securityDefinitions
// - security
// Not part of the OpenAPI spec. Filled in later.
FilePath string
Text []byte
}
// SchemaInfo contains information about the the API represented with
// `APISpec`. For example, `title` might be `"Kubernetes"`, and
// `version` might be `"v1.7.0"`.
type SchemaInfo struct {
Title string `json:"title"`
Version string `json:"version"`
}
// SchemaDefinition is an API object definition. For example, this
// might contain a name (e.g., `v1.APIGroup`), a set of properties
// (e.g., `apiVersion`, `kind`, and so on), and the names of required
// properties.
type SchemaDefinition struct {
Type *SchemaType `json:"type"`
Description string `json:"description"` // nullable.
Required []string `json:"required"` // nullable.
Properties Properties `json:"properties"` // nullable.
TopLevelSpecs TopLevelSpecs `json:"x-kubernetes-group-version-kind"`
}
// TopLevelSpec is a property that exists on `SchemaDefinition`s for
// top-level API objects.
type TopLevelSpec struct {
Group GroupName `json:"Group"`
Version VersionString `json:"Version"`
Kind ObjectKind `json:"Kind"`
}
type TopLevelSpecs []*TopLevelSpec
// SchemaDefinitions is a named collection of `SchemaDefinition`s,
// represented as a collection mapping definition name ->
// `SchemaDefinition`.
type SchemaDefinitions map[DefinitionName]*SchemaDefinition
// Property represents an object property for some API object. For
// example, `v1.APIGroup` might contain a property called
// `apiVersion`, which would be specifid by a `Property`.
type Property struct {
Description string `json:"description"`
Type *SchemaType `json:"type"`
Ref *ObjectRef `json:"$ref"`
Items Items `json:"items"` // nil unless Type == "array".
}
// Properties is a named collection of `Properties`s, represented as a
// collection mapping definition name -> `Properties`.
type Properties map[PropertyName]*Property
// Items represents the type of an element in an array. Usually this
// is used to fully specify a `Property` object whose `type` field is
// `"array"`.
type Items struct {
Ref *ObjectRef `json:"$ref"`
// Ignored fields:
// - Type *SchemaType `json:"type"`
// - Format *string `json:"format"`
}
// SchemaType represents the type of some object in an API spec. For
// example, a property might have type `string`.
type SchemaType string
func (st SchemaType) String() string {
return string(st)
}
// ObjectRef represents a reference to some API object. For example,
// `#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta`
type ObjectRef string
func (or ObjectRef) String() string {
return string(or)
}
// PropertyName represents the name of a property. For example,
// `apiVersion` or `kind`.
type PropertyName string
func (pn PropertyName) String() string {
return string(pn)
}
// DefinitionName represents the name of a definition. For example,
// `v1.APIGroup`.
type DefinitionName string
func (dn DefinitionName) String() string {
return string(dn)
}
#!/usr/bin/env jq -S -f
# -----------------------------------------------------------------------------
# USAGE NOTES.
#
# This `jq` script will generate a list of top-level Kubernetes API
# objects that contain either (or both of):
#
# 1. a property with the name `"status"`, or
# 2. a property whose type is `meta.v1.ListMeta`.
#
# For example:
#
# {
# "io.k8s.apimachinery.pkg.apis.meta.v1.Status": [
# "status", "metadata"
# ]
# }
#
# This would indicate that the fields `metadata` and `status` are to
# be blacklisted in the object `meta.v1.Status`.
#
#
# Usage:
# cat swagger.json | jq -S -f blacklist.jq
#
# Or, if you are on an OS with jq > v1.4
# cat swagger.json | ./blacklist.jq
#
# NOTE: It is very important to pass the -S flag here, because sorting
# the object keys makes the output diffable.
# -----------------------------------------------------------------------------
# has_status_prop takes an Kubernetes API object definition from the
# swagger spec, and outputs a boolean indicating whether that API
# object has a property called `status`.
#
# For example, the input might be a
# `io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment` object, which
# does indeed have a `status` field.
def has_status_prop:
. as $definition
| if $definition.properties.status != null then true else false end;
# property_has_listmeta_type takes the property of a Kubernetes API
# object definition, and returns a bool indicating whether its type is
# a `$ref` of `meta.v1.ListMeta`.
#
# For example, `io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment`
# does not have a property with a type that is a `$ref` to
# `meta.v1.ListMeta`.
def property_has_listmeta_type:
. as $property
| $property["$ref"] != null and
$property["$ref"] == "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta";
# props_with_listmeta_type returns the names of all properties in some
# Kubernetes API object definition whose type is `meta.v1.ListMeta`.
#
# For example, `io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment`
# does not contain any properties with this type, so we would return
# an empty array, while another object might return a list of names.
def props_with_listmeta_type: [
. as $definition
| select($definition.properties != null)
| $definition.properties
| to_entries[]
| select(.value | property_has_listmeta_type)
| .key
];
# entry_blacklist_props takes a key/value pair representing a
# Kubernetes API object and its name, and returns a list of properties
# that are blacklisted.
#
# For example, `.key` might be
# `io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment`, while `.value`
# woudl be the actual swagger specification of the `Deployment`
# object.
def entry_blacklist_props:
.value as $definition
| ($definition | has_status_prop) as $has_status_prop
| ($definition | props_with_listmeta_type) as $props_with_listmeta_type
| ($props_with_listmeta_type | length > 0) as $has_listmeta_type_props
| if $has_status_prop and $has_listmeta_type_props
then {(.key): (["status"] | .+ $props_with_listmeta_type)}
elif $has_status_prop
then {(.key): ["status"]}
elif $has_listmeta_type_props
then {(.key): $props_with_listmeta_type}
else {(.key): []}
end;
def create_blacklist:
[ .definitions | to_entries[] | entry_blacklist_props ]
| add
| with_entries(select(.value | length > 0));
# Execute.
create_blacklist
package kubeversion
//-----------------------------------------------------------------------------
// Kubernetes version-specific data for customizing code that's
// emitted.
//-----------------------------------------------------------------------------
var versions = map[string]versionData{
"v1.7.0": versionData{
idAliases: map[string]string{
// Properties of objects. Stuff like `cinder.volumeId`.
"hostIPC": "hostIpc",
"hostPID": "hostPid",
"targetCPUUtilizationPercentage": "targetCpuUtilizationPercentage",
"externalID": "externalId",
"podCIDR": "podCidr",
"providerID": "providerId",
"bootID": "bootId",
"machineID": "machineId",
"systemUUID": "systemUuid",
"volumeID": "volumeId",
"diskURI": "diskUri",
"targetWWNs": "targetWwns",
"datasetUUID": "datasetUuid",
"pdID": "pdId",
"scaleIO": "scaleIo",
"podIP": "podIp",
"hostIP": "hostIp",
"clusterIP": "clusterIp",
"externalIPs": "externalIps",
"loadBalancerIP": "loadBalancerIp",
"containerID": "containerId",
"imageID": "imageId",
"serverAddressByClientCIDRs": "serverAddressByClientCidrs",
"clientCIDR": "clientCidr",
"nonResourceURLs": "nonResourceUrls",
"currentCPUUtilizationPercentage": "currentCpuUtilizationPercentage",
"downwardAPI": "downwardApi",
// Types. These have capitalized first letters, and exist in
// places like `core.v1.AWSElasticBlockStoreVolumeSource`.
"AWSElasticBlockStoreVolumeSource": "awsElasticBlockStoreVolumeSource",
"CephFSVolumeSource": "cephFsVolumeSource",
"DownwardAPIProjection": "downwardApiProjection",
"DownwardAPIVolumeFile": "downwardApiVolumeFile",
"DownwardAPIVolumeSource": "downwardApiVolumeSource",
"FCVolumeSource": "fcVolumeSource",
"GCEPersistentDiskVolumeSource": "gcePersistentDiskVolumeSource",
"HTTPGetAction": "httpGetAction",
"HTTPHeader": "httpHeader",
"ISCSIVolumeSource": "iscsiVolumeSource",
"NFSVolumeSource": "nfsVolumeSource",
"RBDVolumeSource": "rbdVolumeSource",
"SELinuxOptions": "seLinuxOptions",
"ScaleIOVolumeSource": "scaleIoVolumeSource",
"TCPSocketAction": "tcpSocketAction",
"APIVersion": "apiVersion",
"FSGroupStrategyOptions": "fsGroupStrategyOptions",
"HTTPIngressPath": "httpIngressPath",
"HTTPIngressRuleValue": "httpIngressRuleValue",
"IDRange": "idRange",
"IngressTLS": "ingressTls",
"SELinuxStrategyOptions": "seLinuxStrategyOptions",
"APIGroup": "apiGroup",
"APIGroupList": "apiGroupList",
"APIResource": "apiResource",
"APIResourceList": "apiResourceList",
"APIVersions": "apiVersions",
"ServerAddressByClientCIDR": "serverAddressByClientCidr",
},
constructorSpecs: map[string][]CustomConstructorSpec{
"io.k8s.kubernetes.pkg.api.v1.Container": []CustomConstructorSpec{
newConstructor("new", newParam("name"), newParam("image")),
},
"io.k8s.kubernetes.pkg.api.v1.ContainerPort": []CustomConstructorSpec{
newConstructor("new", newParam("containerPort")),
newConstructor("newNamed", newParam("name"), newParam("containerPort")),
},
"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")),
newConstructor(
"fromFieldPath",
newParam("name"),
newParamNestedRef("fieldPath", "mixin.valueFrom.fieldRef.fieldPath")),
},
"io.k8s.kubernetes.pkg.api.v1.KeyToPath": []CustomConstructorSpec{
newConstructor("new", newParam("key"), newParam("path")),
},
"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")),
},
"io.k8s.kubernetes.pkg.api.v1.ServicePort": []CustomConstructorSpec{
newConstructor("new", newParam("port"), newParam("targetPort")),
newConstructor("newNamed", newParam("name"), newParam("port"), newParam("targetPort")),
},
"io.k8s.kubernetes.pkg.api.v1.Volume": []CustomConstructorSpec{
newConstructor(
"fromConfigMap",
newParam("name"),
newParamNestedRef("configMapName", "mixin.configMap.name"),
newParamNestedRef("configMapItems", "mixin.configMap.items")),
newConstructor(
"fromEmptyDir",
newParam("name"),
newParamNestedRefDefault("emptyDir", "mixin.emptyDir.mixinInstance", "{}")),
newConstructor(
"fromPersistentVolumeClaim",
newParam("name"),
newParamNestedRef("claimName", "mixin.persistentVolumeClaim.claimName")),
newConstructor(
"fromHostPath",
newParam("name"),
newParamNestedRef("hostPath", "mixin.hostPath.path")),
},
"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(
"creationTimestamp", "deletionTimestamp", "generation",
"ownerReferences", "resourceVersion", "selfLink", "uid",
),
// Fields whose types are
// `io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta`.
"io.k8s.kubernetes.pkg.api.v1.ComponentStatusList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.ConfigMapList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.EndpointsList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.EventList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.LimitRangeList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.NamespaceList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.NodeList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.PersistentVolumeClaimList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.PersistentVolumeList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.PodList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.PodTemplateList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.ReplicationControllerList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.ResourceQuotaList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.SecretList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.ServiceAccountList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.api.v1.ServiceList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.DeploymentList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSetList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscalerList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.autoscaling.v2alpha1.HorizontalPodAutoscalerList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.batch.v1.JobList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.batch.v2alpha1.CronJobList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.certificates.v1beta1.CertificateSigningRequestList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSetList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.NetworkPolicyList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.PodSecurityPolicyList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ThirdPartyResourceList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.policy.v1beta1.PodDisruptionBudgetList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1alpha1.ClusterRoleBindingList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1alpha1.ClusterRoleList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1alpha1.RoleBindingList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1alpha1.RoleList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1beta1.ClusterRoleBindingList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1beta1.ClusterRoleList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1beta1.RoleBindingList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.rbac.v1beta1.RoleList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.settings.v1alpha1.PodPresetList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.storage.v1.StorageClassList": newPropertySet("metadata"),
"io.k8s.kubernetes.pkg.apis.storage.v1beta1.StorageClassList": newPropertySet("metadata"),
// Status fields.
"io.k8s.kubernetes.pkg.api.v1.Namespace": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.Node": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.NodeCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.PersistentVolume": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.PersistentVolumeClaim": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.Pod": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.PodCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.ReplicationController": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.ReplicationControllerCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.ResourceQuota": newPropertySet("status"),
"io.k8s.kubernetes.pkg.api.v1.Service": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.DeploymentCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.Scale": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSet": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authentication.v1.TokenReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authentication.v1beta1.TokenReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1.LocalSubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1.SelfSubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1.SubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1beta1.LocalSubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1beta1.SelfSubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.authorization.v1beta1.SubjectAccessReview": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscaler": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.autoscaling.v1.Scale": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.autoscaling.v2alpha1.HorizontalPodAutoscaler": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.batch.v1.Job": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.batch.v1.JobCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.batch.v2alpha1.CronJob": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.certificates.v1beta1.CertificateSigningRequest": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSet": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Deployment": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Ingress": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSet": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetCondition": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Scale": newPropertySet("status"),
"io.k8s.kubernetes.pkg.apis.policy.v1beta1.PodDisruptionBudget": newPropertySet("status"),
// TODO: Find a more principled way to omit "status" types.
// Currently we emit these in the `local hidden` in the `root`,
// so that we can type aliases. To get around the fact that some
// of their function names collide with Jsonnet keywords, we
// simply choose not to emit them. Eventually we will approach
// this problem in a more principled manner.
"io.k8s.kubernetes.pkg.api.v1.ComponentCondition": newPropertySet("error", "status"),
"io.k8s.kubernetes.pkg.apis.authentication.v1.TokenReviewStatus": newPropertySet("error"),
"io.k8s.kubernetes.pkg.apis.authentication.v1beta1.TokenReviewStatus": newPropertySet("error"),
// Has both status and a property with type
// `io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta`.
"io.k8s.apimachinery.pkg.apis.meta.v1.Status": newPropertySet("status", "metadata"),
// Misc.
"io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSetSpec": newPropertySet("templateGeneration"),
},
},
}
// Package kubeversion contains a collection of helper methods that
// help to customize the code generated for ksonnet-lib to suit
// different Kubernetes versions.
//
// For example, we may choose not to emit certain properties for some
// objects in Kubernetes v1.7.0; or, we might want to rename a
// property method. This package contains both the helper methods that
// perform such transformations, as well as the data for the
// transformations we use for each version.
package kubeversion
import (
"log"
"github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec"
)
// MapIdentifier takes a text identifier and maps it to a
// Jsonnet-appropriate identifier, for some version of Kubernetes. For
// example, in Kubernetes v1.7.0, we might map `clusterIP` ->
// `clusterIp`.
func MapIdentifier(k8sVersion, id string) string {
verData, ok := versions[k8sVersion]
if !ok {
log.Fatalf("Unrecognized Kubernetes version '%s'", k8sVersion)
}
if alias, ok := verData.idAliases[id]; ok {
return alias
}
return id
}
// IsBlacklistedProperty taks a definition name (e.g.,
// `io.k8s.kubernetes.pkg.apis.apps.v1beta1.Deployment`), a property
// name (e.g., `status`), and reports whether it is blacklisted for
// some Kubernetes version. This is particularly useful when deciding
// whether or not to generate mixins and property methods for a given
// property (as we likely wouldn't in the case of, say, `status`).
func IsBlacklistedProperty(
k8sVersion string, path kubespec.DefinitionName,
propertyName kubespec.PropertyName,
) bool {
verData, ok := versions[k8sVersion]
if !ok {
return false
}
bl, ok := verData.propertyBlacklist[string(path)]
if !ok {
return false
}
_, ok = bl[string(propertyName)]
return ok
}
func ConstructorSpec(
k8sVersion string, path kubespec.DefinitionName,
) ([]CustomConstructorSpec, bool) {
verData, ok := versions[k8sVersion]
if !ok {
log.Fatalf("Unrecognized Kubernetes version '%s'", k8sVersion)
}
spec, ok := verData.constructorSpecs[string(path)]
return spec, ok
}
//-----------------------------------------------------------------------------
// Core data structures for specifying version information.
//-----------------------------------------------------------------------------
type versionData struct {
idAliases map[string]string
constructorSpecs map[string][]CustomConstructorSpec
propertyBlacklist map[string]propertySet
}
type propertySet map[string]bool
func newPropertySet(strings ...string) propertySet {
ps := make(propertySet)
for _, s := range strings {
ps[s] = true
}
return ps
}
//-----------------------------------------------------------------------------
// Public Data structures for specifying custom constructors for API
// objects.
//-----------------------------------------------------------------------------
// CustomConstructorSpec specifies a custom constructor for
// `ksonnet-gen` to emit as part of ksonnet-lib. In particular, this
// specifies a constructor of the form:
//
// foo(bar, baz):: self.bar(bar) + self.baz(baz)
//
// The parameter list and the body are all generated from the `Params`
// field.
//
// DESIGN NOTES:
//
// * If the user specifies a custom constructor, we will not emit the
// default zero-argument constructor, `new()`. This is a purposeful
// decision which we make because we are typically customizing the
// constructors precisely because the zero-argument constructor is
// not meaninful for a given API object.
// * We currently do not check that parameter names are unique.
// Duplicate identifiers in a parameter list results in a Jsonnet
// compiler error, though, so this should be caught by review and
// CI, and it is hence not important for this case to be covered by
// this code.
type CustomConstructorSpec struct {
ID string
Params []CustomConstructorParam
}
func newConstructor(
id string, params ...CustomConstructorParam,
) CustomConstructorSpec {
return CustomConstructorSpec{
ID: id,
Params: params,
}
}
// CustomConstructorParam specifies a parameter for a
// `CustomConstructorSpec`. This class allows users to specify
// constructors of various forms, including:
//
// * The "normal" form, e.g., `foo(bar):: self.bar(bar)`,
// * Parameters with default values, e.g., `foo(bar="baz")::
// self.bar(bar)`, and
// * Parameters that are nested inside the object, e.g., `foo(bar)::
// self.baz.bat.bar(bar)`
//
// DESIGN NOTES:
//
// * For constructors that use nested paths, we do not currently check
// that the path is valid. So for example, `self.baz.bat.bar` in the
// example above may not correspond to a real property. We make this
// decision because it complicates the code, and it doesn't seem
// worth it since this feature is used relatively rarely.
type CustomConstructorParam struct {
ID string
DefaultValue *string
RelativePath *string
}
func newParam(name string) CustomConstructorParam {
return CustomConstructorParam{
ID: name,
DefaultValue: nil,
}
}
func newParamWithDefault(name, def string) CustomConstructorParam {
return CustomConstructorParam{
ID: name,
DefaultValue: &def,
}
}
func newParamNestedRef(name, relativePath string) CustomConstructorParam {
return CustomConstructorParam{
ID: name,
RelativePath: &relativePath,
}
}
func newParamNestedRefDefault(
name, relativePath, def string,
) CustomConstructorParam {
return CustomConstructorParam{
ID: name,
RelativePath: &relativePath,
DefaultValue: &def,
}
}
......@@ -190,6 +190,30 @@
"revision": "acf38b000a03e4ab89e40f20f1e548f4e6ac7f72",
"revisionTime": "2017-03-14T01:17:55Z"
},
{
"checksumSHA1": "wX+GmcWpMzCIcxR9YtN1FCM9BEE=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/jsonnet",
"revision": "fcf4c31408afc7b7469a1722c4cc06ccc315a722",
"revisionTime": "2017-08-16T22:14:57Z"
},
{
"checksumSHA1": "LGk0N301rp2uQSOmy7kBQEksues=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/ksonnet",
"revision": "fcf4c31408afc7b7469a1722c4cc06ccc315a722",
"revisionTime": "2017-08-16T22:14:57Z"
},
{
"checksumSHA1": "BiiHRiYpSOb+vHiP6h/A9lRotEY=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec",
"revision": "fcf4c31408afc7b7469a1722c4cc06ccc315a722",
"revisionTime": "2017-08-16T22:14:57Z"
},
{
"checksumSHA1": "jpBOSqq1T9UyiANimAKtzyTt3qo=",
"path": "github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubeversion",
"revision": "fcf4c31408afc7b7469a1722c4cc06ccc315a722",
"revisionTime": "2017-08-16T22:14:57Z"
},
{
"checksumSHA1": "T8soMJArSZrYnhmdpAnq1bVxQ6Q=",
"path": "github.com/mailru/easyjson/buffer",
......
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