Skip to content

Commit

Permalink
controllers: create VRCs
Browse files Browse the repository at this point in the history
- Creates VolRepClass in response to changes made to DRClusterConfig
- k8s csi addons bump

Signed-off-by: raaizik <[email protected]>
  • Loading branch information
raaizik committed Nov 28, 2024
1 parent c99a838 commit 81ac1a6
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Storage
console.openshift.io/plugins: '["odf-client-console"]'
containerImage: quay.io/ocs-dev/ocs-client-operator:latest
createdAt: "2024-11-27T03:54:42Z"
createdAt: "2024-11-25T13:55:31Z"
description: OpenShift Data Foundation client operator enables consumption of
storage services from a remote centralized OpenShift Data Foundation provider
cluster.
Expand Down
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.22.7
replace (
github.com/portworx/sched-ops => github.com/portworx/sched-ops v0.20.4-openstorage-rc3 // required by Rook v1.12
github.com/red-hat-storage/ocs-client-operator/api => ./api
k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.29.0
vbom.ml/util => github.com/fvbommel/util v0.0.0-20180919145318-efcd4e0f9787
)

Expand All @@ -18,20 +19,22 @@ exclude (
)

require (
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3
github.com/ceph/ceph-csi-operator/api v0.0.0-20241119082218-62dc94e55c32
github.com/csi-addons/kubernetes-csi-addons v0.10.0
github.com/go-logr/logr v1.4.2
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.34.2
github.com/openshift/api v0.0.0-20240828125535-01b3675ba7b3
github.com/operator-framework/api v0.27.0
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0
github.com/ramendr/ramen/api v0.0.0-20241001141243-29d6f22ad237
github.com/ramendr/ramen/api v0.0.0-20241105140706-d8587766acb3
github.com/red-hat-storage/ocs-client-operator/api v0.0.0-00010101000000-000000000000
github.com/red-hat-storage/ocs-operator/services/provider/api/v4 v4.0.0-20241120160011-2e7cf0127dd4
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.68.0
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/api v0.31.1
k8s.io/apiextensions-apiserver v0.31.0
k8s.io/apimachinery v0.31.1
Expand All @@ -46,10 +49,8 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/component-base v0.31.0 // indirect
sigs.k8s.io/container-object-storage-interface-api v0.1.0 // indirect
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3 h1:ft8h5V7BfQqIGJAyiTvn6x86Oi/yMs8yqW7rfKvN9SQ=
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3/go.mod h1:odEUoarG26wXBCC2l4O4nMWhAz6VTKr2FRkv9yELgi8=
github.com/ceph/ceph-csi-operator/api v0.0.0-20241119082218-62dc94e55c32 h1:IawGJ9fPalvY77XtDElI4ZoVfU5aLnEKL3kwWBn3YEA=
github.com/ceph/ceph-csi-operator/api v0.0.0-20241119082218-62dc94e55c32/go.mod h1:odEUoarG26wXBCC2l4O4nMWhAz6VTKr2FRkv9yELgi8=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down Expand Up @@ -325,8 +325,8 @@ github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVho
github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/ramendr/ramen/api v0.0.0-20241001141243-29d6f22ad237 h1:ig6ePD0yopC5Qi5BRmhsIsKaOkdsGXTSmG3HTYIpquo=
github.com/ramendr/ramen/api v0.0.0-20241001141243-29d6f22ad237/go.mod h1:nO6VM/+PEhcPGyFIQJdhY6ip822cA61PAy/s6IjenAA=
github.com/ramendr/ramen/api v0.0.0-20241105140706-d8587766acb3 h1:q4UjNvv3jzKOeG/S+S1Ms2FV3WajBIE6266/7BIxdX4=
github.com/ramendr/ramen/api v0.0.0-20241105140706-d8587766acb3/go.mod h1:O7VpTy8MMrh31DF4fv+2SZBSouAr8NlzIY4KYx7K75U=
github.com/red-hat-storage/ocs-operator/services/provider/api/v4 v4.0.0-20241120160011-2e7cf0127dd4 h1:ppE7R+yh9I2PZuGPaUDdwQ45ZFV8YfHFNKccOxTo8tg=
github.com/red-hat-storage/ocs-operator/services/provider/api/v4 v4.0.0-20241120160011-2e7cf0127dd4/go.mod h1:XEZxUtzjlARPV8YvzcX2p7iiRbrUbDP4Q/CXx9ly5lw=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/storageclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"context"
"encoding/json"
"fmt"
"slices"
"strings"

v1alpha1 "github.com/red-hat-storage/ocs-client-operator/api/v1alpha1"
"github.com/red-hat-storage/ocs-client-operator/pkg/templates"
"github.com/red-hat-storage/ocs-client-operator/pkg/utils"
"slices"
"strings"

csiopv1a1 "github.com/ceph/ceph-csi-operator/api/v1alpha1"
"github.com/go-logr/logr"
Expand Down
19 changes: 10 additions & 9 deletions pkg/utils/k8sutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ func AddLabel(obj metav1.Object, key string, value string) bool {
return false
}

func AddAnnotations(obj metav1.Object, newAnnotations map[string]string) {
annotations := obj.GetAnnotations()
if annotations == nil {
annotations = map[string]string{}
obj.SetAnnotations(annotations)
}
maps.Copy(annotations, newAnnotations)
}

// AddAnnotation adds an annotation to a resource metadata, returns true if added else false
func AddAnnotation(obj metav1.Object, key string, value string) bool {
annotations := obj.GetAnnotations()
Expand All @@ -128,6 +119,16 @@ func AddAnnotation(obj metav1.Object, key string, value string) bool {
return false
}

// AddAnnotations adds values from newAnnotations to the keys on the supplied obj or overwrites values for existing keys on the obj
func AddAnnotations(obj metav1.Object, newAnnotations map[string]string) {
annotations := obj.GetAnnotations()
if annotations == nil {
annotations = map[string]string{}
obj.SetAnnotations(annotations)
}
maps.Copy(annotations, newAnnotations)
}

func GetMD5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
Expand Down
47 changes: 47 additions & 0 deletions vendor/github.com/ramendr/ramen/api/v1alpha1/drpolicy_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ github.com/beorn7/perks/quantile
# github.com/blang/semver/v4 v4.0.0
## explicit; go 1.14
github.com/blang/semver/v4
# github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3
# github.com/ceph/ceph-csi-operator/api v0.0.0-20241119082218-62dc94e55c32
## explicit; go 1.22.0
github.com/ceph/ceph-csi-operator/api/v1alpha1
# github.com/cespare/xxhash/v2 v2.3.0
Expand Down Expand Up @@ -213,8 +213,8 @@ github.com/prometheus/common/model
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
# github.com/ramendr/ramen/api v0.0.0-20241001141243-29d6f22ad237
## explicit; go 1.22.0
# github.com/ramendr/ramen/api v0.0.0-20241105140706-d8587766acb3
## explicit; go 1.22.5
github.com/ramendr/ramen/api/v1alpha1
# github.com/red-hat-storage/ocs-client-operator/api v0.0.0-00010101000000-000000000000 => ./api
## explicit; go 1.22.5
Expand Down Expand Up @@ -928,4 +928,5 @@ sigs.k8s.io/yaml
sigs.k8s.io/yaml/goyaml.v2
# github.com/portworx/sched-ops => github.com/portworx/sched-ops v0.20.4-openstorage-rc3
# github.com/red-hat-storage/ocs-client-operator/api => ./api
# k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.29.0
# vbom.ml/util => github.com/fvbommel/util v0.0.0-20180919145318-efcd4e0f9787

0 comments on commit 81ac1a6

Please sign in to comment.