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

Cannot set proxy URL #160

Open
t0yv0 opened this issue Jan 6, 2023 · 2 comments
Open

Cannot set proxy URL #160

t0yv0 opened this issue Jan 6, 2023 · 2 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@t0yv0
Copy link
Member

t0yv0 commented Jan 6, 2023

What happened?

Unable to set the provider-level configuration to use a proxy URL.

[nix-shell:~/code/pulumi-tls/examples/get-cert/golang]$  pulumi preview
Previewing update (dev)

View Live: https://app.pulumi.com/t0yv0/golang/dev/previews/5b4a23b9-ba60-4e54-9ecf-b16180e487f9

     Type                     Name         Plan       Info
 +   pulumi:pulumi:Stack      golang-dev   create     1 error
 +   └─ pulumi:providers:tls  tlsprovider  create     


Diagnostics:
  pulumi:pulumi:Stack (golang-dev):
    error: an unhandled error occurred: program failed:
    1 error occurred:
        * rpc error: code = Unknown desc = invocation of tls:index/getCertificate:getCertificate returned an error: could not validate provider configuration: 2 errors occurred:
        * Conflicting configuration arguments: "proxy.0.url": conflicts with proxy.0.from_env
        * Conflicting configuration arguments: "proxy.0.from_env": conflicts with proxy.0.url

Steps to reproduce

// Copyright 2016-2023, 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.

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

	"github.com/pulumi/pulumi-tls/sdk/v4/go/tls"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		prov, err := tls.NewProvider(ctx, "tlsprovider", &tls.ProviderArgs{
			Proxy: tls.ProviderProxyArgs{
				Url:     pulumi.String("https://localhost:8080"),
				FromEnv: pulumi.Bool(false),
			},
		})

		if err != nil {
			return err
		}

		url := "https://pulumi.com"
		res, err := tls.GetCertificate(ctx, &tls.GetCertificateArgs{
			Url: &url,
		}, pulumi.Provider(prov))
		if err != nil {
			return err
		}

		ctx.Export("issuer", pulumi.String(res.Certificates[2].Issuer))
		return nil
	})
}

Expected Behavior

Invoke respects proxy URL.

Actual Behavior

Program fails.

Output of pulumi about

CLI          
Version      3.51.0
Go Version   go1.19.4
Go Compiler  gc

Plugins
NAME  VERSION
go    unknown
tls   4.6.1

Host     
OS       darwin
Version  13.0.1
Arch     x86_64

This project is written in go: executable='/Users/t0yv0/.nix-profile/bin/go' version='go version go1.19 darwin/amd64'

Current Stack: t0yv0/golang/dev

Found no resources associated with dev

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/t0yv0
User           t0yv0
Organizations  t0yv0, pulumi

Dependencies:
NAME                                 VERSION
github.com/pulumi/pulumi-tls/sdk/v4  4.6.1
github.com/pulumi/pulumi/sdk/v3      3.51.0

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).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team and removed needs-triage Needs attention from the triage team labels Jan 6, 2023
@t0yv0 t0yv0 added the resolution/fixed This issue was fixed label Jan 27, 2023
@t0yv0
Copy link
Member Author

t0yv0 commented Jan 27, 2023

Fixed in v4.7.0

@t0yv0 t0yv0 closed this as completed Jan 27, 2023
@t0yv0 t0yv0 added this to the 0.84 milestone Jan 27, 2023
@t0yv0 t0yv0 self-assigned this Jan 27, 2023
@t0yv0
Copy link
Member Author

t0yv0 commented Jul 27, 2023

Running into this again. This reproduces on 4.10.0 which is the latest published version. It does not reproduce on master so it's fixed on master. It will be fixed once we can release, currently awaiting upstream release on the new Plugin Framework version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant