Skip to content

Commit

Permalink
Update to v1.16.0-beta.2
Browse files Browse the repository at this point in the history
- Fix typegen for RawExtension (properties removed from spec)
- Fix typegen for meta.v1.FieldsV1
  • Loading branch information
lblackstone committed Sep 4, 2019
1 parent 4d152b5 commit 528fcbc
Show file tree
Hide file tree
Showing 32 changed files with 1,842 additions and 658 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PROVIDER := pulumi-resource-${PACK}
CODEGEN := pulumi-gen-${PACK}
VERSION ?= $(shell scripts/get-version)
PYPI_VERSION := $(shell scripts/get-py-version)
KUBE_VERSION ?= v1.16.0-beta.1
KUBE_VERSION ?= v1.16.0-beta.2
SWAGGER_URL ?= https://github.com/kubernetes/kubernetes/raw/${KUBE_VERSION}/api/openapi-spec/swagger.json
OPENAPI_DIR := pkg/gen/openapi-specs
OPENAPI_FILE := ${OPENAPI_DIR}/swagger-${KUBE_VERSION}.json
Expand Down
6 changes: 4 additions & 2 deletions pkg/gen/typegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ const (
apiextensionsV1beta1 = "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1"
apiextensionsV1 = "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1"
quantity = "io.k8s.apimachinery.pkg.api.resource.Quantity"
rawExtension = "io.k8s.apimachinery.pkg.runtime.RawExtension"
intOrString = "io.k8s.apimachinery.pkg.util.intstr.IntOrString"
v1Fields = "io.k8s.apimachinery.pkg.apis.meta.v1.Fields"
v1FiledsV1 = "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"
v1Time = "io.k8s.apimachinery.pkg.apis.meta.v1.Time"
v1MicroTime = "io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime"
v1beta1JSONSchemaPropsOrBool = apiextensionsV1beta1 + ".JSONSchemaPropsOrBool"
Expand Down Expand Up @@ -397,7 +399,7 @@ func makeTypescriptType(resourceType, propName string, prop map[string]interface
ref = tsStringT
case intOrString:
ref = "number | string"
case v1Fields:
case v1Fields, v1FiledsV1, rawExtension:
ref = tsObject
case v1Time, v1MicroTime:
// TODO: Automatically deserialized with `DateConstructor`.
Expand Down Expand Up @@ -469,7 +471,7 @@ func makePythonType(resourceType, propName string, prop map[string]interface{},
ref = pyStringT
case intOrString:
ref = fmt.Sprintf("Union[%s, %s]", pyIntT, pyStringT)
case v1Fields:
case v1Fields, v1FiledsV1, rawExtension:
ref = pyDictT
case v1Time, v1MicroTime:
// TODO: Automatically deserialized with `DateConstructor`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { getVersion } from "../../version";

/**
* MutatingWebhookConfiguration describes the configuration of and admission webhook that accept
* or reject and may change the object.
* or reject and may change the object. Deprecated in v1.16, planned for removal in v1.19. Use
* admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead.
*/
export class MutatingWebhookConfiguration extends pulumi.CustomResource {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { getVersion } from "../../version";

/**
* ValidatingWebhookConfiguration describes the configuration of and admission webhook that
* accept or reject and object without changing it.
* accept or reject and object without changing it. Deprecated in v1.16, planned for removal in
* v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead.
*/
export class ValidatingWebhookConfiguration extends pulumi.CustomResource {
/**
Expand Down
4 changes: 2 additions & 2 deletions sdk/nodejs/apiextensions/v1/CustomResourceDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import { getVersion } from "../../version";
public readonly metadata: pulumi.Output<outputs.meta.v1.ObjectMeta>;

/**
* Spec describes how the user wants the resources to appear
* spec describes how the user wants the resources to appear
*/
public readonly spec: pulumi.Output<outputs.apiextensions.v1.CustomResourceDefinitionSpec>;

/**
* Status indicates the actual state of the CustomResourceDefinition
* status indicates the actual state of the CustomResourceDefinition
*/
public readonly status: pulumi.Output<outputs.apiextensions.v1.CustomResourceDefinitionStatus>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { getVersion } from "../../version";
public readonly apiVersion: pulumi.Output<"apiextensions.k8s.io/v1">;

/**
* Items individual CustomResourceDefinitions
* items list individual CustomResourceDefinition objects
*/
public readonly items: pulumi.Output<outputs.apiextensions.v1.CustomResourceDefinition[]>;

Expand Down
7 changes: 4 additions & 3 deletions sdk/nodejs/apiextensions/v1beta1/CustomResourceDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { getVersion } from "../../version";

/**
* CustomResourceDefinition represents a resource that should be exposed on the API server. Its
* name MUST be in the format <.spec.name>.<.spec.group>.
* name MUST be in the format <.spec.name>.<.spec.group>. Deprecated in v1.16, planned for
* removal in v1.19. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
*/
export class CustomResourceDefinition extends pulumi.CustomResource {
/**
Expand All @@ -32,12 +33,12 @@ import { getVersion } from "../../version";
public readonly metadata: pulumi.Output<outputs.meta.v1.ObjectMeta>;

/**
* Spec describes how the user wants the resources to appear
* spec describes how the user wants the resources to appear
*/
public readonly spec: pulumi.Output<outputs.apiextensions.v1beta1.CustomResourceDefinitionSpec>;

/**
* Status indicates the actual state of the CustomResourceDefinition
* status indicates the actual state of the CustomResourceDefinition
*/
public readonly status: pulumi.Output<outputs.apiextensions.v1beta1.CustomResourceDefinitionStatus>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { getVersion } from "../../version";
public readonly apiVersion: pulumi.Output<"apiextensions.k8s.io/v1beta1">;

/**
* Items individual CustomResourceDefinitions
* items list individual CustomResourceDefinition objects
*/
public readonly items: pulumi.Output<outputs.apiextensions.v1beta1.CustomResourceDefinition[]>;

Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/apps/v1/ControllerRevision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { getVersion } from "../../version";
/**
* Data is the serialized representation of the state.
*/
public readonly data: pulumi.Output<outputs.pkg.runtime.RawExtension>;
public readonly data: pulumi.Output<object>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/apps/v1beta1/ControllerRevision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getVersion } from "../../version";
/**
* Data is the serialized representation of the state.
*/
public readonly data: pulumi.Output<outputs.pkg.runtime.RawExtension>;
public readonly data: pulumi.Output<object>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
Expand Down
2 changes: 1 addition & 1 deletion sdk/nodejs/apps/v1beta2/ControllerRevision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getVersion } from "../../version";
/**
* Data is the serialized representation of the state.
*/
public readonly data: pulumi.Output<outputs.pkg.runtime.RawExtension>;
public readonly data: pulumi.Output<object>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
Expand Down
9 changes: 9 additions & 0 deletions sdk/nodejs/discovery/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

// Import versions:
import * as v1alpha1 from "./v1alpha1/index";

// Export sub-modules
export { v1alpha1, };

115 changes: 115 additions & 0 deletions sdk/nodejs/discovery/v1alpha1/EndpointSlice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

import * as pulumi from "@pulumi/pulumi";
import { core } from "../..";
import * as inputs from "../../types/input";
import * as outputs from "../../types/output";
import { getVersion } from "../../version";

/**
* EndpointSlice represents a subset of the endpoints that implement a service. For a given
* service there may be multiple EndpointSlice objects, selected by labels, which must be joined
* to produce the full set of endpoints.
*/
export class EndpointSlice extends pulumi.CustomResource {
/**
* addressType specifies the type of address carried by this EndpointSlice. All addresses in
* this slice must be the same type. Default is IP
*/
public readonly addressType: pulumi.Output<string>;

/**
* APIVersion defines the versioned schema of this representation of an object. Servers should
* convert recognized schemas to the latest internal value, and may reject unrecognized
* values. More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
public readonly apiVersion: pulumi.Output<"discovery.k8s.io/v1alpha1">;

/**
* endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of
* 1000 endpoints.
*/
public readonly endpoints: pulumi.Output<outputs.discovery.v1alpha1.Endpoint[]>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
* CamelCase. More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
public readonly kind: pulumi.Output<"EndpointSlice">;

/**
* Standard object's metadata.
*/
public readonly metadata: pulumi.Output<outputs.meta.v1.ObjectMeta>;

/**
* ports specifies the list of network ports exposed by each endpoint in this slice. Each port
* must have a unique name. When ports is empty, it indicates that there are no defined ports.
* When a port is defined with a nil port value, it indicates "all ports". Each slice may
* include a maximum of 100 ports.
*/
public readonly ports: pulumi.Output<outputs.discovery.v1alpha1.EndpointPort[]>;

/**
* Get the state of an existing `EndpointSlice` resource, as identified by `id`.
* The ID is of the form `[namespace]/<name>`; if `namespace` is omitted, then (per
* Kubernetes convention) the ID becomes `default/<name>`.
*
* Pulumi will keep track of this resource using `name` as the Pulumi ID.
*
* @param name _Unique_ name used to register this resource with Pulumi.
* @param id An ID for the Kubernetes resource to retrieve. Takes the form `[namespace]/<name>`.
* @param opts Uniquely specifies a CustomResource to select.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): EndpointSlice {
return new EndpointSlice(name, undefined, { ...opts, id: id });
}

/** @internal */
private static readonly __pulumiType = "kubernetes:discovery.k8s.io/v1alpha1:EndpointSlice";

/**
* Returns true if the given object is an instance of EndpointSlice. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is EndpointSlice {
if (obj === undefined || obj === null) {
return false;
}

return obj["__pulumiType"] === EndpointSlice.__pulumiType;
}

/**
* Create a discovery.v1alpha1.EndpointSlice resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: inputs.discovery.v1alpha1.EndpointSlice, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};
props["endpoints"] = args && args.endpoints || undefined;

props["addressType"] = args && args.addressType || undefined;
props["apiVersion"] = "discovery.k8s.io/v1alpha1";
props["kind"] = "EndpointSlice";
props["metadata"] = args && args.metadata || undefined;
props["ports"] = args && args.ports || undefined;

props["status"] = undefined;

if (!opts) {
opts = {};
}

if (!opts.version) {
opts.version = getVersion();
}
super(EndpointSlice.__pulumiType, name, props, opts);
}
}
96 changes: 96 additions & 0 deletions sdk/nodejs/discovery/v1alpha1/EndpointSliceList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

import * as pulumi from "@pulumi/pulumi";
import { core } from "../..";
import * as inputs from "../../types/input";
import * as outputs from "../../types/output";
import { getVersion } from "../../version";

/**
* EndpointSliceList represents a list of endpoint slices
*/
export class EndpointSliceList extends pulumi.CustomResource {
/**
* APIVersion defines the versioned schema of this representation of an object. Servers should
* convert recognized schemas to the latest internal value, and may reject unrecognized
* values. More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
public readonly apiVersion: pulumi.Output<"discovery.k8s.io/v1alpha1">;

/**
* List of endpoint slices
*/
public readonly items: pulumi.Output<outputs.discovery.v1alpha1.EndpointSlice[]>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
* CamelCase. More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
public readonly kind: pulumi.Output<"EndpointSliceList">;

/**
* Standard list metadata.
*/
public readonly metadata: pulumi.Output<outputs.meta.v1.ListMeta>;

/**
* Get the state of an existing `EndpointSliceList` resource, as identified by `id`.
* The ID is of the form `[namespace]/<name>`; if `namespace` is omitted, then (per
* Kubernetes convention) the ID becomes `default/<name>`.
*
* Pulumi will keep track of this resource using `name` as the Pulumi ID.
*
* @param name _Unique_ name used to register this resource with Pulumi.
* @param id An ID for the Kubernetes resource to retrieve. Takes the form `[namespace]/<name>`.
* @param opts Uniquely specifies a CustomResource to select.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): EndpointSliceList {
return new EndpointSliceList(name, undefined, { ...opts, id: id });
}

/** @internal */
private static readonly __pulumiType = "kubernetes:discovery.k8s.io/v1alpha1:EndpointSliceList";

/**
* Returns true if the given object is an instance of EndpointSliceList. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is EndpointSliceList {
if (obj === undefined || obj === null) {
return false;
}

return obj["__pulumiType"] === EndpointSliceList.__pulumiType;
}

/**
* Create a discovery.v1alpha1.EndpointSliceList resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: inputs.discovery.v1alpha1.EndpointSliceList, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};
props["items"] = args && args.items || undefined;

props["apiVersion"] = "discovery.k8s.io/v1alpha1";
props["kind"] = "EndpointSliceList";
props["metadata"] = args && args.metadata || undefined;

props["status"] = undefined;

if (!opts) {
opts = {};
}

if (!opts.version) {
opts.version = getVersion();
}
super(EndpointSliceList.__pulumiType, name, props, opts);
}
}
7 changes: 7 additions & 0 deletions sdk/nodejs/discovery/v1alpha1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

// Export members:
export * from "./EndpointSlice";
export * from "./EndpointSliceList";

3 changes: 2 additions & 1 deletion sdk/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as batch from "./batch/index";
import * as certificates from "./certificates/index";
import * as coordination from "./coordination/index";
import * as core from "./core/index";
import * as discovery from "./discovery/index";
import * as events from "./events/index";
import * as extensions from "./extensions/index";
import * as meta from "./meta/index";
Expand All @@ -31,7 +32,7 @@ import * as settings from "./settings/index";
import * as storage from "./storage/index";

// Export sub-modules
export { admissionregistration, apiextensions, apiregistration, apps, auditregistration, authentication, authorization, autoscaling, batch, certificates, coordination, core, events, extensions, meta, networking, node, policy, rbac, scheduling, settings, storage, };
export { admissionregistration, apiextensions, apiregistration, apps, auditregistration, authentication, authorization, autoscaling, batch, certificates, coordination, core, discovery, events, extensions, meta, networking, node, policy, rbac, scheduling, settings, storage, };

// Import and export sub-modules for all Kubernetes types.
import * as types from "./types";
Expand Down
Loading

0 comments on commit 528fcbc

Please sign in to comment.