Skip to content

Commit

Permalink
Merge branch 'master' into style-check
Browse files Browse the repository at this point in the history
  • Loading branch information
julio-lopez authored Sep 5, 2024
2 parents d54ee39 + fe06a7f commit ddf4798
Show file tree
Hide file tree
Showing 33 changed files with 439 additions and 251 deletions.
167 changes: 33 additions & 134 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,151 +51,50 @@ updates:
docker:
patterns:
- "docker/*"
## Currently dependabot does not support wildcard or multiple directories
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
# Update pinned pip packages via requiements.txt
- package-ecosystem: "pip"
directory: "/docker/build"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker,pip):"
- package-ecosystem: "docker"
directory: "/docker/build"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/cassandra"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/controller"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/couchbase-tools"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/docs-build"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/foundationdb"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/kafka-adobes3Connector/image"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/kanister-elasticsearch/image"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/kanister-kubectl"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/kanister-mongodb-replicaset"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/kanister-mysql"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/license_extractor"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/mongodb"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/mongodb-atlas"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/mssql-tools"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"

# Update pinned pip packages via requiements.txt
- package-ecosystem: "pip"
directory: "/docker/postgres-kanister-tools"
schedule:
interval: weekly
schedule: weekly
commit-message:
prefix: "deps(docker,pip):"
directories:
- "/docker/build"
- "/docker/postgres-kanister-tools"
- "/docker/postgresql"

- package-ecosystem: "docker"
directory: "/docker/postgres-kanister-tools"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
# Update pinned pip packages via requiements.txt
- package-ecosystem: "pip"
directory: "/docker/postgresql"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker,pip):"
- package-ecosystem: "docker"
directory: "/docker/postgresql"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/redis-tools"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
- package-ecosystem: "docker"
directory: "/docker/repo-server-controller"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
directories:
- "/"
- "/docker/build"
- "/docker/tools"
- "/docker/controller"
- "/docker/kanister-kubectl"
- "/docker/repo-server-controller"
- "/docker/postgres-kanister-tools"

- package-ecosystem: "docker"
directory: "/docker/tools"
schedule:
interval: weekly
commit-message:
prefix: "deps(docker):"
directories:
- "/docker/cassandra"
- "/docker/couchbase-tools"
- "/docker/docs-build"
- "/docker/foundationdb"
- "/docker/kafka-adobes3Connector/image"
- "/docker/kanister-elasticsearch/image"
- "/docker/kanister-mongodb-replicaset"
- "/docker/kanister-mysql"
- "/docker/license_extractor"
- "/docker/mongodb"
- "/docker/mongodb-atlas"
- "/docker/mssql-tools"
- "/docker/postgresql"
- "/docker/redis-tools"


2 changes: 1 addition & 1 deletion .github/workflows/atlas-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: tj-actions/changed-files@40853de9f8ce2d6cfdc73c1b96f14e22ba44aec4 # v45.0.0
- uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275 # v45.0.1
name: Get changed files
id: changed-files
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
-
# Upload the results to GitHub's code scanning dashboard.
name: "Upload to results to dashboard"
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
sarif_file: results.sarif
-
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ issues:
exclude-rules:
- path: '_test.go'
linters:
- errcheck # Errors may be ignored in tests.
- unparam # Tests might have unused function parameters.
- lll
- dupl
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG base_image=registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194
ARG base_image=registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227
FROM ${base_image}
ARG kanister_version

Expand Down
4 changes: 2 additions & 2 deletions docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-bullseye
FROM golang:1.23-bullseye
LABEL maintainer="Tom Manville<[email protected]>"

ARG TARGETPLATFORM
Expand Down Expand Up @@ -31,7 +31,7 @@ RUN GOBIN=/usr/local/bin go install github.com/ahmetb/gen-crd-api-reference-docs

RUN apt-get update && apt-get install -y pip

COPY docker/build/requirements.txt requirements.txt
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

RUN apt-get install -y vim
Expand Down
2 changes: 1 addition & 1 deletion docker/controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227

LABEL maintainer="Tom Manville<[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion docker/mongodb-atlas/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227

RUN cat >/etc/yum.repos.d/mongodb.repo <<EOL
[mongodb-org-6.0]
Expand Down
4 changes: 2 additions & 2 deletions docker/tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Kopia binary
FROM golang:1.22-bullseye AS builder
FROM golang:1.23-bullseye AS builder

ARG kopia_build_commit=master
ARG kopia_repo_org=kopia
Expand Down Expand Up @@ -74,7 +74,7 @@ RUN apt-get update && apt-get -y install ca-certificates && \
USER kopia:kopia

# Build tools image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227
ARG kan_tools_version="test-version"
LABEL name="kanister-tools" \
vendor="Kanister" \
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require (
go.uber.org/zap v1.27.0
golang.org/x/oauth2 v0.22.0
gonum.org/v1/gonum v0.15.1
google.golang.org/api v0.194.0
google.golang.org/api v0.195.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637

Expand All @@ -74,7 +74,7 @@ require (
cloud.google.com/go/auth v0.9.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.12 // indirect
cloud.google.com/go/iam v1.1.13 // indirect
cloud.google.com/go/storage v1.43.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 // indirect; indirect;
Expand Down Expand Up @@ -217,9 +217,9 @@ require (
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbf
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/iam v1.1.12 h1:JixGLimRrNGcxvJEQ8+clfLxPlbeZA6MuRJ+qJNQ5Xw=
cloud.google.com/go/iam v1.1.12/go.mod h1:9LDX8J7dN5YRyzVHxwQzrQs9opFFqn0Mxs9nAeB+Hhg=
cloud.google.com/go/longrunning v0.5.11 h1:Havn1kGjz3whCfoD8dxMLP73Ph5w+ODyZB9RUsDxtGk=
cloud.google.com/go/longrunning v0.5.11/go.mod h1:rDn7//lmlfWV1Dx6IB4RatCPenTwwmqXuiP0/RgoEO4=
cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4=
cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus=
cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE=
cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=
Expand Down Expand Up @@ -753,8 +753,8 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.194.0 h1:dztZKG9HgtIpbI35FhfuSNR/zmaMVdxNlntHj1sIS4s=
google.golang.org/api v0.194.0/go.mod h1:AgvUFdojGANh3vI+P7EVnxj3AISHllxGCJSFmggmnd0=
google.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU=
google.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand All @@ -770,12 +770,12 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 h1:oLiyxGgE+rt22duwci1+TG7bg2/L1LQsXwfjPlmuJA0=
google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142/go.mod h1:G11eXq53iI5Q+kyNOmCvnzBaxEA2Q/Ik5Tj7nqBE8j4=
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf h1:GillM0Ef0pkZPIB+5iO6SDK+4T9pf6TpaYR6ICD5rVE=
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:OFMYQFHJ4TM3JRlWDZhJbZfra2uqc3WLBZiaaqP4DtU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok=
google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c h1:Kqjm4WpoWvwhMPcrAczoTyMySQmYa9Wy2iL6Con4zn8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
20 changes: 12 additions & 8 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,13 @@ func (s *ControllerSuite) TestRuntimeObjEventLogs(c *C) {
}

func (s *ControllerSuite) TestDeferPhase(c *C) {
os.Setenv(kube.PodNSEnvVar, "test")
err := os.Setenv(kube.PodNSEnvVar, "test")
c.Assert(err, IsNil)

ctx := context.Background()
bp := newBPWithDeferPhase()

bp, err := s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
bp, err = s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
c.Assert(err, IsNil)

// create backup actionset and wait for it to be completed
Expand Down Expand Up @@ -811,11 +812,12 @@ func (s *ControllerSuite) TestDeferPhase(c *C) {
// 3. Phases have correct state in actionset status
// 4. We don't render output artifacts if any of the phases failed
func (s *ControllerSuite) TestDeferPhaseCoreErr(c *C) {
os.Setenv(kube.PodNSEnvVar, "test")
err := os.Setenv(kube.PodNSEnvVar, "test")
c.Assert(err, IsNil)
ctx := context.Background()

bp := newBPWithDeferPhaseAndErrInCorePhase()
bp, err := s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
bp, err = s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
c.Assert(err, IsNil)

as := testutil.NewTestActionSet(s.namespace, bp.GetName(), "Deployment", s.deployment.GetName(), s.namespace, kanister.DefaultVersion, "backup")
Expand Down Expand Up @@ -846,11 +848,12 @@ func (s *ControllerSuite) TestDeferPhaseCoreErr(c *C) {
}

func (s *ControllerSuite) TestDeferPhaseDeferErr(c *C) {
os.Setenv(kube.PodNSEnvVar, "test")
err := os.Setenv(kube.PodNSEnvVar, "test")
c.Assert(err, IsNil)
ctx := context.Background()

bp := newBPWithDeferPhaseAndErrInDeferPhase()
bp, err := s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
bp, err = s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
c.Assert(err, IsNil)

as := testutil.NewTestActionSet(s.namespace, bp.GetName(), "Deployment", s.deployment.GetName(), s.namespace, kanister.DefaultVersion, "backup")
Expand Down Expand Up @@ -1058,11 +1061,12 @@ func (s *ControllerSuite) TestRenderArtifactsFailure(c *C) {
}

func (s *ControllerSuite) TestProgressRunningPhase(c *C) {
os.Setenv(kube.PodNSEnvVar, "test")
err := os.Setenv(kube.PodNSEnvVar, "test")
c.Assert(err, IsNil)
ctx := context.Background()

bp := newBPForProgressRunningPhase()
bp, err := s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
bp, err = s.crCli.Blueprints(s.namespace).Create(ctx, bp, metav1.CreateOptions{})
c.Assert(err, IsNil)

// create actionset and wait for it to reach Running state
Expand Down
Loading

0 comments on commit ddf4798

Please sign in to comment.