Skip to content

Commit

Permalink
Fix Go SDK gen
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Oct 1, 2021
1 parent 32a4ed0 commit 92cea29
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 19 deletions.
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func writeGoClient(pkg *schema.Package, outdir string, templateDir string) {
deprecatedProviderFile = strings.ReplaceAll(deprecatedProviderFile, "\ntype", fmt.Sprintf("\n%s\ntype", deprecatedComment))
files["kubernetes/providers/provider.go"] = []byte(deprecatedProviderFile)

files["kubernetes/pulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "pulumiTypes.go"))
files["kubernetes/customPulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "customPulumiTypes.go"))
files["kubernetes/apiextensions/customResource.go"] = mustLoadGoFile(filepath.Join(templateDir, "apiextensions", "customResource.go"))
files["kubernetes/helm/v2/chart.go"] = mustLoadGoFile(filepath.Join(templateDir, "helm", "v2", "chart.go"))
files["kubernetes/helm/v2/pulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "helm", "v2", "pulumiTypes.go"))
Expand Down
29 changes: 29 additions & 0 deletions sdk/go/kubernetes/customPulumiTypes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2016-2020, Pulumi Corporation.
//
// 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.

// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package kubernetes

import (
"reflect"
)

// UntypedArgs is an untyped interface that is required for YAML and CustomResource support.
type UntypedArgs map[string]interface{}

func (UntypedArgs) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]interface{})(nil)).Elem()
}
182 changes: 164 additions & 18 deletions sdk/go/kubernetes/pulumiTypes.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,175 @@
// Copyright 2016-2020, Pulumi Corporation.
//
// 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.

// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package kubernetes

import (
"context"
"reflect"

"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

// UntypedArgs is an untyped interface that is required for YAML and CustomResource support.
type UntypedArgs map[string]interface{}
// Options for tuning the Kubernetes client used by a Provider.
type KubeClientSettings struct {
// Maximum burst for throttle. Default value is 10.
Burst *int `pulumi:"burst"`
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
Qps *float64 `pulumi:"qps"`
}

// KubeClientSettingsInput is an input type that accepts KubeClientSettingsArgs and KubeClientSettingsOutput values.
// You can construct a concrete instance of `KubeClientSettingsInput` via:
//
// KubeClientSettingsArgs{...}
type KubeClientSettingsInput interface {
pulumi.Input

ToKubeClientSettingsOutput() KubeClientSettingsOutput
ToKubeClientSettingsOutputWithContext(context.Context) KubeClientSettingsOutput
}

// Options for tuning the Kubernetes client used by a Provider.
type KubeClientSettingsArgs struct {
// Maximum burst for throttle. Default value is 10.
Burst pulumi.IntPtrInput `pulumi:"burst"`
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
Qps pulumi.Float64PtrInput `pulumi:"qps"`
}

func (KubeClientSettingsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*KubeClientSettings)(nil)).Elem()
}

func (i KubeClientSettingsArgs) ToKubeClientSettingsOutput() KubeClientSettingsOutput {
return i.ToKubeClientSettingsOutputWithContext(context.Background())
}

func (i KubeClientSettingsArgs) ToKubeClientSettingsOutputWithContext(ctx context.Context) KubeClientSettingsOutput {
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsOutput)
}

func (i KubeClientSettingsArgs) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
return i.ToKubeClientSettingsPtrOutputWithContext(context.Background())
}

func (i KubeClientSettingsArgs) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsOutput).ToKubeClientSettingsPtrOutputWithContext(ctx)
}

// KubeClientSettingsPtrInput is an input type that accepts KubeClientSettingsArgs, KubeClientSettingsPtr and KubeClientSettingsPtrOutput values.
// You can construct a concrete instance of `KubeClientSettingsPtrInput` via:
//
// KubeClientSettingsArgs{...}
//
// or:
//
// nil
type KubeClientSettingsPtrInput interface {
pulumi.Input

ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput
ToKubeClientSettingsPtrOutputWithContext(context.Context) KubeClientSettingsPtrOutput
}

type kubeClientSettingsPtrType KubeClientSettingsArgs

func KubeClientSettingsPtr(v *KubeClientSettingsArgs) KubeClientSettingsPtrInput {
return (*kubeClientSettingsPtrType)(v)
}

func (*kubeClientSettingsPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**KubeClientSettings)(nil)).Elem()
}

func (i *kubeClientSettingsPtrType) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
return i.ToKubeClientSettingsPtrOutputWithContext(context.Background())
}

func (i *kubeClientSettingsPtrType) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsPtrOutput)
}

// Options for tuning the Kubernetes client used by a Provider.
type KubeClientSettingsOutput struct{ *pulumi.OutputState }

func (KubeClientSettingsOutput) ElementType() reflect.Type {
return reflect.TypeOf((*KubeClientSettings)(nil)).Elem()
}

func (o KubeClientSettingsOutput) ToKubeClientSettingsOutput() KubeClientSettingsOutput {
return o
}

func (o KubeClientSettingsOutput) ToKubeClientSettingsOutputWithContext(ctx context.Context) KubeClientSettingsOutput {
return o
}

func (o KubeClientSettingsOutput) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
return o.ToKubeClientSettingsPtrOutputWithContext(context.Background())
}

func (o KubeClientSettingsOutput) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v KubeClientSettings) *KubeClientSettings {
return &v
}).(KubeClientSettingsPtrOutput)
}

// Maximum burst for throttle. Default value is 10.
func (o KubeClientSettingsOutput) Burst() pulumi.IntPtrOutput {
return o.ApplyT(func(v KubeClientSettings) *int { return v.Burst }).(pulumi.IntPtrOutput)
}

// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
func (o KubeClientSettingsOutput) Qps() pulumi.Float64PtrOutput {
return o.ApplyT(func(v KubeClientSettings) *float64 { return v.Qps }).(pulumi.Float64PtrOutput)
}

type KubeClientSettingsPtrOutput struct{ *pulumi.OutputState }

func (KubeClientSettingsPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**KubeClientSettings)(nil)).Elem()
}

func (o KubeClientSettingsPtrOutput) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
return o
}

func (o KubeClientSettingsPtrOutput) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
return o
}

func (o KubeClientSettingsPtrOutput) Elem() KubeClientSettingsOutput {
return o.ApplyT(func(v *KubeClientSettings) KubeClientSettings {
if v != nil {
return *v
}
var ret KubeClientSettings
return ret
}).(KubeClientSettingsOutput)
}

// Maximum burst for throttle. Default value is 10.
func (o KubeClientSettingsPtrOutput) Burst() pulumi.IntPtrOutput {
return o.ApplyT(func(v *KubeClientSettings) *int {
if v == nil {
return nil
}
return v.Burst
}).(pulumi.IntPtrOutput)
}

// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
func (o KubeClientSettingsPtrOutput) Qps() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *KubeClientSettings) *float64 {
if v == nil {
return nil
}
return v.Qps
}).(pulumi.Float64PtrOutput)
}

func (UntypedArgs) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]interface{})(nil)).Elem()
func init() {
pulumi.RegisterOutputType(KubeClientSettingsOutput{})
pulumi.RegisterOutputType(KubeClientSettingsPtrOutput{})
}

0 comments on commit 92cea29

Please sign in to comment.