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 bump dependencies in Kubernetes projects due to census-instrumentation/opencensus-proto #413

Closed
justaugustus opened this issue Jun 25, 2019 · 18 comments

Comments

@justaugustus
Copy link

I've tried several combinations of versions of azure-sdk-for-go and go-autorest but have been unsuccessful in updating dependencies for the cluster-api-provider-azure Kubernetes project.

Here are the output logs for the current PR I have open to test (kubernetes-sigs/cluster-api-provider-azure#216):

$ time make test
GOPATH=/home/augustus/go bazel run //:generate 
Starting local Bazel server and connecting to it...
INFO: Analysed target //:generate (17 packages loaded, 168 targets configured).
INFO: Found 1 target...
Target //:generate up-to-date:
  bazel-bin/generate_script
  bazel-bin/generate
INFO: Elapsed time: 21.646s, Critical Path: 0.14s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
make dep-ensure
make[1]: Entering directory '/home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure'
Repository is set up correctly
INFO: Analysed target //:dep (57 packages loaded, 7728 targets configured).
INFO: Found 1 target...
Target //:dep up-to-date:
  bazel-bin/dep_script
  bazel-bin/dep
INFO: Elapsed time: 5.101s, Critical Path: 0.28s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
make gazelle
make[2]: Entering directory '/home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure'
bazel run //:gazelle 
INFO: Analysed target //:gazelle (25 packages loaded, 124 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
  bazel-bin/gazelle-runner.bash
  bazel-bin/gazelle
INFO: Elapsed time: 2.352s, Critical Path: 0.33s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
gazelle: open /home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure/vendor/k8s.io/kubernetes/BUILD.bazel: no such file or directory
make[2]: Leaving directory '/home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure'
make[1]: Leaving directory '/home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure'
bazel build  //pkg/cloud/azure/mocks:mocks \
	//pkg/cloud/azure/services/disks/mock_disks:mocks \
	//pkg/cloud/azure/services/availabilityzones/mock_availabilityzones:mocks \
	//pkg/cloud/azure/services/groups/mock_groups:mocks \
	//pkg/cloud/azure/services/internalloadbalancers/mock_internalloadbalancers:mocks \
	//pkg/cloud/azure/services/networkinterfaces/mock_networkinterfaces:mocks \
	//pkg/cloud/azure/services/publicips/mock_publicips:mocks \
	//pkg/cloud/azure/services/publicloadbalancers/mock_publicloadbalancers:mocks \
	//pkg/cloud/azure/services/routetables/mock_routetables:mocks \
	//pkg/cloud/azure/services/securitygroups/mock_securitygroups:mocks \
	//pkg/cloud/azure/services/subnets/mock_subnets:mocks \
	//pkg/cloud/azure/services/virtualmachineextensions/mock_virtualmachineextensions:mocks \
	//pkg/cloud/azure/services/virtualmachines/mock_virtualmachines:mocks \
	//pkg/cloud/azure/services/virtualnetworks/mock_virtualnetworks:mocks
INFO: Analysed 14 targets (173 packages loaded, 2271 targets configured).
INFO: Found 14 targets...
ERROR: /home/augustus/go/src/sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent/BUILD.bazel:3:1: GoCompile vendor/contrib.go.opencensus.io/exporter/ocagent/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent.a failed (Exit 1) builder failed: error executing command 
  (cd /home/augustus/.cache/bazel/_bazel_augustus/bd8987116252386267e76c13b740e64e/sandbox/linux-sandbox/2/execroot/__main__ && \
  exec env - \
    CGO_ENABLED=1 \
    GOARCH=amd64 \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=/usr/bin:/bin \
  bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src vendor/contrib.go.opencensus.io/exporter/ocagent/common.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/nodeinfo.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/options.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/version.go -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1.a=' -arc 'github.com/golang/protobuf/ptypes/timestamp=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/golang/protobuf/ptypes/timestamp=bazel-out/host/bin/vendor/github.com/golang/protobuf/ptypes/timestamp/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/golang/protobuf/ptypes/timestamp.a=' -arc 'go.opencensus.io=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io=bazel-out/host/bin/vendor/go.opencensus.io/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io.a=' -arc 'go.opencensus.io/plugin/ocgrpc=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/plugin/ocgrpc=bazel-out/host/bin/vendor/go.opencensus.io/plugin/ocgrpc/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/plugin/ocgrpc.a=' -arc 'go.opencensus.io/resource=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/resource=bazel-out/host/bin/vendor/go.opencensus.io/resource/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/resource.a=' -arc 'go.opencensus.io/stats=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats=bazel-out/host/bin/vendor/go.opencensus.io/stats/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats.a=' -arc 'go.opencensus.io/stats/view=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats/view=bazel-out/host/bin/vendor/go.opencensus.io/stats/view/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats/view.a=' -arc 'go.opencensus.io/tag=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/tag=bazel-out/host/bin/vendor/go.opencensus.io/tag/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/tag.a=' -arc 'go.opencensus.io/trace=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace=bazel-out/host/bin/vendor/go.opencensus.io/trace/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace.a=' -arc 'go.opencensus.io/trace/tracestate=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace/tracestate=bazel-out/host/bin/vendor/go.opencensus.io/trace/tracestate/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace/tracestate.a=' -arc 'google.golang.org/api/support/bundler=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/api/support/bundler=bazel-out/host/bin/vendor/google.golang.org/api/support/bundler/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/api/support/bundler.a=' -arc 'google.golang.org/grpc=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc=bazel-out/host/bin/vendor/google.golang.org/grpc/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc.a=' -arc 'google.golang.org/grpc/credentials=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/credentials=bazel-out/host/bin/vendor/google.golang.org/grpc/credentials/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/credentials.a=' -arc 'google.golang.org/grpc/metadata=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/metadata=bazel-out/host/bin/vendor/google.golang.org/grpc/metadata/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/metadata.a=' -o bazel-out/host/bin/vendor/contrib.go.opencensus.io/exporter/ocagent/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent -- -trimpath .)
Execution platform: @bazel_tools//platforms:host_platform

Use --sandbox_debug to see verbose messages from the sandbox: builder failed: error executing command 
  (cd /home/augustus/.cache/bazel/_bazel_augustus/bd8987116252386267e76c13b740e64e/sandbox/linux-sandbox/2/execroot/__main__ && \
  exec env - \
    CGO_ENABLED=1 \
    GOARCH=amd64 \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=/usr/bin:/bin \
  bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src vendor/contrib.go.opencensus.io/exporter/ocagent/common.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/nodeinfo.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/options.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go -src vendor/contrib.go.opencensus.io/exporter/ocagent/version.go -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1.a=' -arc 'github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1=bazel-out/host/bin/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1.a=' -arc 'github.com/golang/protobuf/ptypes/timestamp=sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/golang/protobuf/ptypes/timestamp=bazel-out/host/bin/vendor/github.com/golang/protobuf/ptypes/timestamp/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/golang/protobuf/ptypes/timestamp.a=' -arc 'go.opencensus.io=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io=bazel-out/host/bin/vendor/go.opencensus.io/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io.a=' -arc 'go.opencensus.io/plugin/ocgrpc=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/plugin/ocgrpc=bazel-out/host/bin/vendor/go.opencensus.io/plugin/ocgrpc/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/plugin/ocgrpc.a=' -arc 'go.opencensus.io/resource=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/resource=bazel-out/host/bin/vendor/go.opencensus.io/resource/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/resource.a=' -arc 'go.opencensus.io/stats=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats=bazel-out/host/bin/vendor/go.opencensus.io/stats/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats.a=' -arc 'go.opencensus.io/stats/view=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats/view=bazel-out/host/bin/vendor/go.opencensus.io/stats/view/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/stats/view.a=' -arc 'go.opencensus.io/tag=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/tag=bazel-out/host/bin/vendor/go.opencensus.io/tag/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/tag.a=' -arc 'go.opencensus.io/trace=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace=bazel-out/host/bin/vendor/go.opencensus.io/trace/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace.a=' -arc 'go.opencensus.io/trace/tracestate=sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace/tracestate=bazel-out/host/bin/vendor/go.opencensus.io/trace/tracestate/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/go.opencensus.io/trace/tracestate.a=' -arc 'google.golang.org/api/support/bundler=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/api/support/bundler=bazel-out/host/bin/vendor/google.golang.org/api/support/bundler/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/api/support/bundler.a=' -arc 'google.golang.org/grpc=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc=bazel-out/host/bin/vendor/google.golang.org/grpc/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc.a=' -arc 'google.golang.org/grpc/credentials=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/credentials=bazel-out/host/bin/vendor/google.golang.org/grpc/credentials/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/credentials.a=' -arc 'google.golang.org/grpc/metadata=sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/metadata=bazel-out/host/bin/vendor/google.golang.org/grpc/metadata/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/google.golang.org/grpc/metadata.a=' -o bazel-out/host/bin/vendor/contrib.go.opencensus.io/exporter/ocagent/linux_amd64_stripped/go_default_library%/sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p sigs.k8s.io/cluster-api-provider-azure/vendor/contrib.go.opencensus.io/exporter/ocagent -- -trimpath .)
Execution platform: @bazel_tools//platforms:host_platform

Use --sandbox_debug to see verbose messages from the sandbox
compile: error running compiler: exit status 2
/home/augustus/.cache/bazel/_bazel_augustus/bd8987116252386267e76c13b740e64e/sandbox/linux-sandbox/2/execroot/__main__/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go:299:38: undefined: "sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1".ConstantSampler_ALWAYS_ON
/home/augustus/.cache/bazel/_bazel_augustus/bd8987116252386267e76c13b740e64e/sandbox/linux-sandbox/2/execroot/__main__/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go:52:3: unknown field 'MetricDescriptor' in struct literal of type "sigs.k8s.io/cluster-api-provider-azure/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1".Metric
INFO: Elapsed time: 3.869s, Critical Path: 0.70s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
Makefile:165: recipe for target 'generate' failed
make: *** [generate] Error 1

real	0m56.523s
user	0m12.150s
sys	0m13.008s

Let me know if I can provide additional information!

cc: @lachie83 @craiglpeters @ritazh @khenidak

@jhendrixMSFT
Copy link
Member

Hello! Is the ask here for us to upgrade our version of census-instrumentation/opencensus-proto?

@justaugustus
Copy link
Author

@jhendrixMSFT -- Not quite? The last versions that worked for us were azure-sdk-for-go v27.1.0 and go-autorest v11.5.2. I believe something in >= v11.6.0 introduced a transitive dependency on opencensus, which doesn't play nice with the rest of our project.

@justaugustus
Copy link
Author

Primarily, we depend on the compute, network, and resources APIs, but I know the cloud controller manager also depends on the storage API

@jhendrixMSFT
Copy link
Member

jhendrixMSFT commented Jun 25, 2019

The dependency on opencensus has been there since v11.2.0, however there were some breaking changes in one of its dependencies that broke us and was fixed in v11.6.1 (see #375). I suspect this is the root of the problem although I haven't dug further into it.

@jhendrixMSFT
Copy link
Member

Looking at your PR it appears that opencensus-proto wasn't updated to v0.2.0, i.e. it's missing changes to trace_config.pb.go which is where the missing enum is defined. Do you know why?

@justaugustus
Copy link
Author

@jhendrixMSFT -- working on gathering more evidence for you!
ref: kubernetes/kubernetes#79574

@tamalsaha
Copy link
Contributor

tamalsaha commented Jul 13, 2019

I just spent bunch of time stuck on this issue. Our dependencies also come via Kubernetes. The problem that I see is this:

Originally we were using the following versions:

require (
	github.com/Azure/azure-sdk-for-go v21.3.0
	github.com/Azure/go-autorest v11.1.0
)

Then we updated to the following versions in May 2019 without any problem:

	github.com/Azure/azure-sdk-for-go v29.0.0+incompatible
	github.com/Azure/go-autorest v12.0.0+incompatible

This library started using leaf modules between v12.0.0 and v12.0.1 release. So, today when I was running go mod tidy, go mod vendor will complete but the tracing sub package will be missing. At one point I was getting the error that github.com/Azure/go-autorest/tracing package was defined by multiple modules.

Currently I have fallback to the following combination which makes everything compile in my case:

require (
	github.com/Azure/azure-sdk-for-go v29.0.0+incompatible
	github.com/Azure/go-autorest v11.1.2+incompatible
)

But my understanding is that this is the wrong version of autorest for the matching azure-sdk-for-go.

I tried to write a standalone program https://github.com/tamalsaha/azurestuff to see what go mod does in isolation. This is what it picks:

require (
	github.com/Azure/go-autorest/autorest v0.5.0
	github.com/Azure/go-autorest/tracing v0.1.0
)

Frankly, I don't know what are the versions for the leaf modules? Does that come from the git tag? I tried that and it does not work.

$ go mod tidy
go: finding github.com/Azure/go-autorest/autorest v12.3.0
go: finding github.com/Azure/go-autorest/tracing v12.3.0
go: errors parsing go.mod:
/home/tamal/go/src/github.com/tamalsaha/azurestuff/go.mod:6: invalid module version "v12.3.0": unknown revision autorest/v12.3.0
/home/tamal/go/src/github.com/tamalsaha/azurestuff/go.mod:7: invalid module version "v12.3.0": unknown revision tracing/v12.3.0

I appreciate any help fixing this mess.

@tamalsaha
Copy link
Contributor

I found how to fix the problems I was facing. I have opened a pr to add instructions for that. #431

@jhendrixMSFT
Copy link
Member

All of the large version tags (e.g. v12.3.0) are for non-module, monolithic releases of this repo; it's to support consumers that use tools like dep or glide for dependency management.
This repo defines the following modules.

  • autorest/adal
  • autorest/azure/cli
  • autorest/date
  • autorest/mocks
  • autorest/to
  • autorest/validation
  • autorest
  • logger
  • tracing

I need more info to help diagnose the root of your problem as I can successfully build a simple program that consumes v31.1.0+incompatible of azure-sdk-for-go along with autorest/v0.5.0.

@tamalsaha
Copy link
Contributor

@jhendrixMSFT , here is an example of the error we are seeing:

cannot load github.com/Azure/go-autorest/tracing: ambiguous import: found github.com/Azure/go-autorest/tracing in multiple modules:
        github.com/Azure/go-autorest v11.7.0+incompatible (/home/fahim/go/pkg/mod/github.com/!azure/go-autorest@v11.7.0+incompatible/tracing)
        github.com/Azure/go-autorest/tracing v0.1.0 (/home/fahim/go/pkg/mod/github.com/!azure/go-autorest/tracing@v0.1.0)

@jhendrixMSFT
Copy link
Member

What's causing both of these packages to be added to your go.mod file?

@tamalsaha
Copy link
Contributor

github.com/Azure/go-autorest@v11.7.0 is coming from Kubernetes which my project depends on. And I am trying to use github.com/Azure/azure-sdk-for-go v31.0.0+incompatible directly.

#431 (specifically the replacement) solved the problem for me.

@jhendrixMSFT
Copy link
Member

But what is causing tracing/v0.1.0 to be added to your go.mod? go-autorest@v11.7.0 already includes the tracing package. Is it the consumption of azure-sdk-for-go@v31.0.0+incompatible that's causing it?

@tamalsaha
Copy link
Contributor

Is it the consumption of azure-sdk-for-go@v31.0.0+incompatible that's causing it?

yes.

@tamalsaha
Copy link
Contributor

I run go mod tidy, then go does its thing. That adds the tracing package.

@tamalsaha
Copy link
Contributor

@jhendrixMSFT , to see this problem, you can clone pharmer/cloud repo and follow the instructions here:

https://github.com/pharmer/cloud/commit/01456392c26d0b7d548187040e5c4a71a51bb306

You will see that either go complains about ambiguity or does not vendor correctly.

I am using go 1.12.7

@alexeldeib
Copy link
Contributor

alexeldeib commented Jul 17, 2019

I'm building via Bazel and started seeing similar issues. Vendoring solves the problem. Might be an issue with bazel/gazelle, but figured I'd add that anecdata. build rule problems

@jhendrixMSFT
Copy link
Member

This should now be fixed in v12.4.1, module tracing/v0.2.0.

jhendrixMSFT added a commit that referenced this issue Jun 23, 2020
* Fix Go module ambiguous import errors

This is an extension of the mitigations introduced in #455.
Unfortunately, the original mitigations didn't address the primary cause
of ambiguous import errors: the github.com/Azure/go-autorest module.

The issue stems from the fact that old versions of the root module
(github.com/Azure/go-autorest) provide the same packages as the newer
submodules.

To correct this situation, the _root module_ needs to be upgraded to a
version that no longer provides those packages (a version where the
submodules are present). Fortunately, the submodules can be leveraged to
provide the necessary version bump.

See: #414 (comment)

----

Caveat: in order for this to work, an importable version of the root
package needs to be referenceable.

PR #527 makes the root package importable.

The go.mod files assume that this importable version will be
referenceable as v14.2.0. If the version where the importable package is
available ends up being different, these files will need to be updated.

See also: #395, #413, #414, #455, #481, #524

* Update go.sum files

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
jhendrixMSFT added a commit that referenced this issue Jun 23, 2020
* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* merge master into dev (#427)

* v12.3.0 (#418)

* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* v12.3.0

* add yaml file for azure devops CI (#419)

* add status badge for azure devops CI (#420)

* enable build and test on linux (#421)

* enable build and test on linux

* fail on first error and use portable std*

* update test to run on devops

* Refactor azure devops pipeline (#422)

Break monolithic script into separate scripts with useful names.
Moved formatting checks to the end with succeededOrFailed conditions.

* remove travis artifacts (#423)

* remove unnecessary trigger section from devops (#424)

* Use accessTokens.json from AZURE_CONFIG_DIR if AZURE_ACCESS_TOKEN_FILE is not set before falling back on ~/.azure/ (#471)

* support for parsing error messages from xml responses (#465)

* support for parsing error messages from xml responses

* fixing the linting

* removed some duplicate code

* fix bug introduced in refactoring

* added XML test and fixed bug it uncovered

* fix godoc comment for methods that are safe for concurrent use (#475)

* New Authorizers for Azure Storage (#416)

* Authorizers for Blob, File, Queue and Table Storage

* Adding a SharedKey authorizer

* refactor based on existing storage implementation

* add missing storage emulator account name

* replace hard-coded strings with constants

* changed to by-ref

* Adding a new Authorizer for SAS Token Authentication (#478)

* Adding a new Authorizer for SAS Token Authentication

This commit introduces a new Authorizer for authenticating with
Blob Storage using a SAS Token

```
$ go test -v ./autorest/ -run="TestSas"
=== RUN   TestSasNewSasAuthorizerEmptyToken
--- PASS: TestSasNewSasAuthorizerEmptyToken (0.00s)
=== RUN   TestSasNewSasAuthorizerEmptyTokenWithWhitespace
--- PASS: TestSasNewSasAuthorizerEmptyTokenWithWhitespace (0.00s)
=== RUN   TestSasNewSasAuthorizerValidToken
--- PASS: TestSasNewSasAuthorizerValidToken (0.00s)
=== RUN   TestSasAuthorizerRequest
--- PASS: TestSasAuthorizerRequest (0.00s)
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring with a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring with a prefix"..
PASS
ok  	github.com/Azure/go-autorest/autorest	0.011s
```

* minor clean-up

* token: support for a custom refresh func (#476)

* token: support for a custom refresh func

* pass closures by value

* minor clean-up

* Fix Dropped Errors (#480)

* autorest: fix dropped errror

* autorest/adal: fix dropped test error

* Duration order consistency when multiplying number by time unit (#499)

* Drain response bodies (#432)

The retry helpers and a few other methods weren't reading and closing
response bodies leading to connection leaks.

* Enable exponential back-off when retrying on 429 (#503)

* Enable exponential back-off when retrying on 429

* enforce a 2-minute cap on delays if there isn't one

* updated comment

* fix type-o

* Expose OAuth token provider for use outside autorest (#520)

* feat: extract token creation to public method for MSI auth

* Add getter for token provider on BearerAuthorizer

* Fix Go module ambiguous import errors (#528)

* Fix Go module ambiguous import errors

This is an extension of the mitigations introduced in #455.
Unfortunately, the original mitigations didn't address the primary cause
of ambiguous import errors: the github.com/Azure/go-autorest module.

The issue stems from the fact that old versions of the root module
(github.com/Azure/go-autorest) provide the same packages as the newer
submodules.

To correct this situation, the _root module_ needs to be upgraded to a
version that no longer provides those packages (a version where the
submodules are present). Fortunately, the submodules can be leveraged to
provide the necessary version bump.

See: #414 (comment)

----

Caveat: in order for this to work, an importable version of the root
package needs to be referenceable.

PR #527 makes the root package importable.

The go.mod files assume that this importable version will be
referenceable as v14.2.0. If the version where the importable package is
available ends up being different, these files will need to be updated.

See also: #395, #413, #414, #455, #481, #524

* Update go.sum files

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>

* Update resourceManagerVMDNSSuffix for AzureUSGovernmentCloud (#531)

* This endpoint changed in AzureChinaCloud (#530)

See from Azurre China portal - this is now cloudapp.chinacloudapi.cn

Co-authored-by: Jin Soon Lim <jilim@microsoft.com>
Co-authored-by: Nick Muller <muller_nicky@hotmail.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Sam Kreter <samkreter@gmail.com>
Co-authored-by: Delyan Raychev <49918230+draychev@users.noreply.github.com>
Co-authored-by: Patrick Decat <pdecat@gmail.com>
Co-authored-by: Tony Abboud <tdabboud@hotmail.com>
Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
Co-authored-by: Maxim Fominykh <vominyh@yandex.ru>
Co-authored-by: alespour <42931850+alespour@users.noreply.github.com>
Co-authored-by: Mark Severson <miquella@gmail.com>
Co-authored-by: Panic Stevenson <panic.stevenson@gmail.com>
Co-authored-by: Mauro Giusti <MaurGi@users.noreply.github.com>
jhendrixMSFT added a commit that referenced this issue Aug 5, 2020
* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* merge master into dev (#427)

* v12.3.0 (#418)

* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* v12.3.0

* add yaml file for azure devops CI (#419)

* add status badge for azure devops CI (#420)

* enable build and test on linux (#421)

* enable build and test on linux

* fail on first error and use portable std*

* update test to run on devops

* Refactor azure devops pipeline (#422)

Break monolithic script into separate scripts with useful names.
Moved formatting checks to the end with succeededOrFailed conditions.

* remove travis artifacts (#423)

* remove unnecessary trigger section from devops (#424)

* Use accessTokens.json from AZURE_CONFIG_DIR if AZURE_ACCESS_TOKEN_FILE is not set before falling back on ~/.azure/ (#471)

* support for parsing error messages from xml responses (#465)

* support for parsing error messages from xml responses

* fixing the linting

* removed some duplicate code

* fix bug introduced in refactoring

* added XML test and fixed bug it uncovered

* fix godoc comment for methods that are safe for concurrent use (#475)

* New Authorizers for Azure Storage (#416)

* Authorizers for Blob, File, Queue and Table Storage

* Adding a SharedKey authorizer

* refactor based on existing storage implementation

* add missing storage emulator account name

* replace hard-coded strings with constants

* changed to by-ref

* Adding a new Authorizer for SAS Token Authentication (#478)

* Adding a new Authorizer for SAS Token Authentication

This commit introduces a new Authorizer for authenticating with
Blob Storage using a SAS Token

```
$ go test -v ./autorest/ -run="TestSas"
=== RUN   TestSasNewSasAuthorizerEmptyToken
--- PASS: TestSasNewSasAuthorizerEmptyToken (0.00s)
=== RUN   TestSasNewSasAuthorizerEmptyTokenWithWhitespace
--- PASS: TestSasNewSasAuthorizerEmptyTokenWithWhitespace (0.00s)
=== RUN   TestSasNewSasAuthorizerValidToken
--- PASS: TestSasNewSasAuthorizerValidToken (0.00s)
=== RUN   TestSasAuthorizerRequest
--- PASS: TestSasAuthorizerRequest (0.00s)
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring with a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring with a prefix"..
PASS
ok  	github.com/Azure/go-autorest/autorest	0.011s
```

* minor clean-up

* token: support for a custom refresh func (#476)

* token: support for a custom refresh func

* pass closures by value

* minor clean-up

* Fix Dropped Errors (#480)

* autorest: fix dropped errror

* autorest/adal: fix dropped test error

* Duration order consistency when multiplying number by time unit (#499)

* Drain response bodies (#432)

The retry helpers and a few other methods weren't reading and closing
response bodies leading to connection leaks.

* Enable exponential back-off when retrying on 429 (#503)

* Enable exponential back-off when retrying on 429

* enforce a 2-minute cap on delays if there isn't one

* updated comment

* fix type-o

* autorest: remove testing.T.Fatal() from test goroutine

* Expose OAuth token provider for use outside autorest (#520)

* feat: extract token creation to public method for MSI auth

* Add getter for token provider on BearerAuthorizer

* Fix Go module ambiguous import errors (#528)

* Fix Go module ambiguous import errors

This is an extension of the mitigations introduced in #455.
Unfortunately, the original mitigations didn't address the primary cause
of ambiguous import errors: the github.com/Azure/go-autorest module.

The issue stems from the fact that old versions of the root module
(github.com/Azure/go-autorest) provide the same packages as the newer
submodules.

To correct this situation, the _root module_ needs to be upgraded to a
version that no longer provides those packages (a version where the
submodules are present). Fortunately, the submodules can be leveraged to
provide the necessary version bump.

See: #414 (comment)

----

Caveat: in order for this to work, an importable version of the root
package needs to be referenceable.

PR #527 makes the root package importable.

The go.mod files assume that this importable version will be
referenceable as v14.2.0. If the version where the importable package is
available ends up being different, these files will need to be updated.

See also: #395, #413, #414, #455, #481, #524

* Update go.sum files

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>

* Update resourceManagerVMDNSSuffix for AzureUSGovernmentCloud (#531)

* This endpoint changed in AzureChinaCloud (#530)

See from Azurre China portal - this is now cloudapp.chinacloudapi.cn

Co-authored-by: Jin Soon Lim <jilim@microsoft.com>
Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
Co-authored-by: Nick Muller <muller_nicky@hotmail.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Sam Kreter <samkreter@gmail.com>
Co-authored-by: Delyan Raychev <49918230+draychev@users.noreply.github.com>
Co-authored-by: Patrick Decat <pdecat@gmail.com>
Co-authored-by: Tony Abboud <tdabboud@hotmail.com>
Co-authored-by: Maxim Fominykh <vominyh@yandex.ru>
Co-authored-by: alespour <42931850+alespour@users.noreply.github.com>
Co-authored-by: Mark Severson <miquella@gmail.com>
Co-authored-by: Panic Stevenson <panic.stevenson@gmail.com>
Co-authored-by: Mauro Giusti <MaurGi@users.noreply.github.com>
jhendrixMSFT added a commit that referenced this issue Aug 7, 2020
* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* merge master into dev (#427)

* v12.3.0 (#418)

* Deserialize additionalInfo in ARM error

* Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url.

This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file.

* [WIP] Using the Context from the timeout if provided (#315)

* Using the timeout from the context if available

- Makes PollingDuration optional

* Renaming the registration start time

* Making PollingDuration not a pointer

* fixing a broken reference

* Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for  local development scenarios. (#316)

* Adding User assigned identity support for the MSIConfig authorizor (#332)

* Adding ByteSlicePtr (#399)

* Adding a new `WithXML` method (#402)

* Add HTTP status code response helpers (#403)

Added IsHTTPStatus() and HasHTTPStatus() methods to autorest.Response

* adding a new preparer for `MERGE` used in the Storage API's (#406)

* New Preparer/Responder for `Unmarshalling Bytes` (#407)

* New Preparer: WithBytes

* New Responder: `ByUnmarshallingBytes`

* Reusing the bytes, rather than copying them

* Fixing the broken test / switching to read the bytes directly

* Support HTTP-Date in Retry-After header (#410)

RFC specifies Retry-After header can be integer value expressing seconds
or an HTTP-Date indicating when to try again.
Removed superfluous check for HTTP status code.

* Add support for multi-tenant authentication (#412)

* Add support for multi-tenant authentication

Support for multi-tenant via x-ms-authorization-auxiliary header has
been added for client credentials with secret scenario; this basically
bundles multiple OAuthConfig and ServicePrincipalToken types into
corresponding MultiTenant* types along with a new authorizer that adds
the primary and auxiliary token headers to the reqest.
The authenticaion helpers have been updated to support this scenario; if
environment var AZURE_AUXILIARY_TENANT_IDS is set with a semicolon
delimited list of tenants the multi-tenant codepath will kick in to
create the appropriate authorizer.

* feedback

* rename Options to OAuthOptions (#415)

* Support custom SendDecorator chains via context (#417)

* Support custom SendDecorator chains via context

Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for
adding and retrieving a custom chain of SendDecorators to the provided
context.
Added `autorest.DoRetryForStatusCodesWithCap` and
`autorest.DelayForBackoffWithCap` to enforce an upper bound on the
duration between retries.
Fixed up some code comments.

* small refactor based on PR feedback

* remove some changes for dev branch

* v12.3.0

* add yaml file for azure devops CI (#419)

* add status badge for azure devops CI (#420)

* enable build and test on linux (#421)

* enable build and test on linux

* fail on first error and use portable std*

* update test to run on devops

* Refactor azure devops pipeline (#422)

Break monolithic script into separate scripts with useful names.
Moved formatting checks to the end with succeededOrFailed conditions.

* remove travis artifacts (#423)

* remove unnecessary trigger section from devops (#424)

* Use accessTokens.json from AZURE_CONFIG_DIR if AZURE_ACCESS_TOKEN_FILE is not set before falling back on ~/.azure/ (#471)

* support for parsing error messages from xml responses (#465)

* support for parsing error messages from xml responses

* fixing the linting

* removed some duplicate code

* fix bug introduced in refactoring

* added XML test and fixed bug it uncovered

* fix godoc comment for methods that are safe for concurrent use (#475)

* New Authorizers for Azure Storage (#416)

* Authorizers for Blob, File, Queue and Table Storage

* Adding a SharedKey authorizer

* refactor based on existing storage implementation

* add missing storage emulator account name

* replace hard-coded strings with constants

* changed to by-ref

* Adding a new Authorizer for SAS Token Authentication (#478)

* Adding a new Authorizer for SAS Token Authentication

This commit introduces a new Authorizer for authenticating with
Blob Storage using a SAS Token

```
$ go test -v ./autorest/ -run="TestSas"
=== RUN   TestSasNewSasAuthorizerEmptyToken
--- PASS: TestSasNewSasAuthorizerEmptyToken (0.00s)
=== RUN   TestSasNewSasAuthorizerEmptyTokenWithWhitespace
--- PASS: TestSasNewSasAuthorizerEmptyTokenWithWhitespace (0.00s)
=== RUN   TestSasNewSasAuthorizerValidToken
--- PASS: TestSasNewSasAuthorizerValidToken (0.00s)
=== RUN   TestSasAuthorizerRequest
--- PASS: TestSasAuthorizerRequest (0.00s)
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "empty querystring with a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring without a prefix"..
    authorization_sas_test.go:76: [DEBUG] Testing Case "existing querystring with a prefix"..
PASS
ok  	github.com/Azure/go-autorest/autorest	0.011s
```

* minor clean-up

* token: support for a custom refresh func (#476)

* token: support for a custom refresh func

* pass closures by value

* minor clean-up

* Fix Dropped Errors (#480)

* autorest: fix dropped errror

* autorest/adal: fix dropped test error

* Duration order consistency when multiplying number by time unit (#499)

* Drain response bodies (#432)

The retry helpers and a few other methods weren't reading and closing
response bodies leading to connection leaks.

* Enable exponential back-off when retrying on 429 (#503)

* Enable exponential back-off when retrying on 429

* enforce a 2-minute cap on delays if there isn't one

* updated comment

* fix type-o

* Expose OAuth token provider for use outside autorest (#520)

* feat: extract token creation to public method for MSI auth

* Add getter for token provider on BearerAuthorizer

* Fix Go module ambiguous import errors (#528)

* Fix Go module ambiguous import errors

This is an extension of the mitigations introduced in #455.
Unfortunately, the original mitigations didn't address the primary cause
of ambiguous import errors: the github.com/Azure/go-autorest module.

The issue stems from the fact that old versions of the root module
(github.com/Azure/go-autorest) provide the same packages as the newer
submodules.

To correct this situation, the _root module_ needs to be upgraded to a
version that no longer provides those packages (a version where the
submodules are present). Fortunately, the submodules can be leveraged to
provide the necessary version bump.

See: #414 (comment)

----

Caveat: in order for this to work, an importable version of the root
package needs to be referenceable.

PR #527 makes the root package importable.

The go.mod files assume that this importable version will be
referenceable as v14.2.0. If the version where the importable package is
available ends up being different, these files will need to be updated.

See also: #395, #413, #414, #455, #481, #524

* Update go.sum files

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>

* Update resourceManagerVMDNSSuffix for AzureUSGovernmentCloud (#531)

* This endpoint changed in AzureChinaCloud (#530)

See from Azurre China portal - this is now cloudapp.chinacloudapi.cn

* allow MSI login with "mi_res_id" (#544)

* allow login with resourceID

* test

* tweaks

* fix

* tested with cmd

* fix unittest

* add new test, remove debug trace

* fix unittest

* fix with url encode

Co-authored-by: Jin Soon Lim <jilim@microsoft.com>
Co-authored-by: Nick Muller <muller_nicky@hotmail.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Sam Kreter <samkreter@gmail.com>
Co-authored-by: Delyan Raychev <49918230+draychev@users.noreply.github.com>
Co-authored-by: Patrick Decat <pdecat@gmail.com>
Co-authored-by: Tony Abboud <tdabboud@hotmail.com>
Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
Co-authored-by: Maxim Fominykh <vominyh@yandex.ru>
Co-authored-by: alespour <42931850+alespour@users.noreply.github.com>
Co-authored-by: Mark Severson <miquella@gmail.com>
Co-authored-by: Panic Stevenson <panic.stevenson@gmail.com>
Co-authored-by: Mauro Giusti <MaurGi@users.noreply.github.com>
Co-authored-by: Haitao Chen <haitch@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

No branches or pull requests

4 participants