diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf278b13..0a304d6de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- (Feature) PVCResize action concurrency limit ## [1.2.32](https://github.com/arangodb/kube-arangodb/tree/1.2.32) (2023-08-07) - (Feature) Backup lifetime - remove Backup once its lifetime has been reached diff --git a/cmd/cmd.go b/cmd/cmd.go index ce487ec50..48a24309e 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -51,6 +51,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/crd" "github.com/arangodb/kube-arangodb/pkg/deployment/agency/cache" "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/metrics/collector" @@ -236,6 +237,9 @@ func init() { if err := cache.Init(&cmdMain); err != nil { panic(err.Error()) } + if err := reconcile.ActionsConfigGlobal.Init(&cmdMain); err != nil { + panic(err.Error()) + } } func Execute() int { diff --git a/internal/actions.config.go.tmpl b/internal/actions.config.go.tmpl new file mode 100644 index 000000000..a21b564b9 --- /dev/null +++ b/internal/actions.config.go.tmpl @@ -0,0 +1,43 @@ +{{- $root := . -}} +// +// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package reconcile + +import "github.com/spf13/cobra" + +var ActionsConfigGlobal ActionsConfig + +type ActionsConfig struct { +{{- range .configurable }} + // {{ . }} keeps configuration for action api.ActionType{{ . }} + {{ . }} Action{{ . }}Config +{{- end }} +} + +// Init initializes all registered features. +// If a feature is not provided via process's argument, then it is taken from environment variable +// or from enabled by default setting. +func (a *ActionsConfig) Init(cmd *cobra.Command) error { +{{- range .configurable }} + if err := a.{{ . }}.Init(cmd); err != nil { + return err + } +{{- end }} + return nil +} \ No newline at end of file diff --git a/internal/actions.go b/internal/actions.go index d922c6d0b..461c51195 100644 --- a/internal/actions.go +++ b/internal/actions.go @@ -46,6 +46,9 @@ var actionsGoTemplate []byte //go:embed actions.register.go.tmpl var actionsRegisterGoTemplate []byte +//go:embed actions.config.go.tmpl +var actionsConfigGoTemplate []byte + //go:embed actions.register.test.go.tmpl var actionsRegisterTestGoTemplate []byte @@ -175,6 +178,16 @@ func (i ActionsInput) Timeouts() map[string]string { return r } +func (i ActionsInput) Configurable() []string { + var r []string + for k, a := range i.Actions { + if a.Configurable { + r = append(r, k) + } + } + return r +} + type Action struct { Timeout *meta.Duration `json:"timeout,omitempty"` StartupFailureGracePeriod *meta.Duration `json:"startupFailureGracePeriod,omitempty"` @@ -188,6 +201,8 @@ type Action struct { IsInternal bool `json:"isInternal"` Optional bool `json:"optional"` + + Configurable bool `json:"configurable"` } func (a Action) InScope(scope string) bool { @@ -267,6 +282,30 @@ func RenderActions(root string) error { } } + { + actions := path.Join(root, "pkg", "deployment", "reconcile", "action.config.generated.go") + + out, err := os.OpenFile(actions, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) + if err != nil { + return err + } + + i, err := template.New("actions").Parse(string(actionsConfigGoTemplate)) + if err != nil { + return err + } + + if err := i.Execute(out, map[string]interface{}{ + "configurable": in.Configurable(), + }); err != nil { + return err + } + + if err := out.Close(); err != nil { + return err + } + } + { actions := path.Join(root, "pkg", "deployment", "reconcile", "action.register.generated_test.go") diff --git a/internal/actions.yaml b/internal/actions.yaml index 3825b826e..da6908374 100644 --- a/internal/actions.yaml +++ b/internal/actions.yaml @@ -106,6 +106,7 @@ actions: PVCResize: description: Start the resize procedure. Updates PVC Requests field timeout: 30m + configurable: true PVCResized: description: Waits for PVC resize to be completed timeout: 15m diff --git a/pkg/api/jwt.go b/pkg/api/jwt.go index e2f5b0ef8..4e6a99d08 100644 --- a/pkg/api/jwt.go +++ b/pkg/api/jwt.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/deployment/v1/member_status_list.go b/pkg/apis/deployment/v1/member_status_list.go index 73c5f3cd1..a4780b6ce 100644 --- a/pkg/apis/deployment/v1/member_status_list.go +++ b/pkg/apis/deployment/v1/member_status_list.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/deployment/v2alpha1/member_status_list.go b/pkg/apis/deployment/v2alpha1/member_status_list.go index c302fd8b4..d9a0eedaf 100644 --- a/pkg/apis/deployment/v2alpha1/member_status_list.go +++ b/pkg/apis/deployment/v2alpha1/member_status_list.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/acs/acs.community.go b/pkg/deployment/acs/acs.community.go index bf307c1aa..7ac94cb74 100644 --- a/pkg/deployment/acs/acs.community.go +++ b/pkg/deployment/acs/acs.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/chaos/monkey.go b/pkg/deployment/chaos/monkey.go index a24cbaa54..be15f0148 100644 --- a/pkg/deployment/chaos/monkey.go +++ b/pkg/deployment/chaos/monkey.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/member/state.go b/pkg/deployment/member/state.go index 8adcecc2d..1251e7935 100644 --- a/pkg/deployment/member/state.go +++ b/pkg/deployment/member/state.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/members.community.go b/pkg/deployment/members.community.go index c26a5e398..ba9e7db95 100644 --- a/pkg/deployment/members.community.go +++ b/pkg/deployment/members.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/pod/topology.community.go b/pkg/deployment/pod/topology.community.go index 812a24c09..3ad9ce425 100644 --- a/pkg/deployment/pod/topology.community.go +++ b/pkg/deployment/pod/topology.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action.config.generated.go b/pkg/deployment/reconcile/action.config.generated.go new file mode 100644 index 000000000..63a26215c --- /dev/null +++ b/pkg/deployment/reconcile/action.config.generated.go @@ -0,0 +1,38 @@ +// +// Copyright 2023 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package reconcile + +import "github.com/spf13/cobra" + +var ActionsConfigGlobal ActionsConfig + +type ActionsConfig struct { + // PVCResize keeps configuration for action api.ActionTypePVCResize + PVCResize ActionPVCResizeConfig +} + +// Init initializes all registered features. +// If a feature is not provided via process's argument, then it is taken from environment variable +// or from enabled by default setting. +func (a *ActionsConfig) Init(cmd *cobra.Command) error { + if err := a.PVCResize.Init(cmd); err != nil { + return err + } + return nil +} diff --git a/pkg/deployment/reconcile/action_bootstrap_set_password.go b/pkg/deployment/reconcile/action_bootstrap_set_password.go index 294ecb4d0..331e66796 100644 --- a/pkg/deployment/reconcile/action_bootstrap_set_password.go +++ b/pkg/deployment/reconcile/action_bootstrap_set_password.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_member_maintenance_disable.community.go b/pkg/deployment/reconcile/action_member_maintenance_disable.community.go index 764aa014c..9d7208bfe 100644 --- a/pkg/deployment/reconcile/action_member_maintenance_disable.community.go +++ b/pkg/deployment/reconcile/action_member_maintenance_disable.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_member_maintenance_enable.community.go b/pkg/deployment/reconcile/action_member_maintenance_enable.community.go index 9e1d603c8..c0e484c07 100644 --- a/pkg/deployment/reconcile/action_member_maintenance_enable.community.go +++ b/pkg/deployment/reconcile/action_member_maintenance_enable.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_placeholder.community.go b/pkg/deployment/reconcile/action_placeholder.community.go index 1513ccbca..862c76ada 100644 --- a/pkg/deployment/reconcile/action_placeholder.community.go +++ b/pkg/deployment/reconcile/action_placeholder.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_pvc_resize.go b/pkg/deployment/reconcile/action_pvc_resize.go index 3d6e04d13..c258e3bf7 100644 --- a/pkg/deployment/reconcile/action_pvc_resize.go +++ b/pkg/deployment/reconcile/action_pvc_resize.go @@ -23,6 +23,7 @@ package reconcile import ( "context" + "github.com/spf13/cobra" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,6 +33,18 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) +type ActionPVCResizeConfig struct { + Concurrency int +} + +func (a *ActionPVCResizeConfig) Init(cmd *cobra.Command) error { + f := cmd.Flags() + + f.IntVar(&a.Concurrency, "action.PVCResize.concurrency", 32, "Define limit of concurrent PVC Resizes on the cluster") + + return nil +} + // newRotateMemberAction creates a new Action that implements the given // planned RotateMember action. func newPVCResizeAction(action api.Action, actionCtx ActionContext) Action { diff --git a/pkg/deployment/reconcile/action_rebalancer_check.community.go b/pkg/deployment/reconcile/action_rebalancer_check.community.go index 327206428..de5926e21 100644 --- a/pkg/deployment/reconcile/action_rebalancer_check.community.go +++ b/pkg/deployment/reconcile/action_rebalancer_check.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_rebalancer_clean.community.go b/pkg/deployment/reconcile/action_rebalancer_clean.community.go index 1c0b0228d..15a54b4c3 100644 --- a/pkg/deployment/reconcile/action_rebalancer_clean.community.go +++ b/pkg/deployment/reconcile/action_rebalancer_clean.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_rebalancer_generate.community.go b/pkg/deployment/reconcile/action_rebalancer_generate.community.go index 05173eed8..f49bef530 100644 --- a/pkg/deployment/reconcile/action_rebalancer_generate.community.go +++ b/pkg/deployment/reconcile/action_rebalancer_generate.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_topology_disable.community.go b/pkg/deployment/reconcile/action_topology_disable.community.go index 6ff110f93..28bf8fd9d 100644 --- a/pkg/deployment/reconcile/action_topology_disable.community.go +++ b/pkg/deployment/reconcile/action_topology_disable.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_topology_enable.community.go b/pkg/deployment/reconcile/action_topology_enable.community.go index 1da251ec4..4fcdf0461 100644 --- a/pkg/deployment/reconcile/action_topology_enable.community.go +++ b/pkg/deployment/reconcile/action_topology_enable.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_topology_member_assignment.community.go b/pkg/deployment/reconcile/action_topology_member_assignment.community.go index 4eef9949a..be1dfe5ef 100644 --- a/pkg/deployment/reconcile/action_topology_member_assignment.community.go +++ b/pkg/deployment/reconcile/action_topology_member_assignment.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/action_topology_zones_update.community.go b/pkg/deployment/reconcile/action_topology_zones_update.community.go index 1e3062978..4b8374154 100644 --- a/pkg/deployment/reconcile/action_topology_zones_update.community.go +++ b/pkg/deployment/reconcile/action_topology_zones_update.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/plan_builder_maintenance.community.go b/pkg/deployment/reconcile/plan_builder_maintenance.community.go index c66b0b961..9802a222b 100644 --- a/pkg/deployment/reconcile/plan_builder_maintenance.community.go +++ b/pkg/deployment/reconcile/plan_builder_maintenance.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/plan_builder_rebalancer.community.go b/pkg/deployment/reconcile/plan_builder_rebalancer.community.go index dce76322b..1c59df628 100644 --- a/pkg/deployment/reconcile/plan_builder_rebalancer.community.go +++ b/pkg/deployment/reconcile/plan_builder_rebalancer.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/reconcile/plan_builder_storage.go b/pkg/deployment/reconcile/plan_builder_storage.go index a8974a0da..fc8b2d160 100644 --- a/pkg/deployment/reconcile/plan_builder_storage.go +++ b/pkg/deployment/reconcile/plan_builder_storage.go @@ -47,12 +47,39 @@ func (r *Reconciler) createRotateServerStorageResizePlanRotate(ctx context.Conte func (r *Reconciler) createRotateServerStorageResizePlanInternal(spec api.DeploymentSpec, status api.DeploymentStatus, context PlanBuilderContext, mode api.PVCResizeMode) api.Plan { var plan api.Plan + pvcs := map[string]*core.PersistentVolumeClaim{} + for _, member := range status.Members.AsList() { cache, ok := context.ACS().ClusterCache(member.Member.ClusterID) if !ok { // Do not work without cache continue } + + if member.Member.PersistentVolumeClaim.GetName() == "" { + // Plan is irrelevant without PVC + continue + } + + pvc, exists := cache.PersistentVolumeClaim().V1().GetSimple(member.Member.PersistentVolumeClaim.GetName()) + if exists { + pvcs[member.Member.ID] = pvc.DeepCopy() + } + } + + resizing := 0 + + for _, pvc := range pvcs { + if k8sutil.IsPersistentVolumeClaimResizing(pvc) { + resizing++ + } + } + + for _, member := range status.Members.AsList() { + if resizing >= ActionsConfigGlobal.PVCResize.Concurrency { + break + } + if member.Member.Phase != api.MemberPhaseCreated { // Only make changes when phase is created continue @@ -73,7 +100,7 @@ func (r *Reconciler) createRotateServerStorageResizePlanInternal(spec api.Deploy } // Load PVC - pvc, exists := cache.PersistentVolumeClaim().V1().GetSimple(member.Member.PersistentVolumeClaim.GetName()) + pvc, exists := pvcs[member.Member.PersistentVolumeClaim.GetName()] if !exists { r.planLogger. Str("role", member.Group.AsRole()). diff --git a/pkg/deployment/reconcile/plan_builder_topology.community.go b/pkg/deployment/reconcile/plan_builder_topology.community.go index 3ee6ba77c..3ca3cf0a4 100644 --- a/pkg/deployment/reconcile/plan_builder_topology.community.go +++ b/pkg/deployment/reconcile/plan_builder_topology.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index 40638c21b..fb4995e41 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/topology/mods.community.go b/pkg/deployment/topology/mods.community.go index 2d2b3d106..9c0755066 100644 --- a/pkg/deployment/topology/mods.community.go +++ b/pkg/deployment/topology/mods.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/deployment/topology/topology.community.go b/pkg/deployment/topology/topology.community.go index f473749b9..fab04bf89 100644 --- a/pkg/deployment/topology/topology.community.go +++ b/pkg/deployment/topology/topology.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/handlers/backup/arango_client_mock_test.go b/pkg/handlers/backup/arango_client_mock_test.go index 9f43adb17..4fcab27e7 100644 --- a/pkg/handlers/backup/arango_client_mock_test.go +++ b/pkg/handlers/backup/arango_client_mock_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/handlers/backup/arango_client_test.go b/pkg/handlers/backup/arango_client_test.go index e7da81e13..eb3ef17ac 100644 --- a/pkg/handlers/backup/arango_client_test.go +++ b/pkg/handlers/backup/arango_client_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/handlers/utils/strings.go b/pkg/handlers/utils/strings.go index 8d7b6ca70..f21198d23 100644 --- a/pkg/handlers/utils/strings.go +++ b/pkg/handlers/utils/strings.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 267d6342e..1523e3e1b 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/operatorV2/operator_suite_test.go b/pkg/operatorV2/operator_suite_test.go index f6dc5cdb6..569546750 100644 --- a/pkg/operatorV2/operator_suite_test.go +++ b/pkg/operatorV2/operator_suite_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/storage/resources/nodes.go b/pkg/storage/resources/nodes.go index cba48ad43..641daa087 100644 --- a/pkg/storage/resources/nodes.go +++ b/pkg/storage/resources/nodes.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/storage/resources/pods.go b/pkg/storage/resources/pods.go index c9ac1dfba..6842d1584 100644 --- a/pkg/storage/resources/pods.go +++ b/pkg/storage/resources/pods.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/util/k8sutil/pvc.go b/pkg/util/k8sutil/pvc.go index a2715102c..f891fea18 100644 --- a/pkg/util/k8sutil/pvc.go +++ b/pkg/util/k8sutil/pvc.go @@ -48,6 +48,16 @@ func IsPersistentVolumeClaimFileSystemResizePending(pvc *core.PersistentVolumeCl return false } +// IsPersistentVolumeClaimResizing returns true if the pvc has Resizing set to true +func IsPersistentVolumeClaimResizing(pvc *core.PersistentVolumeClaim) bool { + for _, c := range pvc.Status.Conditions { + if c.Type == core.PersistentVolumeClaimResizing && c.Status == core.ConditionTrue { + return true + } + } + return false +} + // ExtractStorageResourceRequirement filters resource requirements for Pods. func ExtractStorageResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements { diff --git a/pkg/version/version.community.go b/pkg/version/version.community.go index da0f092d5..0b2a4e6ce 100644 --- a/pkg/version/version.community.go +++ b/pkg/version/version.community.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.