Skip to content

Commit

Permalink
Merge pull request #2807 from red-hat-storage/sync_ds--main
Browse files Browse the repository at this point in the history
Syncing latest changes from main for ocs-operator
  • Loading branch information
openshift-merge-bot[bot] committed Sep 17, 2024
2 parents 646cf77 + db995ca commit fef90c5
Show file tree
Hide file tree
Showing 741 changed files with 405,377 additions and 34 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ deps-update:
cd api && go mod tidy && go mod vendor
@echo "Running deps-update on metrics submodule"
cd metrics && go mod tidy && go mod vendor
@echo "Running deps-update on provider/api submodule"
cd services/provider/api && go mod tidy && go mod vendor

operator-sdk:
@echo "Ensuring operator-sdk"
Expand Down
2 changes: 1 addition & 1 deletion api/v1/storagecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type StorageClusterSpec struct {
Arbiter ArbiterSpec `json:"arbiter,omitempty"`
// Mirroring specifies data mirroring configuration for the storage cluster.
// This configuration will only be applied to resources managed by the operator.
Mirroring MirroringSpec `json:"mirroring,omitempty"`
Mirroring *MirroringSpec `json:"mirroring,omitempty"`
// OverprovisionControl specifies the allowed hard-limit PVs overprovisioning relative to
// the effective usable storage capacity.
OverprovisionControl []OverprovisionControlSpec `json:"overprovisionControl,omitempty"`
Expand Down
6 changes: 5 additions & 1 deletion api/v1/zz_generated.deepcopy.go

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

24 changes: 16 additions & 8 deletions controllers/storagecluster/cephblockpools.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ func (o *ocsCephBlockPools) reconcileCephBlockPool(r *StorageClusterReconciler,
cephBlockPool.Spec.PoolSpec.Replicated = generateCephReplicatedSpec(storageCluster, "data")
cephBlockPool.Spec.PoolSpec.EnableRBDStats = true

if storageCluster.Spec.Mirroring.Enabled {
cephBlockPool.Spec.PoolSpec.Mirroring.Enabled = true
cephBlockPool.Spec.PoolSpec.Mirroring.Mode = "image"
cephBlockPool.Spec.PoolSpec.Mirroring.Peers = o.addPeerSecretsToCephBlockPool(r, storageCluster, cephBlockPool.Name, cephBlockPool.Namespace)
if storageCluster.Spec.Mirroring != nil {
if storageCluster.Spec.Mirroring.Enabled {
cephBlockPool.Spec.PoolSpec.Mirroring.Enabled = true
cephBlockPool.Spec.PoolSpec.Mirroring.Mode = "image"
cephBlockPool.Spec.PoolSpec.Mirroring.Peers = o.addPeerSecretsToCephBlockPool(r, storageCluster, cephBlockPool.Name, cephBlockPool.Namespace)
} else {
cephBlockPool.Spec.PoolSpec.Mirroring = cephv1.MirroringSpec{Enabled: false}
}
}
return controllerutil.SetControllerReference(storageCluster, cephBlockPool, r.Scheme)
})
Expand Down Expand Up @@ -249,10 +253,14 @@ func (o *ocsCephBlockPools) reconcileNonResilientCephBlockPool(r *StorageCluster
}
cephBlockPool.Spec.PoolSpec.EnableRBDStats = true

if storageCluster.Spec.Mirroring.Enabled {
cephBlockPool.Spec.PoolSpec.Mirroring.Enabled = true
cephBlockPool.Spec.PoolSpec.Mirroring.Mode = "image"
cephBlockPool.Spec.PoolSpec.Mirroring.Peers = o.addPeerSecretsToCephBlockPool(r, storageCluster, cephBlockPool.Name, cephBlockPool.Namespace)
if storageCluster.Spec.Mirroring != nil {
if storageCluster.Spec.Mirroring.Enabled {
cephBlockPool.Spec.PoolSpec.Mirroring.Enabled = true
cephBlockPool.Spec.PoolSpec.Mirroring.Mode = "image"
cephBlockPool.Spec.PoolSpec.Mirroring.Peers = o.addPeerSecretsToCephBlockPool(r, storageCluster, cephBlockPool.Name, cephBlockPool.Namespace)
} else {
cephBlockPool.Spec.PoolSpec.Mirroring = cephv1.MirroringSpec{Enabled: false}
}
}
return controllerutil.SetControllerReference(storageCluster, cephBlockPool, r.Scheme)
})
Expand Down
6 changes: 3 additions & 3 deletions controllers/storagecluster/cephblockpools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestInjectingPeerTokenToCephBlockPool(t *testing.T) {
label: "test-injecting-peer-token-to-cephblockpool",
createRuntimeObjects: false,
spec: &api.StorageClusterSpec{
Mirroring: api.MirroringSpec{
Mirroring: &api.MirroringSpec{
Enabled: true,
PeerSecretNames: []string{testPeerSecretName},
},
Expand All @@ -65,7 +65,7 @@ func TestInjectingPeerTokenToCephBlockPool(t *testing.T) {
label: "test-injecting-empty-peer-token-to-cephblockpool",
createRuntimeObjects: false,
spec: &api.StorageClusterSpec{
Mirroring: api.MirroringSpec{
Mirroring: &api.MirroringSpec{
Enabled: true,
PeerSecretNames: []string{},
},
Expand All @@ -75,7 +75,7 @@ func TestInjectingPeerTokenToCephBlockPool(t *testing.T) {
label: "test-injecting-invalid-peer-token-cephblockpool",
createRuntimeObjects: false,
spec: &api.StorageClusterSpec{
Mirroring: api.MirroringSpec{
Mirroring: &api.MirroringSpec{
Enabled: true,
PeerSecretNames: []string{"wrong-secret-name"},
},
Expand Down
6 changes: 3 additions & 3 deletions controllers/storagecluster/cephrbdmirrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (obj *ocsCephRbdMirrors) ensureCreated(r *StorageClusterReconciler, instanc
return reconcile.Result{}, err
}

if !instance.Spec.Mirroring.Enabled {
if instance.Spec.Mirroring == nil || !instance.Spec.Mirroring.Enabled {
return reconcile.Result{}, r.deleteCephRbdMirrorInstance(cephRbdMirrors)
}

Expand Down Expand Up @@ -168,7 +168,7 @@ ceph config rm mgr mgr/rbd_support/log_level
echo "completed"`

// Mirroring is enabled but the debug logging is disabled
if sc.Spec.Mirroring.Enabled && !rbdMirrorDebugLoggingEnabled {
if sc.Spec.Mirroring != nil && sc.Spec.Mirroring.Enabled && !rbdMirrorDebugLoggingEnabled {

err := r.Client.Create(r.ctx, getRbdMirrorDebugLoggingJob(sc, enableRbdMirrorDebugLoggingJobName, enableRbdMirrorDebugLoggingCommands))
if err != nil && !errors.IsAlreadyExists(err) {
Expand All @@ -190,7 +190,7 @@ ceph config rm mgr mgr/rbd_support/log_level
rbdMirrorDebugLoggingEnabled = true
}
// Mirroring is disabled but the debug logging is enabled
if !sc.Spec.Mirroring.Enabled && rbdMirrorDebugLoggingEnabled {
if (sc.Spec.Mirroring == nil || !sc.Spec.Mirroring.Enabled) && rbdMirrorDebugLoggingEnabled {
err := r.Client.Create(r.ctx, getRbdMirrorDebugLoggingJob(sc, disableRbdMirrorDebugLoggingJobName, disableRbdMirrorDebugLoggingCommands))
if err != nil && !errors.IsAlreadyExists(err) {
return reconcile.Result{}, err
Expand Down
4 changes: 2 additions & 2 deletions controllers/storagecluster/cephrbdmirrors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestCephRbdMirror(t *testing.T) {
label: "create-ceph-rbd-mirror",
createRuntimeObjects: false,
spec: &api.StorageClusterSpec{
Mirroring: api.MirroringSpec{
Mirroring: &api.MirroringSpec{
Enabled: true,
PeerSecretNames: []string{testPeerSecretName},
},
Expand All @@ -34,7 +34,7 @@ func TestCephRbdMirror(t *testing.T) {
label: "delete-ceph-rbd-mirror",
createRuntimeObjects: false,
spec: &api.StorageClusterSpec{
Mirroring: api.MirroringSpec{
Mirroring: &api.MirroringSpec{
Enabled: false,
},
},
Expand Down
5 changes: 4 additions & 1 deletion controllers/storagecluster/noobaa_system_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ func (r *StorageClusterReconciler) setNooBaaDesiredState(nb *nbv1.NooBaa, sc *oc
placement := getPlacement(sc, component)

nb.Spec.Tolerations = placement.Tolerations
nb.Spec.Affinity = &corev1.Affinity{NodeAffinity: placement.NodeAffinity}
// if we are "noobaa-standalone" and placement is not set - don't set affinity
if !r.IsNoobaaStandalone || ok {
nb.Spec.Affinity = &corev1.Affinity{NodeAffinity: placement.NodeAffinity}
}
nb.Spec.DBVolumeResources = &corev1.VolumeResourceRequirements{
Limits: dBVolumeResources.Limits,
Requests: dBVolumeResources.Requests,
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ replace github.com/red-hat-storage/ocs-operator/api/v4 => ./api

replace github.com/red-hat-storage/ocs-operator/metrics/v4 => ./metrics

replace github.com/red-hat-storage/ocs-operator/services/provider/api/v4 => ./services/provider/api

require (
github.com/RHsyseng/operator-utils v1.4.13
github.com/blang/semver/v4 v4.0.0
Expand All @@ -31,12 +33,12 @@ require (
github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.0
github.com/red-hat-storage/ocs-client-operator v0.0.0-20240731100835-31192d2c370e
github.com/red-hat-storage/ocs-operator/api/v4 v4.0.0-20240731064750-930a78b89d84
github.com/red-hat-storage/ocs-operator/services/provider/api/v4 v4.0.0-00010101000000-000000000000
github.com/rook/rook/pkg/apis v0.0.0-20240828225153-88eab510dd2b
github.com/stretchr/testify v1.9.0
go.uber.org/multierr v1.11.0
golang.org/x/net v0.28.0
google.golang.org/grpc v1.66.0
google.golang.org/protobuf v1.34.2
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.5.1
Expand Down Expand Up @@ -128,6 +130,7 @@ require (
golang.org/x/tools v0.24.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
google.golang.org/protobuf v1.34.2 // 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
Expand Down
4 changes: 2 additions & 2 deletions hack/gen-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ fi
# generate code
for service in "${SERVICES[@]}"
do
${PROTOC} --proto_path="services/${service}/proto" --go_out="services/${service}/pb" --plugin="${PROTOC_GEN_GO}" "${service}.proto"
${PROTOC} --proto_path="services/${service}/proto" --go-grpc_out="services/${service}/pb" --plugin="${PROTOC_GEN_GO_GRPC}" "${service}.proto"
${PROTOC} --proto_path="services/${service}/proto" --go_out="services/${service}/api" --plugin="${PROTOC_GEN_GO}" "${service}.proto"
${PROTOC} --proto_path="services/${service}/proto" --go-grpc_out="services/${service}/api" --plugin="${PROTOC_GEN_GO_GRPC}" "${service}.proto"
done

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.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"time"

ifaces "github.com/red-hat-storage/ocs-operator/v4/services/provider/interfaces"
pb "github.com/red-hat-storage/ocs-operator/v4/services/provider/pb"
pb "github.com/red-hat-storage/ocs-operator/services/provider/api/v4"
ifaces "github.com/red-hat-storage/ocs-operator/services/provider/api/v4/interfaces"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down
15 changes: 15 additions & 0 deletions services/provider/api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/red-hat-storage/ocs-operator/services/provider/api/v4

go 1.22.5

require (
google.golang.org/grpc v1.66.0
google.golang.org/protobuf v1.34.2
)

require (
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
)
14 changes: 14 additions & 0 deletions services/provider/api/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package providerpb

import (
ifaces "github.com/red-hat-storage/ocs-operator/v4/services/provider/interfaces"
ifaces "github.com/red-hat-storage/ocs-operator/services/provider/api/v4/interfaces"
)

// ensure ReportStatusRequest satisfies StorageClientStatus interface
Expand Down
27 changes: 27 additions & 0 deletions services/provider/api/vendor/golang.org/x/net/LICENSE

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

22 changes: 22 additions & 0 deletions services/provider/api/vendor/golang.org/x/net/PATENTS

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.

Loading

0 comments on commit fef90c5

Please sign in to comment.