1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 18:47:19 +01:00
Files
installer/vendor/github.com/pkg/browser/browser_linux.go
Rafael Fonseca 897b6226e8 azure: azidentity: update go.mod and vendor
Notice that azblob also had to be upgraded to 0.4.1, otherwise we hit
the following build issue:

vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_blob_lease_client.go:25:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_block_blob_client.go:145:20: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_container_lease_client.go:25:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_shared_policy_shared_key_credential.go:190:17: undefined: log.EventResponse
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zm_lease_request_options.go:63:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zm_lease_request_options.go:142:16: undefined: to.StringPtr

and newer versions cause

pkg/gather/azure/azure.go:224:29: undefined: azblob.NewBlobClientWithSharedKey
pkg/gather/azure/azure.go:235:48: unknown field 'MaxRetryRequests' in struct literal of type blob.RetryReaderOptions
2022-12-05 18:09:14 +01:00

22 lines
563 B
Go

package browser
import (
"os/exec"
"strings"
)
func openBrowser(url string) error {
providers := []string{"xdg-open", "x-www-browser", "www-browser"}
// There are multiple possible providers to open a browser on linux
// One of them is xdg-open, another is x-www-browser, then there's www-browser, etc.
// Look for one that exists and run it
for _, provider := range providers {
if _, err := exec.LookPath(provider); err == nil {
return runCmd(provider, url)
}
}
return &exec.Error{Name: strings.Join(providers, ","), Err: exec.ErrNotFound}
}