Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Shellcheck

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
shellcheck:
name: Shellcheck mint scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install shellcheck
run: sudo apt-get update && sudo apt-get install -y shellcheck

# Browser jest tests currently crash in Login.test.js (Link outside Router).
# Re-enable once fixed: npm test -- --runInBand --forceExit
- name: Shellcheck mint scripts
run: bash -c 'shopt -s globstar; shellcheck mint/**/*.sh'
38 changes: 38 additions & 0 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Crosscompile

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
crosscompile:
name: Crosscompile on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Crosscompile
env:
CGO_ENABLED: 0
GO111MODULE: on
run: |
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
make crosscompile
54 changes: 54 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Linters and Tests

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
name: Go on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Build and test (Linux)
if: matrix.os == 'ubuntu-latest'
env:
CGO_ENABLED: 0
GO111MODULE: on
run: |
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
make
make test
make test-race

- name: Build and test (Windows)
if: matrix.os == 'windows-latest'
env:
CGO_ENABLED: 0
GO111MODULE: on
run: |
go build -ldflags="-s -w" -o "$env:GOPATH\bin\minio.exe" .
go test -v -timeout 50m ./...
39 changes: 39 additions & 0 deletions .github/workflows/go-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Functional Tests

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
verify:
name: Verify on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Verify build and healing
env:
CGO_ENABLED: 0
GO111MODULE: on
run: |
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
make verify
make verify-healing
50 changes: 0 additions & 50 deletions .github/workflows/go.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: VulnCheck

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
vulncheck:
name: govulncheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck ./...
2 changes: 1 addition & 1 deletion buildscripts/checkdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _init() {

## Minimum required versions for build dependencies
GIT_VERSION="1.0"
GO_VERSION="1.16"
GO_VERSION="1.22"
OSX_VERSION="10.8"
KNAME=$(uname -s)
ARCH=$(uname -m)
Expand Down
2 changes: 1 addition & 1 deletion cmd/config-encrypted.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/bindoffice/minio/cmd/logger"
"github.com/bindoffice/minio/pkg/auth"
"github.com/bindoffice/minio/pkg/madmin"
etcd "go.etcd.io/etcd/clientv3"
etcd "go.etcd.io/etcd/client/v3"
)

func handleEncryptedConfigBackend(objAPI ObjectLayer) error {
Expand Down
13 changes: 6 additions & 7 deletions cmd/config/dns/etcd_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import (
"strings"
"time"

"github.com/coredns/coredns/plugin/etcd/msg"
"github.com/minio/minio-go/v7/pkg/set"
"go.etcd.io/etcd/clientv3"
clientv3 "go.etcd.io/etcd/client/v3"
)

// ErrNoEntriesFound - Indicates no entries were found for the given key (directory)
Expand Down Expand Up @@ -59,7 +58,7 @@ func (c *CoreDNS) Close() error {
func (c *CoreDNS) List() (map[string][]SrvRecord, error) {
var srvRecords = map[string][]SrvRecord{}
for _, domainName := range c.domainNames {
key := msg.Path(fmt.Sprintf("%s.", domainName), c.prefixPath)
key := etcdPath(fmt.Sprintf("%s.", domainName), c.prefixPath)
records, err := c.list(key+etcdPathSeparator, true)
if err != nil {
return srvRecords, err
Expand All @@ -78,7 +77,7 @@ func (c *CoreDNS) List() (map[string][]SrvRecord, error) {
func (c *CoreDNS) Get(bucket string) ([]SrvRecord, error) {
var srvRecords []SrvRecord
for _, domainName := range c.domainNames {
key := msg.Path(fmt.Sprintf("%s.%s.", bucket, domainName), c.prefixPath)
key := etcdPath(fmt.Sprintf("%s.%s.", bucket, domainName), c.prefixPath)
records, err := c.list(key, false)
if err != nil {
return nil, err
Expand Down Expand Up @@ -171,7 +170,7 @@ func (c *CoreDNS) Put(bucket string) error {
return err
}
for _, domainName := range c.domainNames {
key := msg.Path(fmt.Sprintf("%s.%s", bucket, domainName), c.prefixPath)
key := etcdPath(fmt.Sprintf("%s.%s", bucket, domainName), c.prefixPath)
key = key + etcdPathSeparator + ip
ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout)
_, err = c.etcdClient.Put(ctx, key, string(bucketMsg))
Expand All @@ -190,7 +189,7 @@ func (c *CoreDNS) Put(bucket string) error {
// Delete - Removes DNS entries added in Put().
func (c *CoreDNS) Delete(bucket string) error {
for _, domainName := range c.domainNames {
key := msg.Path(fmt.Sprintf("%s.%s.", bucket, domainName), c.prefixPath)
key := etcdPath(fmt.Sprintf("%s.%s.", bucket, domainName), c.prefixPath)
ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout)
_, err := c.etcdClient.Delete(ctx, key+etcdPathSeparator, clientv3.WithPrefix())
cancel()
Expand All @@ -204,7 +203,7 @@ func (c *CoreDNS) Delete(bucket string) error {
// DeleteRecord - Removes a specific DNS entry
func (c *CoreDNS) DeleteRecord(record SrvRecord) error {
for _, domainName := range c.domainNames {
key := msg.Path(fmt.Sprintf("%s.%s.", record.Key, domainName), c.prefixPath)
key := etcdPath(fmt.Sprintf("%s.%s.", record.Key, domainName), c.prefixPath)

ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout)
_, err := c.etcdClient.Delete(ctx, key+etcdPathSeparator+record.Host)
Expand Down
36 changes: 36 additions & 0 deletions cmd/config/dns/etcd_path.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* MinIO Cloud Storage, (C) 2018,2020 MinIO, Inc.
*
* 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 dns

import (
"path"

"github.com/miekg/dns"
)

// etcdPath converts a domain name to an etcd key path compatible with CoreDNS
// SkyDNS layout. For example service.staging.skydns.local. with prefix skydns
// becomes /skydns/local/skydns/staging/service.
//
// Logic mirrors CoreDNS plugin/etcd/msg.Path (Apache 2.0, CoreDNS Authors).
func etcdPath(s, prefix string) string {
l := dns.SplitDomainName(s)
for i, j := 0, len(l)-1; i < j; i, j = i+1, j-1 {
l[i], l[j] = l[j], l[i]
}
return path.Join(append([]string{"/" + prefix + "/"}, l...)...)
}
27 changes: 27 additions & 0 deletions cmd/config/dns/etcd_path_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* MinIO Cloud Storage, (C) 2018,2020 MinIO, Inc.
*
* 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 dns

import "testing"

func TestEtcdPath(t *testing.T) {
got := etcdPath("service.staging.skydns.local.", "skydns")
want := "/skydns/local/skydns/staging/service"
if got != want {
t.Fatalf("etcdPath: got %q, want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion cmd/config/dns/operator_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"strings"
"time"

"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
"github.com/bindoffice/minio/cmd/config"
xhttp "github.com/bindoffice/minio/cmd/http"
)
Expand Down
Loading
Loading