-
Notifications
You must be signed in to change notification settings - Fork 6
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
"Conflicting configuration arguments" when importing project #293
Comments
Thank you for reporting this issue @qerub I've filed pulumi/pulumi-terraform-bridge#1225 to investigate further as it seems like the problem could be affecting many bridged providers. Trying to think of possible workarounds. Could you try Pulumi import command as noted in https://www.pulumi.com/docs/using-pulumi/adopting-pulumi/import/ as an alternative way to import the resource? |
I worked around this issue for us by changing our import strategy to not have the offending field ( Here's how the import command behaves in this scenario: $ pulumi import gitlab:index/project:Project import_test_2 qerub/import_test_2
...
Diagnostics:
gitlab:index:Project (import_test_2):
warning: urn:pulumi:dev::pulum::gitlab:index/project:Project::import_test_2 verification warning: Use `container_registry_access_level` instead.
warning: urn:pulumi:dev::pulum::gitlab:index/project:Project::import_test_2 verification warning: Deprecated in favor of `builds_access_level`
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `gitlab` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: gitlab:index/project:Project resource 'import_test_2' has a problem: Conflicting configuration arguments: "container_expiration_policy.0.name_regex": conflicts with container_expiration_policy.0.name_regex_delete. Examine values at 'Project.ContainerExpirationPolicy.NameRegex'.
warning: gitlab:index/project:Project resource 'import_test_2' has a problem: Conflicting configuration arguments: "container_expiration_policy.0.name_regex_delete": conflicts with container_expiration_policy.0.name_regex. Examine values at 'Project.ContainerExpirationPolicy.NameRegexDelete'.
...
Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.
...
const import_test_2 = new gitlab.Project("import_test_2", {
...
containerExpirationPolicy: {
cadence: "1d",
keepN: 10,
nameRegex: ".*",
nameRegexDelete: ".*",
olderThan: "90d",
},
... I leave it up to you to decide whether the Pulumi GitLab Provider or Terraform Bridge has any blame in this or whether it's just GitLab and its Terraform Provider handling the fields |
Thanks so much for that comment, the fact that there is a workaround is very good to know. I believe there is indeed room for improvement in the Terraform Bridge made evident here. I'll leave the issue in the backlog for now and we will address it when we have capacity. |
Still reproduces on 6.7.0 unfortunately. |
Toward #1225 - this fixes the special case of ConflictsWith warnings. This fixes spurious warnings on `pulumi import`, popular bugs such as: - pulumi/pulumi-aws#2318 - pulumi/pulumi-aws#3670 - pulumi/pulumi-gitlab#293 - pulumi/pulumi-gcp#844 - pulumi/pulumi-linode#373 TF does not guarantee Read results to be compatible with calling Check on, in particular Read can return results that run afoul of ConflictsWith constraint. This change compensates by arbitrarily dropping data from the Read result until it passes ConflictsWith checks. This affects `pulumi refresh` as well as I think it should although I have not seen "in the wild" cases where refresh is affected, since it typically will not copy these properties to the input bag unless they're present in old inputs, which are usually correct wrt to ConflictsWith.
import * as pulumi from "@pulumi/pulumi";
import * as pulumi_gitlab from "@pulumi/gitlab";
const proj = new pulumi_gitlab.Project("import_test", {});
const proj2 = new pulumi_gitlab.Project("import_test_2", {},
{import: "pulumi/import_test-834ee8d"});
export const projId = proj.id;
export const projName = proj.name; This succeeds now without any issues for me. Stack:
I believe that the fix we deployed in pulumi-tetrraform-bridge to disambiguate Read results to avoid conflicts should fix the problem here. Closing for now but please open issues if something is still not working as you expect. |
What happened?
If I create a GitLab project outside of Pulumi and then try to import it with
the following (stopping/blocking) errors occur during preview:
The
ignoreChanges
might look contrived but this is a reduced test case.Expected Behavior
Expected behavior is to not get any errors about container expiration policy.
Steps to reproduce
See above.
Output of
pulumi about
CLI
Version 3.70.0
Go Version go1.20.4
Go Compiler gc
Plugins
NAME VERSION
gitlab 6.0.0
nodejs unknown
Host
OS fedora
Version 37
Arch x86_64
This project is written in nodejs: executable='/usr/bin/node' version='v18.16.0'
Current Stack: dev
TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::pulum::pulumi:pulumi:Stack::pulum-dev
pulumi:providers:gitlab urn:pulumi:dev::pulum::pulumi:providers:gitlab::default_6_0_0
gitlab:index/project:Project urn:pulumi:dev::pulum::gitlab:index/project:Project::example
Found no pending operations associated with dev
Backend
Name redacted
URL file:///redacted/.pulumi
User vagrant
Organizations
Dependencies:
NAME VERSION
@pulumi/gitlab 6.0.0
@pulumi/pulumi 3.72.0
@types/node 16.18.36
Pulumi locates its logs in /tmp by default
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: