diff --git a/Jenkinsfile b/Jenkinsfile index bf11c68a..55a20091 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -238,7 +238,7 @@ boolean isNightly() { } String getVersion() { - def prefix = "4.2.0-dev1" + def prefix = "4.2.0" def candidateName = "" if(isNightly()) { def timestamp = new Date().format("yyyy-MM-dd") diff --git a/config/samples/aerospikebackupservice.yaml b/config/samples/aerospikebackupservice.yaml index 7a33786f..d178cc8c 100644 --- a/config/samples/aerospikebackupservice.yaml +++ b/config/samples/aerospikebackupservice.yaml @@ -4,7 +4,7 @@ metadata: name: aerospikebackupservice-sample namespace: aerospike spec: - image: aerospike/aerospike-backup-service:3.2.0 + image: aerospike/aerospike-backup-service:3.4.0 config: service: http: diff --git a/go.mod b/go.mod index f423abc3..0a26e14c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aerospike/aerospike-kubernetes-operator/v4 go 1.24.10 require ( - github.com/aerospike/aerospike-backup-service/v3 v3.2.0 + github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1 github.com/aerospike/aerospike-client-go/v8 v8.4.1 github.com/aerospike/aerospike-management-lib v1.8.1-0.20251114122505-c5d5241d8594 github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d @@ -14,9 +14,9 @@ require ( github.com/onsi/gomega v1.36.2 github.com/prometheus/client_golang v1.22.0 github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.10.0 - golang.org/x/crypto v0.39.0 - golang.org/x/net v0.41.0 + github.com/stretchr/testify v1.11.1 + golang.org/x/crypto v0.41.0 + golang.org/x/net v0.43.0 k8s.io/api v0.33.0 k8s.io/apimachinery v0.33.0 k8s.io/client-go v0.33.0 @@ -27,11 +27,11 @@ require ( ) require ( - cel.dev/expr v0.23.0 // indirect + cel.dev/expr v0.24.0 // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/aerospike/backup-go v0.5.1 // indirect + github.com/aerospike/backup-go v0.8.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect - github.com/aws/smithy-go v1.22.4 // indirect + github.com/aws/smithy-go v1.23.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -61,7 +61,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.1 // indirect github.com/mailru/easyjson v0.9.0 // indirect github.com/moby/spdystream v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -73,12 +73,12 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.63.0 // indirect github.com/prometheus/procfs v0.16.0 // indirect - github.com/reugn/go-quartz v0.14.0 // indirect - github.com/segmentio/asm v1.2.0 // indirect - github.com/spf13/cobra v1.9.1 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/reugn/go-quartz v0.15.2 // indirect + github.com/segmentio/asm v1.2.1 // indirect + github.com/spf13/cobra v1.10.1 // indirect + github.com/spf13/pflag v1.0.9 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect - github.com/swaggo/swag v1.16.4 // indirect + github.com/swaggo/swag v1.16.6 // indirect github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect @@ -98,18 +98,19 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.27.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sync v0.15.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.26.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/term v0.34.0 // indirect + golang.org/x/text v0.28.0 // indirect golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.33.0 // indirect + golang.org/x/tools v0.36.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/grpc v1.73.0 // indirect - google.golang.org/protobuf v1.36.6 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect + google.golang.org/grpc v1.74.2 // indirect + google.golang.org/protobuf v1.36.7 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index f9aa1eb5..ef579ab9 100644 --- a/go.sum +++ b/go.sum @@ -1,23 +1,23 @@ -cel.dev/expr v0.23.0 h1:wUb94w6OYQS4uXraxo9U+wUAs9jT47Xvl4iPgAwM2ss= -cel.dev/expr v0.23.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= +cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= +cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/aerospike/aerospike-backup-service/v3 v3.2.0 h1:vqvT7OE1didb/R4vOTNWId2PYaJZ4BpVW9405yu3irA= -github.com/aerospike/aerospike-backup-service/v3 v3.2.0/go.mod h1:aSD1pSRjyMYQ1UW2Kkg/vinn+ngeobKzDIVj+UZIi2c= +github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1 h1:BgwbeMCy6hfosvtG19rEwk3N2DohzxKiej6r98X0Ndc= +github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1/go.mod h1:O96iFIRIgxZsp2J0LW/aT68Cxro+SkyRBmiYDgvJOOI= github.com/aerospike/aerospike-client-go/v8 v8.4.1 h1:WhkI3JxWf/irsDh0lcLpwdwSqbRiU8DWTtb8UuZz1Ew= github.com/aerospike/aerospike-client-go/v8 v8.4.1/go.mod h1:t1LXZ3QVi4B4lR9qEkyei1eMbuohBJBGs1YY5b5fYEI= github.com/aerospike/aerospike-management-lib v1.8.1-0.20251114122505-c5d5241d8594 h1:Mp4N7J3Zx+kinwQm4vUu7KoJ1+Ygq2p9eNilEtW5tug= github.com/aerospike/aerospike-management-lib v1.8.1-0.20251114122505-c5d5241d8594/go.mod h1:91WXtmHojERsKw1o/L/sehgUEYuqOCb58zi37vaIyH4= -github.com/aerospike/backup-go v0.5.1 h1:8ryLV0nOoo3Zn7LRV1kQABFnYgg1V0r9ZJJOL22FBs0= -github.com/aerospike/backup-go v0.5.1/go.mod h1:+RJdOaVCG6jQlhoNIJrzQgZnJ/HEBPfAiPGdv3YYzyg= +github.com/aerospike/backup-go v0.8.0 h1:9jR2YbG5joqDmoqqnwo/AbqrytJ2RCI0+TQYm2nMDAw= +github.com/aerospike/backup-go v0.8.0/go.mod h1:vmB+qTHv10pKIM6jtSHY7kLkD79lydkzIQP9znG1j6U= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw= -github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= +github.com/aws/smithy-go v1.23.1 h1:sLvcH6dfAFwGkHLZ7dGiYF7aK6mg4CgKA/iDKjLDt9M= +github.com/aws/smithy-go v1.23.1/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -94,8 +94,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -132,19 +132,19 @@ github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM= github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= -github.com/reugn/go-quartz v0.14.0 h1:KlIBAsOIw1JI8Rc7/f8VrrHBHOr+BiqrTiB35pRe84M= -github.com/reugn/go-quartz v0.14.0/go.mod h1:00DVnBKq2Fxag/HlR9mGXjmHNlMFQ1n/LNM+Fn0jUaE= +github.com/reugn/go-quartz v0.15.2 h1:IQUnwTtNURVtdcwH4CJhFH3dXAUwP2fXZaNjPp+sJAY= +github.com/reugn/go-quartz v0.15.2/go.mod h1:00DVnBKq2Fxag/HlR9mGXjmHNlMFQ1n/LNM+Fn0jUaE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= -github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= +github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= +github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= -github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= +github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -157,10 +157,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= -github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI= +github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -207,61 +207,61 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= -golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= -golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9 h1:WvBuA5rjZx9SNIzgcU53OohgZy6lKSus++uY4xLaWKc= -google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9/go.mod h1:W3S/3np0/dPWsWLi1h/UymYctGXaGBM2StwzD0y140U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c h1:AtEkQdl5b6zsybXcbz00j1LwNodDuH6hVifIaNqk7NQ= +google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c/go.mod h1:ea2MjsO70ssTfCjiwHgI0ZFqcw45Ksuk2ckf9G468GA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c h1:qXWI/sQtv5UKboZ/zUk7h+mrf/lXORyI+n9DKDAusdg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c/go.mod h1:gw1tLEfykwDz2ET4a12jcXt4couGAm7IwsVaTy0Sflo= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= +google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A= +google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -292,6 +292,8 @@ k8s.io/kubectl v0.32.3 h1:VMi584rbboso+yjfv0d8uBHwwxbC438LKq+dXd5tOAI= k8s.io/kubectl v0.32.3/go.mod h1:6Euv2aso5GKzo/UVMacV6C7miuyevpfI91SvBvV9Zdg= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= diff --git a/helm-charts/aerospike-backup-service/README.md b/helm-charts/aerospike-backup-service/README.md index 91e6f36b..7d06e1cd 100644 --- a/helm-charts/aerospike-backup-service/README.md +++ b/helm-charts/aerospike-backup-service/README.md @@ -53,7 +53,7 @@ helm install aerospike-backup-service aerospike/aerospike-backup-service \ | Name | Description | Default | |-----------------------|-------------------------------------------------------------------------------|--------------------------------------| | `image.repository` | Aerospike backup service container image repository | `aerospike/aerospike-backup-service` | -| `image.tag` | Aerospike backup service container image tag | `3.2.0` | +| `image.tag` | Aerospike backup service container image tag | `3.4.0` | | `customLabels` | Custom labels to add on the Aerospike backup service resource | `{}` (nil) | | `backupServiceConfig` | Aerospike backup service configuration | `{}` (nil) | | `secrets` | Secrets to be mounted in the Aerospike backup service pod like aws creds etc. | `[]` (nil) | diff --git a/helm-charts/aerospike-backup-service/values.yaml b/helm-charts/aerospike-backup-service/values.yaml index c6a5a645..d7a3201d 100644 --- a/helm-charts/aerospike-backup-service/values.yaml +++ b/helm-charts/aerospike-backup-service/values.yaml @@ -11,7 +11,7 @@ nameOverride: "" ## Image is the image for the backup service. image: repository: aerospike/aerospike-backup-service - tag: "3.2.0" + tag: "3.4.0" ## Custom labels that will be applied on the AerospikeBackupService resource customLabels: {} diff --git a/test/backup/backup_suite_test.go b/test/backup/backup_suite_test.go index 25398b72..ebddf420 100644 --- a/test/backup/backup_suite_test.go +++ b/test/backup/backup_suite_test.go @@ -61,7 +61,7 @@ var _ = BeforeSuite( By("Deploy Backup Service") backupServiceNamespacedName := test.GetNamespacedName("backup-service", namespace) - backupService, err := backupservice.NewBackupService(backupServiceNamespacedName) + backupService, err := backupservice.NewBackupServiceWithTLSSecretMounts(backupServiceNamespacedName) Expect(err).ToNot(HaveOccurred()) backupService.Spec.Service = &asdbv1beta1.Service{ @@ -76,7 +76,7 @@ var _ = BeforeSuite( By("Deploy Aerospike Cluster") cascadeDeleteTrue := true - aeroCluster := cluster.CreateDummyAerospikeCluster(aerospikeNsNm, 2) + aeroCluster := cluster.CreateBasicTLSCluster(aerospikeNsNm, 2) aeroCluster.Spec.Storage.BlockVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue aeroCluster.Spec.Storage.FileSystemVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue diff --git a/test/backup/backup_test.go b/test/backup/backup_test.go index e037e5a2..487d6c8d 100644 --- a/test/backup/backup_test.go +++ b/test/backup/backup_test.go @@ -366,6 +366,17 @@ var _ = Describe( }) + It("Should trigger backup when correct backup config with TLS and local storage are given", func() { + backup, err = NewBackupWithTLS(backupNsNm) + Expect(err).ToNot(HaveOccurred()) + err = CreateBackup(k8sClient, backup) + Expect(err).ToNot(HaveOccurred()) + + err = validateTriggeredBackup(k8sClient, backup) + Expect(err).ToNot(HaveOccurred()) + + }) + It("Should trigger backup when correct backup config with s3 storage is given", func() { config := getBackupConfigInMap(namePrefix(backupNsNm)) backupRoutines := config[asdbv1beta1.BackupRoutinesKey].(map[string]interface{}) diff --git a/test/backup/test_utils.go b/test/backup/test_utils.go index 50002268..6812e03e 100644 --- a/test/backup/test_utils.go +++ b/test/backup/test_utils.go @@ -41,7 +41,7 @@ var aerospikeNsNm = types.NamespacedName{ } func NewBackup(backupNsNm types.NamespacedName) (*asdbv1beta1.AerospikeBackup, error) { - configBytes, err := getBackupConfBytes(namePrefix(backupNsNm)) + configBytes, err := getBackupConfBytes(getBackupConfigInMap(namePrefix(backupNsNm))) if err != nil { return nil, err } @@ -55,6 +55,17 @@ func NewBackup(backupNsNm types.NamespacedName) (*asdbv1beta1.AerospikeBackup, e return backup, nil } +func NewBackupWithTLS(backupNsNm types.NamespacedName) (*asdbv1beta1.AerospikeBackup, error) { + configBytes, err := getBackupConfBytes(getBackupConfigWithTLSInMap(namePrefix(backupNsNm))) + if err != nil { + return nil, err + } + + backup := newBackupWithConfig(backupNsNm, configBytes) + + return backup, nil +} + func newBackupWithConfig(backupNsNm types.NamespacedName, conf []byte) *asdbv1beta1.AerospikeBackup { backup := newBackupWithEmptyConfig(backupNsNm) @@ -80,9 +91,7 @@ func newBackupWithEmptyConfig(backupNsNm types.NamespacedName) *asdbv1beta1.Aero } } -func getBackupConfBytes(prefix string) ([]byte, error) { - backupConfig := getBackupConfigInMap(prefix) - +func getBackupConfBytes(backupConfig map[string]interface{}) ([]byte, error) { configBytes, err := json.Marshal(backupConfig) if err != nil { return nil, err @@ -124,6 +133,27 @@ func getBackupConfigInMap(prefix string) map[string]interface{} { } } +func getBackupConfigWithTLSInMap(prefix string) map[string]interface{} { + backupConfig := getBackupConfigInMap(prefix) + + aerospikeClusterMap := backupConfig[asdbv1beta1.AerospikeClusterKey].(map[string]interface{}) + aerospikeCluster := aerospikeClusterMap[fmt.Sprintf("%s-%s", prefix, "test-cluster")].(map[string]interface{}) + + aerospikeCluster["tls"] = map[string]interface{}{ + "ca-path": "/etc/aerospike/secret/cacerts", + "name": "aerospike-a-0.test-runner", + "cert-file": "/etc/aerospike/secret/svc_cluster_chain.pem", + "key-file": "/etc/aerospike/secret/svc_key.pem", + } + + seedNodeList := aerospikeCluster["seed-nodes"].([]map[string]interface{}) + seedNode := seedNodeList[0] + seedNode["tls-name"] = "aerospike-a-0.test-runner" + seedNode["port"] = 4333 + + return backupConfig +} + func getWrongBackupConfBytes(prefix string) ([]byte, error) { backupConfig := getBackupConfigInMap(prefix) diff --git a/test/backup_service/test_utils.go b/test/backup_service/test_utils.go index d986d4a8..a7617286 100644 --- a/test/backup_service/test_utils.go +++ b/test/backup_service/test_utils.go @@ -23,7 +23,7 @@ import ( "github.com/aerospike/aerospike-kubernetes-operator/v4/test" ) -const BackupServiceImage = "aerospike/aerospike-backup-service:3.2.0" +const BackupServiceImage = "aerospike/aerospike-backup-service:3.4.0" const BackupServiceVersion2Image = "aerospike/aerospike-backup-service:2.0.0" const ( @@ -51,6 +51,40 @@ func NewBackupService(backupServiceNamespaceName types.NamespacedName) (*asdbv1b return backupService, nil } +func NewBackupServiceWithTLSSecretMounts(backupServiceNamespaceName types.NamespacedName, +) (*asdbv1beta1.AerospikeBackupService, error) { + configBytes, err := getBackupServiceConfBytes() + if err != nil { + return nil, err + } + + backupService := newBackupServiceWithEmptyConfig(backupServiceNamespaceName) + backupService.Spec.Config = runtime.RawExtension{ + Raw: configBytes, + } + + backupService.Spec.SecretMounts = append(backupService.Spec.SecretMounts, + asdbv1beta1.SecretMount{ + SecretName: test.TLSCacertSecretName, + VolumeMount: corev1.VolumeMount{ + Name: test.TLSCacertSecretName, + ReadOnly: true, + MountPath: "/etc/aerospike/secret/cacerts", + }, + }, + asdbv1beta1.SecretMount{ + SecretName: test.AerospikeSecretName, + VolumeMount: corev1.VolumeMount{ + Name: test.AerospikeSecretName, + ReadOnly: true, + MountPath: "/etc/aerospike/secret", + }, + }, + ) + + return backupService, nil +} + func newBackupServiceWithConfig(backupServiceNamespaceName types.NamespacedName, config []byte) *asdbv1beta1.AerospikeBackupService { backupService := newBackupServiceWithEmptyConfig(backupServiceNamespaceName) diff --git a/test/cluster/cluster_helper.go b/test/cluster/cluster_helper.go index c74a3b98..c39f1298 100644 --- a/test/cluster/cluster_helper.go +++ b/test/cluster/cluster_helper.go @@ -1317,6 +1317,7 @@ func createBasicTLSCluster( Roles: []string{ "sys-admin", "user-admin", + "read-write", }, }, }, @@ -1352,6 +1353,18 @@ func createBasicTLSCluster( return aeroCluster } +func CreateBasicTLSCluster( + clusterNamespacedName types.NamespacedName, size int32, +) *asdbv1.AerospikeCluster { + aeroCluster := createBasicTLSCluster(clusterNamespacedName, size) + aeroCluster.Spec.AerospikeConfig.Value[asdbv1.ConfKeyNamespace] = []interface{}{ + getSCNamespaceConfig("test", "/test/dev/xvdf"), + } + aeroCluster.Spec.Storage = getBasicStorageSpecObject() + + return aeroCluster +} + func createSSDStorageCluster( clusterNamespacedName types.NamespacedName, size int32, repFact int32, multiPodPerHost bool, diff --git a/test/cluster/cluster_test.go b/test/cluster/cluster_test.go index 9801eeab..0204a6b9 100644 --- a/test/cluster/cluster_test.go +++ b/test/cluster/cluster_test.go @@ -1401,12 +1401,7 @@ func UpdateTLSClusterTest(ctx goctx.Context) { BeforeEach( func() { - aeroCluster := createBasicTLSCluster(clusterNamespacedName, 3) - aeroCluster.Spec.AerospikeConfig.Value[asdbv1.ConfKeyNamespace] = []interface{}{ - getSCNamespaceConfig("test", "/test/dev/xvdf"), - } - aeroCluster.Spec.Storage = getBasicStorageSpecObject() - + aeroCluster := CreateBasicTLSCluster(clusterNamespacedName, 3) Expect(DeployCluster(k8sClient, ctx, aeroCluster)).ToNot(HaveOccurred()) }, ) diff --git a/test/cluster/rack_revision_test.go b/test/cluster/rack_revision_test.go index 5ec02320..21b99e90 100644 --- a/test/cluster/rack_revision_test.go +++ b/test/cluster/rack_revision_test.go @@ -105,7 +105,7 @@ var _ = Describe( Eventually(func() bool { return checkBothRevisionsExist(k8sClient, ctx, clusterNamespacedName, versionV1, versionV2) - }, 5*time.Minute, 10*time.Second).Should(BeTrue()) + }, 10*time.Minute, 10*time.Second).Should(BeTrue()) // Manually delete old StatefulSet By("Manually deleting old StatefulSet during migration") @@ -131,11 +131,12 @@ var _ = Describe( aeroCluster := createDummyClusterWithRackRevision(clusterNamespacedName, versionV1, 6) Expect(DeployCluster(k8sClient, ctx, aeroCluster)).ToNot(HaveOccurred()) + By("Changing rack revision to trigger migration") updatedCluster := changeRackRevision(k8sClient, ctx, clusterNamespacedName) Eventually(func() bool { return checkBothRevisionsExist(k8sClient, ctx, clusterNamespacedName, versionV1, versionV2) - }, 5*time.Minute, 5*time.Second).Should(BeTrue()) + }, 10*time.Minute, 10*time.Second).Should(BeTrue()) updatedCluster.Spec.Size = 2 @@ -344,7 +345,7 @@ func testRackRevisionChangeWithStorageUpdate( // Both rack revision StatefulSets should exist during migration Eventually(func() bool { return checkBothRevisionsExist(k8sClient, ctx, clusterNamespacedName, fromRevision, toRevision) - }, 5*time.Minute, 10*time.Second).Should(BeTrue()) + }, 10*time.Minute, 10*time.Second).Should(BeTrue()) By("Waiting for the migration to complete") diff --git a/test/restore/restore_suite_test.go b/test/restore/restore_suite_test.go index 6755ea4c..0b49073d 100644 --- a/test/restore/restore_suite_test.go +++ b/test/restore/restore_suite_test.go @@ -62,7 +62,8 @@ var _ = BeforeSuite( Expect(err).ToNot(HaveOccurred()) By("Deploy Backup Service") - backupService, err := backupservice.NewBackupService(test.GetNamespacedName("backup-service", namespace)) + backupService, err := backupservice.NewBackupServiceWithTLSSecretMounts( + test.GetNamespacedName("backup-service", namespace)) Expect(err).ToNot(HaveOccurred()) backupService.Spec.Service = &asdbv1beta1.Service{ @@ -78,7 +79,7 @@ var _ = BeforeSuite( cascadeDeleteTrue := true By(fmt.Sprintf("Deploy source Aerospike Cluster: %s", sourceAerospikeClusterNsNm.String())) - aeroCluster := cluster.CreateDummyAerospikeCluster(sourceAerospikeClusterNsNm, 2) + aeroCluster := cluster.CreateBasicTLSCluster(sourceAerospikeClusterNsNm, 2) aeroCluster.Spec.Storage.BlockVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue aeroCluster.Spec.Storage.FileSystemVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue @@ -93,7 +94,7 @@ var _ = BeforeSuite( ) Expect(err).NotTo(HaveOccurred()) - backupObj, err := backup.NewBackup(backupNsNm) + backupObj, err := backup.NewBackupWithTLS(backupNsNm) Expect(err).ToNot(HaveOccurred()) // Point to current suite's backup service @@ -113,7 +114,7 @@ var _ = BeforeSuite( backupDataPath = backupDataPaths[0] By(fmt.Sprintf("Deploy destination Aerospike Cluster: %s", destinationAerospikeClusterNsNm.String())) - aeroCluster = cluster.CreateDummyAerospikeCluster(destinationAerospikeClusterNsNm, 2) + aeroCluster = cluster.CreateBasicTLSCluster(destinationAerospikeClusterNsNm, 2) aeroCluster.Spec.Storage.BlockVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue aeroCluster.Spec.Storage.FileSystemVolumePolicy.InputCascadeDelete = &cascadeDeleteTrue diff --git a/test/restore/restore_test.go b/test/restore/restore_test.go index e55a1a09..62a4749c 100644 --- a/test/restore/restore_test.go +++ b/test/restore/restore_test.go @@ -153,7 +153,19 @@ var _ = Describe( err = validateRestoredData(k8sClient) Expect(err).ToNot(HaveOccurred()) + }, + ) + It( + "Should complete restore for Full restore type and with TLS configured", func() { + restore, err = newRestoreWithTLS(restoreNsNm, asdbv1beta1.Full) + Expect(err).ToNot(HaveOccurred()) + + err = createRestore(k8sClient, restore) + Expect(err).ToNot(HaveOccurred()) + + err = validateRestoredData(k8sClient) + Expect(err).ToNot(HaveOccurred()) }, ) @@ -167,26 +179,27 @@ var _ = Describe( err = validateRestoredData(k8sClient) Expect(err).ToNot(HaveOccurred()) - }, ) It( "Should complete restore for Timestamp restore type", func() { - restoreConfig := getRestoreConfigInMap(backupDataPath) - delete(restoreConfig, asdbv1beta1.SourceKey) - delete(restoreConfig, asdbv1beta1.BackupDataPathKey) + configBytes, err := getTimeStampRestoreConfigBytes(getRestoreConfigInMap(backupDataPath)) + Expect(err).ToNot(HaveOccurred()) - parts := strings.Split(backupDataPath, "/") - time := parts[len(parts)-3] - timeInt, err := strconv.Atoi(time) + restore = newRestoreWithConfig(restoreNsNm, asdbv1beta1.Timestamp, configBytes) + + err = createRestore(k8sClient, restore) Expect(err).ToNot(HaveOccurred()) - // increase time by 1 millisecond to consider the latest backup under time bound - restoreConfig[asdbv1beta1.TimeKey] = int64(timeInt) + 1 - restoreConfig[asdbv1beta1.RoutineKey] = parts[len(parts)-5] + err = validateRestoredData(k8sClient) + Expect(err).ToNot(HaveOccurred()) + }, + ) - configBytes, err := json.Marshal(restoreConfig) + It( + "Should complete restore for Timestamp restore type and with TLS configured", func() { + configBytes, err := getTimeStampRestoreConfigBytes(getRestoreConfigWithTLSInMap(backupDataPath)) Expect(err).ToNot(HaveOccurred()) restore = newRestoreWithConfig(restoreNsNm, asdbv1beta1.Timestamp, configBytes) @@ -196,8 +209,23 @@ var _ = Describe( err = validateRestoredData(k8sClient) Expect(err).ToNot(HaveOccurred()) - }, ) }) }) + +func getTimeStampRestoreConfigBytes(restoreConfig map[string]interface{}) (configBytes []byte, err error) { + delete(restoreConfig, asdbv1beta1.SourceKey) + delete(restoreConfig, asdbv1beta1.BackupDataPathKey) + + parts := strings.Split(backupDataPath, "/") + timeStamp := parts[len(parts)-3] + timeInt, err := strconv.Atoi(timeStamp) + Expect(err).ToNot(HaveOccurred()) + + // increase time by 1 millisecond to consider the latest backup under time bound + restoreConfig[asdbv1beta1.TimeKey] = int64(timeInt) + 1 + restoreConfig[asdbv1beta1.RoutineKey] = parts[len(parts)-5] + + return getRestoreConfBytes(restoreConfig) +} diff --git a/test/restore/test_utils.go b/test/restore/test_utils.go index 90a7ee0a..59a4fa11 100644 --- a/test/restore/test_utils.go +++ b/test/restore/test_utils.go @@ -50,7 +50,7 @@ var destinationAerospikeClusterNsNm = types.NamespacedName{ func newRestore(restoreNsNm types.NamespacedName, restoreType asdbv1beta1.RestoreType, ) (*asdbv1beta1.AerospikeRestore, error) { - configBytes, err := getRestoreConfBytes(backupDataPath) + configBytes, err := getRestoreConfBytes(getRestoreConfigInMap(backupDataPath)) if err != nil { return nil, err } @@ -64,6 +64,18 @@ func newRestore(restoreNsNm types.NamespacedName, restoreType asdbv1beta1.Restor return restore, nil } +func newRestoreWithTLS(restoreNsNm types.NamespacedName, restoreType asdbv1beta1.RestoreType, +) (*asdbv1beta1.AerospikeRestore, error) { + configBytes, err := getRestoreConfBytes(getRestoreConfigWithTLSInMap(backupDataPath)) + if err != nil { + return nil, err + } + + restore := newRestoreWithConfig(restoreNsNm, restoreType, configBytes) + + return restore, nil +} + func newRestoreWithConfig(restoreNsNm types.NamespacedName, restoreType asdbv1beta1.RestoreType, configBytes []byte, ) *asdbv1beta1.AerospikeRestore { restore := newRestoreWithEmptyConfig(restoreNsNm, restoreType) @@ -176,6 +188,8 @@ func waitForRestore(cl client.Client, restore *asdbv1beta1.AerospikeRestore, return fmt.Errorf("restore result is not set") } + pkgLog.Info(fmt.Sprintf("Restore result %s", string(restore.Status.RestoreResult.Raw))) + var restoreResult dto.RestoreJobStatus if err := json.Unmarshal(restore.Status.RestoreResult.Raw, &restoreResult); err != nil { @@ -186,6 +200,10 @@ func waitForRestore(cl client.Client, restore *asdbv1beta1.AerospikeRestore, return fmt.Errorf("restore job status is not done") } + if restoreResult.InsertedRecords == 0 { + return fmt.Errorf("no records were restored") + } + if restoreResult.Error != "" { return fmt.Errorf("restore job failed with error: %s", restoreResult.Error) } @@ -193,9 +211,7 @@ func waitForRestore(cl client.Client, restore *asdbv1beta1.AerospikeRestore, return nil } -func getRestoreConfBytes(backupPath string) ([]byte, error) { - restoreConfig := getRestoreConfigInMap(backupPath) - +func getRestoreConfBytes(restoreConfig map[string]interface{}) ([]byte, error) { configBytes, err := json.Marshal(restoreConfig) if err != nil { return nil, err @@ -237,6 +253,25 @@ func getRestoreConfigInMap(backupPath string) map[string]interface{} { } } +func getRestoreConfigWithTLSInMap(backupPath string) map[string]interface{} { + restoreConfig := getRestoreConfigInMap(backupPath) + restoreDestination := restoreConfig["destination"].(map[string]interface{}) + + restoreDestination["tls"] = map[string]interface{}{ + "ca-path": "/etc/aerospike/secret/cacerts", + "name": "aerospike-a-0.test-runner", + "cert-file": "/etc/aerospike/secret/svc_cluster_chain.pem", + "key-file": "/etc/aerospike/secret/svc_key.pem", + } + + seedNodeList := restoreDestination["seed-nodes"].([]map[string]interface{}) + seedNode := seedNodeList[0] + seedNode["tls-name"] = "aerospike-a-0.test-runner" + seedNode["port"] = 4333 + + return restoreConfig +} + func validateRestoredData(k8sClient client.Client) error { aeroCluster, err := cluster.GetCluster(k8sClient, testCtx, destinationAerospikeClusterNsNm) if err != nil {