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

zalando / postgres-operator / 17069871161

19 Aug 2025 12:40PM UTC coverage: 42.059% (-3.4%) from 45.498%
17069871161

push

github

web-flow
upgrade Go from 1.23.4 to 1.25.0 (#2945)

* upgrade go to 1.25
* add minor version to be Go 1.25.0
* revert the Go version on README to keep the history of the release

5 of 9 new or added lines in 7 files covered. (55.56%)

531 existing lines in 13 files now uncovered.

6493 of 15438 relevant lines covered (42.06%)

15.22 hits per line

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

0.0
/pkg/cluster/filesystems.go
1
package cluster
2

3
import (
4
        "fmt"
5
        "strings"
6

7
        "github.com/zalando/postgres-operator/pkg/spec"
8
        "github.com/zalando/postgres-operator/pkg/util/constants"
9
        "github.com/zalando/postgres-operator/pkg/util/filesystems"
10
)
11

12
func (c *Cluster) getPostgresFilesystemInfo(podName *spec.NamespacedName) (device, fstype string, err error) {
×
13
        out, err := c.ExecCommand(podName, "bash", "-c", fmt.Sprintf("df -T %s|tail -1", constants.PostgresDataMount))
×
14
        if err != nil {
×
15
                return "", "", err
×
16
        }
×
17
        fields := strings.Fields(out)
×
18
        if len(fields) < 2 {
×
19
                return "", "", fmt.Errorf("too few fields in the df output")
×
20
        }
×
21

22
        return fields[0], fields[1], nil
×
23
}
24

25
func (c *Cluster) resizePostgresFilesystem(podName *spec.NamespacedName, resizers []filesystems.FilesystemResizer) error {
×
26
        // resize2fs always writes to stderr, and ExecCommand considers a non-empty stderr an error
×
27
        // first, determine the device and the filesystem
×
28
        deviceName, fsType, err := c.getPostgresFilesystemInfo(podName)
×
29
        if err != nil {
×
30
                return fmt.Errorf("could not get device and type for the postgres filesystem: %v", err)
×
31
        }
×
32
        for _, resizer := range resizers {
×
33
                if !resizer.CanResizeFilesystem(fsType) {
×
34
                        continue
×
35
                }
36
                err := resizer.ResizeFilesystem(deviceName, func(cmd string) (out string, err error) {
×
37
                        return c.ExecCommand(podName, "bash", "-c", cmd)
×
38
                })
×
39

40
                return err
×
41
        }
42
        return fmt.Errorf("could not resize filesystem: no compatible resizers for the filesystem of type %q", fsType)
×
43
}
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

© 2025 Coveralls, Inc