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

ConfigFile V2 (Component) #2862

Merged
merged 8 commits into from
Mar 8, 2024
Merged

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Mar 5, 2024

Proposed changes

This PR implements a new ConfigFile 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, and Kubernetes-style transformation may come in future.
  4. The file property is required and the file must exist.

Examples

Here's some usage examples.

YAML

name: issue-2785
runtime: yaml
description: A minimal Kubernetes Pulumi YAML program
resources:
  cf:
    type: kubernetes:yaml/v2:ConfigFile
    properties:
      file: ./manifest.yaml

NodeJS

import * as pulumi from "@pulumi/pulumi";
import * as kubernetes from "@pulumi/kubernetes";

const configFile = new kubernetes.yaml.v2.ConfigFile("my-config-file", {
    file: "./manifest.yaml"
});

const cm = configFile.resources[0].apply(r => r as kubernetes.core.v1.ConfigMap);
export const configmap = pulumi.interpolate`${cm.metadata.namespace}/${cm.metadata.name}`;

Testing

  1. New tests of ConfigFile were added to the test suite for the "yaml/v2" package.

Related issues (optional)

Closes #2785

provider/pkg/gen/examples/overlays/configGroupV2.md Outdated Show resolved Hide resolved
provider/pkg/gen/overlays.go Outdated Show resolved Hide resolved
provider/pkg/provider/yaml/v2/configfile.go Show resolved Hide resolved
provider/pkg/provider/yaml/v2/configfile.go Outdated Show resolved Hide resolved
@EronWright EronWright self-assigned this Mar 6, 2024
@EronWright EronWright force-pushed the eronwright/issue-2784-configgroup branch 2 times, most recently from f28f9f1 to 006dd0d Compare March 8, 2024 00:20
@EronWright EronWright force-pushed the eronwright/issue-2785-configfile branch from 45cd459 to d4a60d9 Compare March 8, 2024 07:25
Copy link
Contributor

@rquitales rquitales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Changes are aligned with the introductions made in the ConfigGroup PR.

@EronWright EronWright force-pushed the eronwright/issue-2784-configgroup branch from 006dd0d to 4388af3 Compare March 8, 2024 20:17
Base automatically changed from eronwright/issue-2784-configgroup to master March 8, 2024 20:59
@EronWright EronWright force-pushed the eronwright/issue-2785-configfile branch from 02ca515 to e239108 Compare March 8, 2024 21:42
Copy link

github-actions bot commented Mar 8, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.

New resources:

  • yaml/v2.ConfigFile

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 26.84%. Comparing base (6951ed5) to head (0b0b7c9).

Files Patch % Lines
provider/pkg/provider/yaml/v2/configfile.go 80.64% 3 Missing and 3 partials ⚠️
provider/pkg/gen/schema.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2862      +/-   ##
==========================================
+ Coverage   26.62%   26.84%   +0.21%     
==========================================
  Files          52       53       +1     
  Lines        7688     7722      +34     
==========================================
+ Hits         2047     2073      +26     
- Misses       5471     5476       +5     
- Partials      170      173       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EronWright EronWright enabled auto-merge (squash) March 8, 2024 22:13
@EronWright EronWright merged commit c59ddff into master Mar 8, 2024
20 checks passed
@EronWright EronWright deleted the eronwright/issue-2785-configfile branch March 8, 2024 22:54
lumiere-bot bot added a commit to coolguy1771/home-ops that referenced this pull request Apr 12, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@pulumi/kubernetes](https://pulumi.com)
([source](https://togithub.com/pulumi/pulumi-kubernetes)) | dependencies
| minor | [`4.9.1` ->
`4.10.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.9.1/4.10.0)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>pulumi/pulumi-kubernetes (@&#8203;pulumi/kubernetes)</summary>

###
[`v4.10.0`](https://togithub.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#4100-April-11-2024)

[Compare
Source](https://togithub.com/pulumi/pulumi-kubernetes/compare/v4.9.1...v4.10.0)

- ConfigGroup V2
([pulumi/pulumi-kubernetes#2844)
- ConfigFile V2
([pulumi/pulumi-kubernetes#2862)
- Bugfix for ambiguous kinds
([pulumi/pulumi-kubernetes#2889)
- \[yaml/v2] Support for resource ordering
[pulumi/pulumi-kubernetes#2894)
- Bugfix for deployment await logic not referencing the correct
deployment status
([pulumi/pulumi-kubernetes#2943)

##### New Features

A new MLC-based implementation of `ConfigGroup` and of `ConfigFile` is
now available in the "yaml/v2" package. These resources are
usable in all Pulumi languages, including Pulumi YAML and in the Java
Pulumi SDK.

Note that transformations aren't supported in this release (see
[pulumi/pulumi#12996).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yODcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjI4Ny4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9ucG0iLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop Component resource for: kubernetes:yaml:ConfigFile
4 participants