Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for k8s 1.16 #669

Merged
merged 6 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@

### Supported Kubernetes versions

- v1.16.x
- v1.15.x
- v1.14.x
- v1.13.x

## 1.1.0 (September 18, 2019)

### Supported Kubernetes versions

- v1.16.x
- v1.15.x
- v1.14.x

### Major changes

- Add support for Kubernetes v1.16.0 (https://github.com/pulumi/pulumi-kubernetes/pull/669)

### Improvements

- Implement customTimeout for resource deletion. (https://github.com/pulumi/pulumi-kubernetes/pull/802).
- Increase default readiness timeouts to 10 mins. (https://github.com/pulumi/pulumi-kubernetes/pull/721).
- Add suppressDeprecationWarnings flag. (https://github.com/pulumi/pulumi-kubernetes/pull/808).
- Warn for invalid usage of Helm repo parameter. (https://github.com/pulumi/pulumi-kubernetes/pull/805).
- Add PodAggregator for use by resource awaiters. (https://github.com/pulumi/pulumi-kubernetes/pull/785).

## 1.0.1 (September 11, 2019)

Expand All @@ -25,8 +38,6 @@

- Warn for deprecated apiVersions.
(https://github.com/pulumi/pulumi-kubernetes/pull/779).
- Add PodAggregator for use by resource awaiters
(https://github.com/pulumi/pulumi-kubernetes/pull/785).

### Bug fixes

Expand Down
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.15.0
KUBE_VERSION ?= v1.16.0
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
23 changes: 17 additions & 6 deletions pkg/gen/typegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,22 @@ func fmtComment(

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"
v1FieldsV1 = "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"
v1beta1JSONSchemaPropsOrArray = apiextensionsV1beta1 + ".JSONSchemaPropsOrArray"
v1beta1JSON = apiextensionsV1beta1 + ".JSON"
v1beta1CRSubresourceStatus = apiextensionsV1beta1 + ".CustomResourceSubresourceStatus"
v1JSONSchemaPropsOrBool = apiextensionsV1 + ".JSONSchemaPropsOrBool"
v1JSONSchemaPropsOrArray = apiextensionsV1 + ".JSONSchemaPropsOrArray"
v1JSON = apiextensionsV1 + ".JSON"
v1CRSubresourceStatus = apiextensionsV1 + ".CustomResourceSubresourceStatus"
)

func makeTypescriptType(resourceType, propName string, prop map[string]interface{}, opts groupOpts) string {
Expand Down Expand Up @@ -423,16 +430,20 @@ func makeTypescriptType(resourceType, propName string, prop map[string]interface
ref = tsStringT
case intOrString:
ref = "number | string"
case v1Fields:
case v1Fields, v1FieldsV1, rawExtension:
ref = tsObject
case v1Time, v1MicroTime:
// TODO: Automatically deserialized with `DateConstructor`.
ref = tsStringT
case v1beta1JSONSchemaPropsOrBool:
ref = "apiextensions.v1beta1.JSONSchemaProps | boolean"
case v1JSONSchemaPropsOrBool:
ref = "apiextensions.v1.JSONSchemaProps | boolean"
case v1beta1JSONSchemaPropsOrArray:
ref = "apiextensions.v1beta1.JSONSchemaProps | any[]"
case v1beta1JSON, v1beta1CRSubresourceStatus:
case v1JSONSchemaPropsOrArray:
ref = "apiextensions.v1.JSONSchemaProps | any[]"
case v1beta1JSON, v1beta1CRSubresourceStatus, v1JSON, v1CRSubresourceStatus:
ref = "any"
default:
isSimpleRef = false
Expand Down Expand Up @@ -491,16 +502,16 @@ 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, v1FieldsV1, rawExtension:
ref = pyDictT
case v1Time, v1MicroTime:
// TODO: Automatically deserialized with `DateConstructor`.
ref = pyStringT
case v1beta1JSONSchemaPropsOrBool:
case v1beta1JSONSchemaPropsOrBool, v1JSONSchemaPropsOrBool:
ref = fmt.Sprintf("Union[%s, %s]", pyDictT, pyBoolT)
case v1beta1JSONSchemaPropsOrArray:
case v1beta1JSONSchemaPropsOrArray, v1JSONSchemaPropsOrArray:
ref = fmt.Sprintf("Union[%s, %s]", pyDictT, pyListT)
case v1beta1JSON, v1beta1CRSubresourceStatus:
case v1beta1JSON, v1beta1CRSubresourceStatus, v1JSON, v1CRSubresourceStatus:
ref = pyAnyT
default:
ref = pyDictT
Expand Down
3 changes: 2 additions & 1 deletion sdk/nodejs/admissionregistration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// *** Do not edit by hand unless you're certain you know what you are doing! ***

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

// Export sub-modules
export { v1beta1, };
export { v1, v1beta1, };

Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// *** 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";

/**
* MutatingWebhookConfiguration describes the configuration of and admission webhook that accept
* or reject and may change the object.
*/
export class MutatingWebhookConfiguration 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<"admissionregistration.k8s.io/v1">;

/**
* 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<"MutatingWebhookConfiguration">;

/**
* Standard object metadata; More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*/
public readonly metadata: pulumi.Output<outputs.meta.v1.ObjectMeta>;

/**
* Webhooks is a list of webhooks and the affected resources and operations.
*/
public readonly webhooks: pulumi.Output<outputs.admissionregistration.v1.MutatingWebhook[]>;

/**
* Get the state of an existing `MutatingWebhookConfiguration` 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): MutatingWebhookConfiguration {
return new MutatingWebhookConfiguration(name, undefined, { ...opts, id: id });
}

/** @internal */
private static readonly __pulumiType = "kubernetes:admissionregistration.k8s.io/v1:MutatingWebhookConfiguration";

/**
* Returns true if the given object is an instance of MutatingWebhookConfiguration. 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 MutatingWebhookConfiguration {
if (obj === undefined || obj === null) {
return false;
}

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

/**
* Create a admissionregistration.v1.MutatingWebhookConfiguration 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.admissionregistration.v1.MutatingWebhookConfiguration, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};

props["apiVersion"] = "admissionregistration.k8s.io/v1";
props["kind"] = "MutatingWebhookConfiguration";
props["metadata"] = args && args.metadata || undefined;
props["webhooks"] = args && args.webhooks || undefined;

props["status"] = undefined;

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

if (!opts.version) {
opts.version = getVersion();
}
super(MutatingWebhookConfiguration.__pulumiType, name, props, opts);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// *** 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";

/**
* MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
*/
export class MutatingWebhookConfigurationList 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<"admissionregistration.k8s.io/v1">;

/**
* List of MutatingWebhookConfiguration.
*/
public readonly items: pulumi.Output<outputs.admissionregistration.v1.MutatingWebhookConfiguration[]>;

/**
* 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<"MutatingWebhookConfigurationList">;

/**
* Standard list metadata. More info:
* https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
public readonly metadata: pulumi.Output<outputs.meta.v1.ListMeta>;

/**
* Get the state of an existing `MutatingWebhookConfigurationList` 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): MutatingWebhookConfigurationList {
return new MutatingWebhookConfigurationList(name, undefined, { ...opts, id: id });
}

/** @internal */
private static readonly __pulumiType = "kubernetes:admissionregistration.k8s.io/v1:MutatingWebhookConfigurationList";

/**
* Returns true if the given object is an instance of MutatingWebhookConfigurationList. 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 MutatingWebhookConfigurationList {
if (obj === undefined || obj === null) {
return false;
}

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

/**
* Create a admissionregistration.v1.MutatingWebhookConfigurationList 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.admissionregistration.v1.MutatingWebhookConfigurationList, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};
props["items"] = args && args.items || undefined;

props["apiVersion"] = "admissionregistration.k8s.io/v1";
props["kind"] = "MutatingWebhookConfigurationList";
props["metadata"] = args && args.metadata || undefined;

props["status"] = undefined;

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

if (!opts.version) {
opts.version = getVersion();
}
super(MutatingWebhookConfigurationList.__pulumiType, name, props, opts);
}
}
Loading