Skip to content

Commit 150c818

Browse files
kaovilaiclaude
andcommitted
Add Azure and GCP CloudStorage provider implementations
- Add Azure Blob Storage support with container operations - Add Google Cloud Storage support with bucket operations - Update CloudStorage API to support azure and gcp providers - Add config field to CloudStorage spec for provider-specific options - Add comprehensive unit tests for both Azure and GCP implementations - Update CRD manifests with new provider options 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 49be9fe commit 150c818

File tree

12 files changed

+2126
-51
lines changed

12 files changed

+2126
-51
lines changed

api/v1alpha1/cloudstorage_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ type CloudStorageSpec struct {
4242
// region for the bucket to be in, will be us-east-1 if not set.
4343
Region string `json:"region,omitempty"`
4444
// provider is the provider of the cloud storage
45-
// +kubebuilder:validation:Enum=aws
45+
// +kubebuilder:validation:Enum=aws;azure;gcp
4646
Provider CloudStorageProvider `json:"provider"`
47+
// config is provider-specific configuration options
48+
// +kubebuilder:validation:Optional
49+
Config map[string]string `json:"config,omitempty"`
4750

4851
// https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/storage/[email protected]#section-readme
4952
// azure blob primary endpoint

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/oadp.openshift.io_cloudstorages.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ spec:
3939
type: object
4040
spec:
4141
properties:
42+
config:
43+
additionalProperties:
44+
type: string
45+
description: config is provider-specific configuration options
46+
type: object
4247
creationSecret:
4348
description: creationSecret is the secret that is needed to be used
4449
while creating the bucket.
@@ -75,6 +80,8 @@ spec:
7580
description: provider is the provider of the cloud storage
7681
enum:
7782
- aws
83+
- azure
84+
- gcp
7885
type: string
7986
region:
8087
description: region for the bucket to be in, will be us-east-1 if

config/crd/bases/oadp.openshift.io_cloudstorages.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ spec:
3939
type: object
4040
spec:
4141
properties:
42+
config:
43+
additionalProperties:
44+
type: string
45+
description: config is provider-specific configuration options
46+
type: object
4247
creationSecret:
4348
description: creationSecret is the secret that is needed to be used
4449
while creating the bucket.
@@ -75,6 +80,8 @@ spec:
7580
description: provider is the provider of the cloud storage
7681
enum:
7782
- aws
83+
- azure
84+
- gcp
7885
type: string
7986
region:
8087
description: region for the bucket to be in, will be us-east-1 if

go.mod

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,39 @@ require (
2626
)
2727

2828
require (
29+
cloud.google.com/go/storage v1.54.0
30+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
31+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0
32+
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1
2933
github.com/aws/aws-sdk-go-v2 v1.30.3
3034
github.com/aws/aws-sdk-go-v2/config v1.26.3
3135
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.11
3236
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0
3337
github.com/deckarep/golang-set/v2 v2.3.0
34-
github.com/google/go-cmp v0.6.0
38+
github.com/google/go-cmp v0.7.0
3539
github.com/hashicorp/go-multierror v1.1.1
3640
github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0
3741
github.com/stretchr/testify v1.10.0
3842
github.com/vmware-tanzu/velero v1.14.0
3943
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
44+
google.golang.org/api v0.233.0
4045
k8s.io/klog/v2 v2.130.1
4146
)
4247

4348
require (
49+
cel.dev/expr v0.20.0 // indirect
50+
cloud.google.com/go v0.121.0 // indirect
51+
cloud.google.com/go/auth v0.16.1 // indirect
52+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
53+
cloud.google.com/go/compute/metadata v0.6.0 // indirect
54+
cloud.google.com/go/iam v1.5.2 // indirect
55+
cloud.google.com/go/monitoring v1.24.0 // indirect
56+
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
4457
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
58+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
59+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
60+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
61+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
4562
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
4663
github.com/aws/aws-sdk-go-v2/credentials v1.17.26 // indirect
4764
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
@@ -60,23 +77,33 @@ require (
6077
github.com/beorn7/perks v1.0.1 // indirect
6178
github.com/blang/semver/v4 v4.0.0 // indirect
6279
github.com/cespare/xxhash/v2 v2.3.0 // indirect
80+
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
6381
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6482
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
83+
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
84+
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
6585
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
6686
github.com/fatih/color v1.18.0 // indirect
87+
github.com/felixge/httpsnoop v1.0.4 // indirect
6788
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
89+
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
90+
github.com/go-logr/stdr v1.2.2 // indirect
6891
github.com/go-logr/zapr v1.3.0 // indirect
6992
github.com/go-openapi/jsonpointer v0.19.6 // indirect
7093
github.com/go-openapi/jsonreference v0.20.2 // indirect
7194
github.com/go-openapi/swag v0.22.4 // indirect
7295
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
7396
github.com/gobwas/glob v0.2.3 // indirect
7497
github.com/gogo/protobuf v1.3.2 // indirect
98+
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
7599
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
76100
github.com/golang/protobuf v1.5.4 // indirect
77101
github.com/google/gnostic-models v0.6.8 // indirect
78102
github.com/google/gofuzz v1.2.0 // indirect
79103
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
104+
github.com/google/s2a-go v0.1.9 // indirect
105+
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
106+
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
80107
github.com/gorilla/websocket v1.5.0 // indirect
81108
github.com/hashicorp/errwrap v1.0.0 // indirect
82109
github.com/hashicorp/go-hclog v1.2.0 // indirect
@@ -89,6 +116,7 @@ require (
89116
github.com/json-iterator/go v1.1.12 // indirect
90117
github.com/klauspost/compress v1.17.11 // indirect
91118
github.com/kubernetes-csi/external-snapshotter/client/v7 v7.0.0 // indirect
119+
github.com/kylelemons/godebug v1.1.0 // indirect
92120
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
93121
github.com/mailru/easyjson v0.7.7 // indirect
94122
github.com/mattn/go-colorable v0.1.14 // indirect
@@ -101,28 +129,45 @@ require (
101129
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
102130
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
103131
github.com/oklog/run v1.0.0 // indirect
132+
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
104133
github.com/pkg/errors v0.9.1 // indirect
134+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
105135
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
106136
github.com/prometheus/client_golang v1.20.5 // indirect
107137
github.com/prometheus/client_model v0.6.1 // indirect
108138
github.com/prometheus/common v0.62.0 // indirect
109139
github.com/prometheus/procfs v0.15.1 // indirect
110140
github.com/spf13/cobra v1.8.1 // indirect
111141
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
142+
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
112143
github.com/x448/float16 v0.8.4 // indirect
144+
github.com/zeebo/errs v1.4.0 // indirect
145+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
146+
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
147+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
148+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
149+
go.opentelemetry.io/otel v1.35.0 // indirect
150+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
151+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
152+
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
153+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
113154
go.uber.org/multierr v1.11.0 // indirect
114155
go.uber.org/zap v1.27.0 // indirect
115-
golang.org/x/net v0.36.0 // indirect
116-
golang.org/x/oauth2 v0.27.0 // indirect
117-
golang.org/x/sys v0.30.0 // indirect
118-
golang.org/x/term v0.29.0 // indirect
119-
golang.org/x/text v0.22.0 // indirect
120-
golang.org/x/time v0.9.0 // indirect
156+
golang.org/x/crypto v0.38.0 // indirect
157+
golang.org/x/net v0.40.0 // indirect
158+
golang.org/x/oauth2 v0.30.0 // indirect
159+
golang.org/x/sync v0.14.0 // indirect
160+
golang.org/x/sys v0.33.0 // indirect
161+
golang.org/x/term v0.32.0 // indirect
162+
golang.org/x/text v0.25.0 // indirect
163+
golang.org/x/time v0.11.0 // indirect
121164
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
122165
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
123-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
124-
google.golang.org/grpc v1.69.4 // indirect
125-
google.golang.org/protobuf v1.36.3 // indirect
166+
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
167+
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect
168+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
169+
google.golang.org/grpc v1.72.0 // indirect
170+
google.golang.org/protobuf v1.36.6 // indirect
126171
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
127172
gopkg.in/inf.v0 v0.9.1 // indirect
128173
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)