utils

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2025, Opera Norway AS

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.

Index

Constants

This section is empty.

Variables

View Source
var PgbackrestServiceEnvVarPattern = regexp.MustCompile("^PGBACKREST_(?:[A-Z0-9]+_)*(?:PORT|SERVICE)")

This pattern should match all service discovery environment variables injected to the pod by Kubernetes for services with names starting with "pgbackrest".

Functions

func FormatDbEnv

func FormatDbEnv(database int, env string, value string) string

func FormatDbFlag

func FormatDbFlag(database int, flag string) string

func FormatEnv

func FormatEnv(env string, value string) string

func FormatRepoEnv

func FormatRepoEnv(repository int, env string, value string) string

func FormatRepoFlag

func FormatRepoFlag(repository int, flag string) string

func SanitizedEnviron

func SanitizedEnviron() []string

SanitizedEnviron returns a copy of the environment variables list with variables added for Kubernetes services with names starting from "pgbackrest" removed. Those variables cause pgbackrest to output warnings during configuration parsing and those messages always go to the standard output causing issues with "pgbackrest info" calls as those should only output JSON. In addition, removing them makes log entries much clearer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL