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

How to contribute? #569

Closed
SnelsSM opened this issue Sep 29, 2024 · 2 comments
Closed

How to contribute? #569

SnelsSM opened this issue Sep 29, 2024 · 2 comments
Labels
kind/question Questions about existing features needs-triage Needs attention from the triage team

Comments

@SnelsSM
Copy link

SnelsSM commented Sep 29, 2024

Hi!
For example, I want to add some new fields to the schema.

  1. Forking the repo

  2. Update schema.json

    diff --git a/provider/cmd/pulumi-resource-rancher2/schema.json b/provider/cmd/pulumi-resource-rancher2/schema.json
    index 6e0599c9..8b5442fb 100644
    --- a/provider/cmd/pulumi-resource-rancher2/schema.json
    +++ b/provider/cmd/pulumi-resource-rancher2/schema.json
    @@ -8263,6 +8263,13 @@
                         "$ref": "#/types/rancher2:index/ClusterV2RkeConfigMachinePoolMachineConfig:ClusterV2RkeConfigMachinePoolMachineConfig",
                         "description": "Machine config data\n"
                     },
    +                "machineDeploymentAnnotations": {
    +                    "type": "object",
    +                    "additionalProperties": {
    +                        "type": "string"
    +                    },
    +                    "description": "MachineDeploymentAnnotations of the machine\n"
    +                },
                     "machineLabels": {
                         "type": "object",
                         "additionalProperties": {
    @@ -18573,6 +18580,13 @@
                         "$ref": "#/types/rancher2:index/getClusterV2RkeConfigMachinePoolMachineConfig:getClusterV2RkeConfigMachinePoolMachineConfig",
                         "description": "Machine config data\n"
                     },
    +                "machineDeploymentAnnotations": {
    +                    "type": "object",
    +                    "additionalProperties": {
    +                        "type": "string"
    +                    },
    +                    "description": "MachineDeploymentAnnotations of the machine\n"
    +                },
                     "machineLabels": {
                         "type": "object",
                         "additionalProperties": {
  3. Update bridge-metadata.json

    diff --git a/provider/cmd/pulumi-resource-rancher2/bridge-metadata.json b/provider/cmd/pulumi-resource-rancher2/bridge-metadata.json
    index b9be0766..5f442a11 100644
    --- a/provider/cmd/pulumi-resource-rancher2/bridge-metadata.json
    +++ b/provider/cmd/pulumi-resource-rancher2/bridge-metadata.json
    @@ -4574,6 +4574,7 @@
                     "etcdRole": "etcd_role",
                     "hostnameLengthLimit": "hostname_length_limit",
                     "machineConfig": "machine_config",
    +                "machineDeploymentAnnotations": "machine_deployment_annotations",
                     "machineLabels": "machine_labels",
                     "maxUnhealthy": "max_unhealthy",
                     "nodeDrainTimeout": "node_drain_timeout",
    @@ -6721,6 +6722,7 @@
                     "etcdRole": "etcd_role",
                     "hostnameLengthLimit": "hostname_length_limit",
                     "machineConfig": "machine_config",
    +                "machineDeploymentAnnotations": "machine_deployment_annotations",
                     "machineLabels": "machine_labels",
                     "maxUnhealthy": "max_unhealthy",
                     "nodeDrainTimeout": "node_drain_timeout",
  4. run

make tfgen_no_deps

And now all my changes are in schema.json is being droped.
Yes, i can use something like

pulumictl generate -i provider/cmd/pulumi-resource-rancher2/schema.json -o test-go/ -l go

But it seems that this is the wrong way.
5. Also run

make provider_no_deps

but no new fields in ./pulumi-resource-rancher2 -get-provider-info output

How can I make changes and test the plugin locally before creating a pull request?

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Sep 29, 2024
@VenelinMartinov
Copy link
Contributor

Hi @SnelsSM, thanks for the interest and for opening an issue! Sorry the process for contributing isn't clearer.

A thing to note is that the pulumi-rancher2 provider is based on https://github.com/rancher/terraform-provider-rancher2 - we use the https://github.com/pulumi/pulumi-terraform-bridge to generate the pulumi schema and to translate the runtime calls.

Given that it seems that you are trying to add new parameters for the resources your best bet would be to contribute them to the terraform provider and we will inherit them in the pulumi provider with the next release!

LMK If you have any other questions around this.

@VenelinMartinov VenelinMartinov added kind/question Questions about existing features awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Sep 30, 2024
@SnelsSM
Copy link
Author

SnelsSM commented Sep 30, 2024

@VenelinMartinov thanks! And now I realized that everything has already been done before me =)
https://github.com/rancher/terraform-provider-rancher2/blob/4336cd6ad945e8ae9d789b549a4c08fb55549d40/rancher2/structure_cluster_v2_rke_config_machine_pool.go#L66

ClusterV2RkeConfigMachinePoolArgs.Annotations - that's what I needed.

@SnelsSM SnelsSM closed this as completed Sep 30, 2024
@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions about existing features needs-triage Needs attention from the triage team
Projects
None yet
Development

No branches or pull requests

3 participants