• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alauda / redis-operator / 14204792359

01 Apr 2025 07:54PM UTC coverage: 10.864% (-1.3%) from 12.169%
14204792359

Pull #99

github

web-flow
build(deps): bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2.23.3

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.22.1 to 2.23.3.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.22.1...v2.23.3)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-version: 2.23.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #99: build(deps): bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2.23.3

2589 of 23832 relevant lines covered (10.86%)

9771.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/api/databases/v1/validate.go
1
/*
2
Copyright 2023 The RedisOperator Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
        http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package v1
18

19
import (
20
        "fmt"
21
        "os"
22

23
        "github.com/alauda/redis-operator/api/core/helper"
24
)
25

26
const (
27
        maxNameLength      = 48
28
        defaultRedisNumber = 2
29
)
30

31
// Validate set the values by default if not defined and checks if the values given are valid
32
// TODO: remove this validation and use the kubebuilder validation
33
func (r *RedisFailover) Validate() error {
×
34
        if len(r.Name) > maxNameLength {
×
35
                return fmt.Errorf("name length can't be higher than %d", maxNameLength)
×
36
        }
×
37

38
        if r.Spec.Redis.Replicas <= 0 {
×
39
                r.Spec.Redis.Replicas = defaultRedisNumber
×
40
        }
×
41
        if r.Spec.Redis.Expose.IPFamilyPrefer == "" {
×
42
                r.Spec.Redis.Expose.IPFamilyPrefer = helper.GetDefaultIPFamily(os.Getenv("POD_IP"))
×
43
        }
×
44
        if r.Spec.Sentinel != nil {
×
45
                if r.Spec.Sentinel.SentinelReference == nil {
×
46
                        if r.Spec.Sentinel.Replicas <= 0 {
×
47
                                r.Spec.Sentinel.Replicas = DefaultSentinelNumber
×
48
                        }
×
49
                        if r.Spec.Sentinel.Expose.IPFamilyPrefer == "" {
×
50
                                r.Spec.Sentinel.Expose.IPFamilyPrefer = r.Spec.Redis.Expose.IPFamilyPrefer
×
51
                        }
×
52
                }
53
        }
54
        return nil
×
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc