Skip to content

Commit

Permalink
chore: Backport fixes to 2.7 for 2.7.2 release (#505)
Browse files Browse the repository at this point in the history
* chore: build windows packages on release (#490)

* fix: don't attempt to overwrite influxdb installs (#493) (#494)

* fix: don't attempt to overwrite influxdb installs

* fix: don't attempt to overwrite influxdb installs

* fix: rename package to influxdb2-cli (#495)

The package filename remains "influxdb2-client"; however, internally
the package has been renamed to "influxdb2-cli". This is so upgrades
are performed correctly by apt and yum (which use the package
metadata rather than the filename).

This also swaps out underscores to slashes to match what
influxdata-docker expects.

* chore: update to go 1.20.3 (#496)

* chore: update to go 1.20.3

* chore: update to go 1.20.3

* chore: use remote package signing (#498)

* chore: make sure .exe is on windows builds (#500)

* chore: make sure .exe is on windows builds

* chore: make sure .exe is on windows builds

* build(deps): bump golang.org/x/text from 0.3.7 to 0.3.8 (#499)

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(signin): Check for all available cookies instead of the count (#504)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: iLLeniumStudios <104288623+TheiLLeniumStudios@users.noreply.github.com>
  • Loading branch information
4 people committed Apr 26, 2023
1 parent 22e457b commit 28cdbc7
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 97 deletions.
67 changes: 47 additions & 20 deletions .circleci/config.yml
Expand Up @@ -6,7 +6,7 @@ executors:
# NOTE: To upgrade the Go version, first push the upgrade to the cross-builder Dockerfile in the edge repo,
# then update the version here to match. Until we finish the migration to using the cross-builder image,
# you'll also need to update references to `cimg/go` and `GO_VERSION` in this file.
- image: quay.io/influxdb/cross-builder:go1.19.4-cb1343dd74ecba8ec07fe810195530a0b9055aa9
- image: quay.io/influxdb/cross-builder:go1.20.3-a38b5cac193a1bdf7436f45581167a43835cc727
resource_class: medium
linux-amd64:
machine:
Expand Down Expand Up @@ -89,7 +89,6 @@ workflows:
- os: windows
arch: arm64
- build-packages:
sign: false
requires:
- build-darwin-amd64
- build-linux-amd64
Expand Down Expand Up @@ -156,12 +155,14 @@ workflows:
- os: windows
arch: arm64
- build-packages:
sign: true
requires:
- build-darwin-amd64
- build-linux-amd64
- build-linux-arm64
- build-windows-amd64
- sign-packages:
requires:
- build-packages
- release:
is-nightly: true
requires:
Expand All @@ -172,7 +173,7 @@ workflows:
- test-linux-arm64
- test-mac
- test-windows
- build-packages
- sign-packages
release-tag:
jobs:
- changelog:
Expand Down Expand Up @@ -237,12 +238,15 @@ workflows:
arch: arm64
- build-packages:
<<: *release_filter
sign: true
requires:
- build-darwin-amd64
- build-linux-amd64
- build-linux-arm64
- build-windows-amd64
- sign-packages:
<<: *release_filter
requires:
- build-packages
- release:
<<: *release_filter
is-nightly: false
Expand All @@ -254,7 +258,7 @@ workflows:
- test-linux-arm64
- test-mac
- test-windows
- build-packages
- sign-packages

commands:
setup:
Expand Down Expand Up @@ -420,9 +424,6 @@ jobs:
docker:
- image: ubuntu:latest
resource_class: small
parameters:
sign:
type: boolean
steps:
- attach_workspace:
at: /tmp/workspace
Expand All @@ -440,25 +441,51 @@ jobs:
ruby-dev
gem install fpm
if [[ "<< parameters.sign >>" == "true" ]]
then
gpg --import --batch \<<<"${GPG_PRIVATE_KEY//$'\\n'/$'\n'}"
export SIGN_PACKAGES=1
fi
mkdir -p packages
OS=darwin ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/darwin/amd64/influx "${PWD}/packages"
OS=linux ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/linux/amd64/influx "${PWD}/packages"
OS=linux ARCH=arm64 scripts/ci/build-packages /tmp/workspace/bin/linux/arm64/influx "${PWD}/packages"
OS=windows ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/windows/amd64/influx "${PWD}/packages"
OS=darwin ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/darwin/amd64/influx "${PWD}/packages"
OS=linux ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/linux/amd64/influx "${PWD}/packages"
OS=linux ARCH=arm64 scripts/ci/build-packages /tmp/workspace/bin/linux/arm64/influx "${PWD}/packages"
OS=windows ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/windows/amd64/influx.exe "${PWD}/packages"
- store_artifacts:
path: packages/
- persist_to_workspace:
root: .
paths:
- packages

sign-packages:
circleci_ip_ranges: true
docker:
- image: quay.io/influxdb/rsign:latest
auth:
username: $QUAY_RSIGN_USERNAME
password: $QUAY_RSIGN_PASSWORD
steps:
- add_ssh_keys:
fingerpints:
-
- attach_workspace:
at: /tmp/workspace
- run: |
for target in /tmp/workspace/packages/*
do
case "${target}"
in
# rsign is shipped on Alpine Linux which uses "busybox ash" instead
# of bash. ash is somewhat more posix compliant and is missing some
# extensions and niceties from bash.
*.deb|*.rpm|*.tar.gz|*.zip)
rsign "${target}"
;;
esac
done
- persist_to_workspace:
root: /tmp/workspace
paths:
- packages
- store_artifacts:
path: /tmp/workspace/packages

changelog:
docker:
- image: quay.io/influxdb/changelogger:a20523cf8594eb93920e74d0189d6602a76a6146
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -56,7 +56,7 @@ fmt: $(FMT_FILES)
go run github.com/daixiang0/gci -w $^

bin/$(GOOS)/$(GOARCH)/influx: $(SOURCES)
CGO_ENABLED=0 $(GO_BUILD) -o $@ ./cmd/$(shell basename "$@")
CGO_ENABLED=0 $(GO_BUILD) -o bin/$(GOOS)/$(GOARCH)/ ./cmd/$(shell basename "$@")

.DEFAULT_GOAL := influx
influx: bin/$(GOOS)/$(GOARCH)/influx
Expand Down
9 changes: 6 additions & 3 deletions clients/signin/signin.go
Expand Up @@ -48,9 +48,12 @@ func GetCookie(ctx context.Context, params api.ConfigParams, userPass string) (s
}

cookies := res.Cookies()
if len(cookies) != 1 {
return "", fmt.Errorf("failure getting session cookie, multiple cookies")

for _, cookie := range cookies {
if strings.Contains(cookie.Name, "influxdb") {
return cookie.Value, nil
}
}

return cookies[0].Value, nil
return "", fmt.Errorf("failure getting session cookie, invalid cookies")
}
2 changes: 1 addition & 1 deletion config/local.go
Expand Up @@ -160,7 +160,7 @@ func (s baseRW) parsePreviousActive() (Config, error) {
// ListConfigs decodes configs from io readers
func (s baseRW) ListConfigs() (Configs, error) {
cfgs := make(Configs)
_, err := toml.DecodeReader(s.r, &cfgs)
_, err := toml.NewDecoder(s.r).Decode(&cfgs)
for n, cfg := range cfgs {
cfg.Name = n
cfgs[n] = cfg
Expand Down
41 changes: 24 additions & 17 deletions go.mod
@@ -1,42 +1,44 @@
module github.com/influxdata/influx-cli/v2

go 1.19
go 1.20

require (
github.com/AlecAivazis/survey/v2 v2.3.4
github.com/BurntSushi/toml v0.4.1
github.com/BurntSushi/toml v1.2.1
github.com/MakeNowJust/heredoc/v2 v2.0.1
github.com/charmbracelet/bubbletea v0.21.0
github.com/charmbracelet/lipgloss v0.5.0
github.com/daixiang0/gci v0.2.8
github.com/daixiang0/gci v0.10.1
github.com/evertras/bubble-table v0.13.7
github.com/fatih/color v1.9.0
github.com/fujiwara/shapeio v1.0.0
github.com/gocarina/gocsv v0.0.0-20210408192840-02d7211d929d
github.com/golang/mock v1.5.0
github.com/golang/mock v1.6.0
github.com/google/go-jsonnet v0.17.0
github.com/influxdata/go-prompt v0.2.8
github.com/influxdata/influxdb/v2 v2.3.0
github.com/mattn/go-isatty v0.0.14
github.com/muesli/termenv v0.12.0
github.com/olekukonko/tablewriter v0.0.5
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli v1.22.5
go.etcd.io/bbolt v1.3.6
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a
google.golang.org/protobuf v1.27.1
golang.org/x/text v0.3.8
golang.org/x/tools v0.8.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v3 v3.0.1
honnef.co/go/tools v0.3.0
honnef.co/go/tools v0.4.3
)

require (
github.com/atotto/clipboard v0.1.4 // indirect
github.com/charmbracelet/bubbles v0.11.0 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
Expand All @@ -49,12 +51,17 @@ require (
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/stretchr/objx v0.1.1 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/sys v0.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
)

0 comments on commit 28cdbc7

Please sign in to comment.