Skip to content

Commit

Permalink
Update to 1.18.0-alpha.1 and merge changes on v.1.17.0 swagger spec
Browse files Browse the repository at this point in the history
To maintain support for deprecated API resources in our SDKs, merge
new swagger specs on top of the v1.17.0 spec, which was the last
version containing these definitions.
  • Loading branch information
lblackstone committed Jan 2, 2020
1 parent 085e7db commit 50388b7
Show file tree
Hide file tree
Showing 10 changed files with 2,110 additions and 446 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PROVIDER := pulumi-resource-${PACK}
CODEGEN := pulumi-gen-${PACK}
VERSION ?= $(shell scripts/get-version)
PYPI_VERSION := $(shell scripts/get-py-version)
KUBE_VERSION ?= v1.18.0-alpha.0
KUBE_VERSION ?= v1.18.0-alpha.1
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: 20 additions & 3 deletions cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package main

import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
Expand All @@ -25,6 +24,16 @@ import (
"github.com/pulumi/pulumi-kubernetes/pkg/gen"
)

// This is the URL for the v1.17.0 swagger spec. This is the last version of the spec containing the following
// deprecated resources:
// - extensions/v1beta1/*
// - apps/v1beta1/*
// - apps/v1beta2/*
// Since these resources will continue to be important to users for the foreseeable future, we will merge in
// newer specs on top of this spec so that these resources continue to be available in our SDKs.
const Swagger117Url = "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.17.0/api/openapi-spec/swagger.json"
const Swagger117FileName = "swagger-v1.17.0.json"

func main() {
if len(os.Args) < 5 {
log.Fatal("Usage: gen <language> <swagger-file> <template-dir> <out-dir>")
Expand All @@ -37,11 +46,19 @@ func main() {
panic(err)
}

data := map[string]interface{}{}
err = json.Unmarshal(swagger, &data)
swaggerDir := filepath.Dir(os.Args[2])

legacySwaggerPath := filepath.Join(swaggerDir, Swagger117FileName)
err = DownloadFile(legacySwaggerPath, Swagger117Url)
if err != nil {
panic(err)
}
legacySwagger, err := ioutil.ReadFile(legacySwaggerPath)
if err != nil {
panic(err)
}
mergedSwagger := mergeSwaggerSpecs(legacySwagger, swagger)
data := mergedSwagger.(map[string]interface{})

templateDir := os.Args[3]
outdir := fmt.Sprintf("%s/%s", os.Args[4], language)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/pulumi/pulumi-kubernetes
go 1.13

require (
github.com/RaveNoX/go-jsonmerge v1.0.0
github.com/ahmetb/go-linq v3.0.0+incompatible
github.com/cbroglie/mustache v1.0.1
github.com/docker/docker v1.13.1 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/RaveNoX/go-jsonmerge v1.0.0 h1:2e0nqnadoGUP8rAvcA0hkQelZreVO5X3BHomT2XMrAk=
github.com/RaveNoX/go-jsonmerge v1.0.0/go.mod h1:qYM/NA77LhO4h51JJM7Z+xBU3ovqrNIACZe+SkSNVFo=
github.com/Sirupsen/logrus v1.0.5 h1:447dy9LxSj+Iaa2uN3yoFHOzU9yJcJYiQPtNz8OXtv0=
github.com/Sirupsen/logrus v1.0.5/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U=
github.com/ahmetb/go-linq v3.0.0+incompatible h1:qQkjjOXKrKOTy83X8OpRmnKflXKQIL/mC/gMVVDMhOA=
Expand All @@ -82,6 +85,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/cbroglie/mustache v1.0.1 h1:ivMg8MguXq/rrz2eu3tw6g3b16+PQhoTn6EZAhst2mw=
github.com/cbroglie/mustache v1.0.1/go.mod h1:R/RUa+SobQ14qkP4jtx5Vke5sDytONDQXNLPY/PO69g=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -280,6 +284,7 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8=
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
Expand Down Expand Up @@ -422,6 +427,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
38 changes: 19 additions & 19 deletions sdk/dotnet/Types/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3447,15 +3447,6 @@ public class APIServiceSpecArgs : Pulumi.ResourceArgs
[Input("groupPriorityMinimum", required: true)]
public Input<int> GroupPriorityMinimum { get; set; } = null!;

/// <summary>
/// Service is a reference to the service for this API server. It must communicate on port
/// 443 If the Service is nil, that means the handling for the API groupversion is handled
/// locally on this server. The call will simply delegate to the normal handler chain to be
/// fulfilled.
/// </summary>
[Input("service", required: true)]
public Input<ApiRegistration.V1.ServiceReferenceArgs> Service { get; set; } = null!;

/// <summary>
/// VersionPriority controls the ordering of this API version inside of its group. Must be
/// greater than zero. The primary sort is based on VersionPriority, ordered highest to
Expand Down Expand Up @@ -3493,6 +3484,15 @@ public class APIServiceSpecArgs : Pulumi.ResourceArgs
[Input("insecureSkipTLSVerify")]
public Input<bool>? InsecureSkipTLSVerify { get; set; }

/// <summary>
/// Service is a reference to the service for this API server. It must communicate on port
/// 443 If the Service is nil, that means the handling for the API groupversion is handled
/// locally on this server. The call will simply delegate to the normal handler chain to be
/// fulfilled.
/// </summary>
[Input("service")]
public Input<ApiRegistration.V1.ServiceReferenceArgs>? Service { get; set; }

/// <summary>
/// Version is the API version this server hosts. For example, "v1"
/// </summary>
Expand Down Expand Up @@ -3680,15 +3680,6 @@ public class APIServiceSpecArgs : Pulumi.ResourceArgs
[Input("groupPriorityMinimum", required: true)]
public Input<int> GroupPriorityMinimum { get; set; } = null!;

/// <summary>
/// Service is a reference to the service for this API server. It must communicate on port
/// 443 If the Service is nil, that means the handling for the API groupversion is handled
/// locally on this server. The call will simply delegate to the normal handler chain to be
/// fulfilled.
/// </summary>
[Input("service", required: true)]
public Input<ApiRegistration.V1Beta1.ServiceReferenceArgs> Service { get; set; } = null!;

/// <summary>
/// VersionPriority controls the ordering of this API version inside of its group. Must be
/// greater than zero. The primary sort is based on VersionPriority, ordered highest to
Expand Down Expand Up @@ -3726,6 +3717,15 @@ public class APIServiceSpecArgs : Pulumi.ResourceArgs
[Input("insecureSkipTLSVerify")]
public Input<bool>? InsecureSkipTLSVerify { get; set; }

/// <summary>
/// Service is a reference to the service for this API server. It must communicate on port
/// 443 If the Service is nil, that means the handling for the API groupversion is handled
/// locally on this server. The call will simply delegate to the normal handler chain to be
/// fulfilled.
/// </summary>
[Input("service")]
public Input<ApiRegistration.V1Beta1.ServiceReferenceArgs>? Service { get; set; }

/// <summary>
/// Version is the API version this server hosts. For example, "v1"
/// </summary>
Expand Down Expand Up @@ -25838,7 +25838,7 @@ public InputMap<string> DisruptedPods
}

/// <summary>
/// Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and
/// Most recent generation observed when updating this PDB status. DisruptionsAllowed and
/// other status information is valid only if observedGeneration equals to PDB's object
/// generation.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Types/Output.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29355,7 +29355,7 @@ public sealed class PodDisruptionBudgetStatus
public readonly int ExpectedPods;

/// <summary>
/// Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and
/// Most recent generation observed when updating this PDB status. DisruptionsAllowed and
/// other status information is valid only if observedGeneration equals to PDB's object
/// generation.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion sdk/nodejs/discovery/v1beta1/EndpointSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { getVersion } from "../../version";
* this slice must be the same type. This field is immutable after creation. The following
* address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6:
* Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
* * FQDN: Represents a Fully Qualified Domain Name. Default is IP
*/
public readonly addressType: pulumi.Output<string>;

Expand Down
Loading

0 comments on commit 50388b7

Please sign in to comment.