-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR implements a new `ConfigGroup` resource (v2) as a Pulumi multi-language component (MLC). The new resource is offered side-by-side with the existing (v1) resource; it is not a drop-in replacement at this time. Some notable differences with respect to the previous (overlay) implementations: 1. Implemented as an MLC to have a consistent implementation across SDKs and to extend support for YAML and Java. 2. The component name is used as a prefix for the child resource names. Use the `resourcePrefix` property to override. Note that the `resourcePrefix` is not applied to the Kubernetes object names. 3. Transformations aren't supported (yet). Support for Pulumi-style transformation is being tracked [here](pulumi/pulumi#12996), and Kubernetes-style transformation may come in future. Closes #2784
- Loading branch information
1 parent
7246ed3
commit 6951ed5
Showing
40 changed files
with
4,635 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2016-2024, 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 v2 | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/apiextensions" | ||
{{- range .Imports}} | ||
{{.}} | ||
{{- end}} | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func IsListKind(apiVersion, kind string) bool { | ||
fullKind := fmt.Sprintf("%s/%s", apiVersion, kind) | ||
switch fullKind { | ||
case "v1/List", | ||
{{range $idx, $v := .ListKinds -}} {{if $idx}}, | ||
{{end}}"{{$v.GVK}}" {{- end}}: | ||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
func RegisterResource(ctx *pulumi.Context, apiVersion, kind, name string, props pulumi.Input, | ||
opts ...pulumi.ResourceOption) (pulumi.CustomResource, error) { | ||
fullKind := fmt.Sprintf("%s/%s", apiVersion, kind) | ||
switch fullKind { | ||
{{- range .NonListKinds}} | ||
case "{{.GVK}}": | ||
var res {{.Alias}}.{{.Name}} | ||
err := ctx.RegisterResource("{{.Token}}", name, props, &res, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
{{`return &res, nil`}} | ||
{{- end}} | ||
default: | ||
var res apiextensions.CustomResource | ||
err := ctx.RegisterResource(fmt.Sprintf("kubernetes:%s:%s", apiVersion, kind), name, props, &res, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
{{`return &res, nil`}} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.