We initially support capturing to a file (in our own format, as it
doesn't appear a suitable format exists). This means we don't need a
server to capture the traces, and can start capturing through prow
without a lot of infrastructure changes.
Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
We need a region to start from to make AWS calls. us-east-1 works for
most credentials, but not for cn-north-1 credentials. Instead, we get
the current region from metadata when running on EC2; and we continue
to fall-back to us-east-1.
For CLI commands (kops) the user will still have to set AWS_REGION,
but for system binaries (nodeup, etcd-manager), this should default
appropriately.
Note that the region doesn't have to be the actual region of the
bucket, just a region we can access.
Issue #6098
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog. That
will happen when we update to k8s 1.13.
In cases where the user is the bucket owner an initial call to
s3.GetBucketLocation will succeed. If it does return an error we
fall back to the bruteforce method.
This effectively makes the behaviour unchanged from previous versions
for bucket owners.
Minor refactor, the request was created one level up originally
because I had added two separate steps for initially determining
whether we have to use the bruteforce method.
However this is a premature optimisation and unnecessary due to the
concurrency behaviour we've got now.
The AWS API makes it difficult to retrieve S3 bucket locations from shared buckets
with bucket-policy based access delegations. This introduces a workaround for the
issue.
AWS is aware of the issue but for the time being they can not provide information
about when it will be fixed.
See #1247 for more information.