Skip to content

Commit 8b39ad9

Browse files
authored
Merge branch 'master' into disable-support-non-activated
2 parents 7b8e889 + 4aa3f40 commit 8b39ad9

31 files changed

+1508
-1891
lines changed

.github/workflows/jobs.yaml

Lines changed: 113 additions & 61 deletions
Large diffs are not rendered by default.

.golangci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ linters-settings:
44

55
misspell:
66
locale: US
7+
8+
goheader:
9+
values:
10+
regexp:
11+
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
12+
template-path: .license.tmpl
713

814
linters:
915
disable-all: true
@@ -28,13 +34,6 @@ linters:
2834
- tenv
2935
- durationcheck
3036

31-
linters-settings:
32-
goheader:
33-
values:
34-
regexp:
35-
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
36-
template-path: .license.tmpl
37-
3837
service:
3938
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
4039

@@ -52,3 +51,4 @@ run:
5251
skip-dirs:
5352
- pkg/clientgen
5453
- pkg/apis/networking.gke.io
54+
- restapi/operations

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
17

CREDITS

Lines changed: 1282 additions & 1738 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:17 as uilayer
1+
ARG NODE_VERSION
2+
FROM node:$NODE_VERSION as uilayer
23

34
WORKDIR /app
45

Dockerfile.assets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:17 as uilayer
1+
ARG NODE_VERSION
2+
FROM node:$NODE_VERSION as uilayer
23

34
WORKDIR /app
45

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ BUILD_TIME:=$(shell date 2>/dev/null)
66
TAG ?= "minio/console:$(BUILD_VERSION)-dev"
77
MINIO_VERSION ?= "quay.io/minio/minio:latest"
88
TARGET_BUCKET ?= "target"
9+
NODE_VERSION := $(shell cat .nvmrc)
910

1011
default: console
1112

@@ -15,13 +16,13 @@ console:
1516
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue,operator --ldflags "-s -w" -o console ./cmd/console)
1617

1718
k8sdev:
18-
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
19+
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
1920
@kind load docker-image $(TAG)
2021
@echo "Done, now restart your console deployment"
2122

2223
getdeps:
2324
@mkdir -p ${GOPATH}/bin
24-
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.45.2
25+
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
2526

2627
verifiers: getdeps fmt lint
2728

@@ -63,7 +64,8 @@ swagger-operator:
6364
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
6465

6566
assets:
66-
@(cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
67+
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
68+
cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
6769

6870
test-integration:
6971
@(docker stop pgsqlcontainer || true)
@@ -261,7 +263,7 @@ clean:
261263
@rm -vf console
262264

263265
docker:
264-
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
266+
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
265267

266268
release: swagger-gen
267269
@echo "Generating Release: $(RELEASE)"

operatorapi/tenants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,6 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
15411541
func setTenantLogsResponse(session *models.Principal, params operator_api.SetTenantLogsParams) (bool, *models.Error) {
15421542
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
15431543
defer cancel()
1544-
15451544
opClientClientSet, err := cluster.OperatorClient(session.STSSessionToken)
15461545
if err != nil {
15471546
return false, restapi.ErrorWithContext(ctx, err, restapi.ErrUnableToGetTenantUsage)
@@ -1725,6 +1724,7 @@ func setTenantLogsResponse(session *models.Principal, params operator_api.SetTen
17251724
minTenant.Spec.Log.Db.Annotations = dbAnnotations
17261725
minTenant.Spec.Log.Db.NodeSelector = dbNodeSelector
17271726
minTenant.Spec.Log.Db.Image = params.Data.DbImage
1727+
minTenant.Spec.Log.Db.InitImage = params.Data.DbInitImage
17281728
minTenant.Spec.Log.Db.ServiceAccountName = params.Data.DbServiceAccountName
17291729
minTenant.Spec.Log.Db.SecurityContext, err = convertModelSCToK8sSC(params.Data.DbSecurityContext)
17301730
if err != nil {

pkg/auth/token.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ const (
180180
// or data key provided as plaintext.
181181
//
182182
// The returned ciphertext data consists of:
183-
// AEAD ID | iv | nonce | encrypted data
184-
// 1 16 12 ~ len(data)
183+
//
184+
// AEAD ID | iv | nonce | encrypted data
185+
// 1 16 12 ~ len(data)
185186
func encrypt(plaintext, associatedData []byte) ([]byte, error) {
186187
iv, err := sioutil.Random(16) // 16 bytes IV
187188
if err != nil {

pkg/certs/certs.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package certs
1919
import (
2020
"bytes"
2121
"context"
22-
"crypto"
23-
"crypto/ecdsa"
2422
"crypto/tls"
2523
"crypto/x509"
2624
"encoding/pem"
@@ -213,24 +211,7 @@ func LoadX509KeyPair(certFile, keyFile string) (tls.Certificate, error) {
213211
}
214212
keyPEMBlock = pem.EncodeToMemory(&pem.Block{Type: key.Type, Bytes: decryptedKey})
215213
}
216-
cert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock)
217-
if err != nil {
218-
return tls.Certificate{}, err
219-
}
220-
// Ensure that the private key is not a P-384 or P-521 EC key.
221-
// The Go TLS stack does not provide constant-time implementations of P-384 and P-521.
222-
if priv, ok := cert.PrivateKey.(crypto.Signer); ok {
223-
if pub, ok := priv.Public().(*ecdsa.PublicKey); ok {
224-
switch pub.Params().Name {
225-
case "P-384":
226-
fallthrough
227-
case "P-521":
228-
// unfortunately there is no cleaner way to check
229-
return tls.Certificate{}, fmt.Errorf("tls: the ECDSA curve '%s' is not supported", pub.Params().Name)
230-
}
231-
}
232-
}
233-
return cert, nil
214+
return tls.X509KeyPair(certPEMBlock, keyPEMBlock)
234215
}
235216

236217
func GetTLSConfig() (x509Certs []*x509.Certificate, manager *xcerts.Manager, err error) {

0 commit comments

Comments
 (0)