Commit 639324a
Default URI Style for S3 Bootstrap
The proper default S3 URI style is now set when generating the
pgBackRest S3 environment variables for a bootstrap Job (i.e. a
Job created to bootstrap a cluster from an existing backup, such
as when using the '--restore-from' flag with the 'pgo' client).
Specifically, if an empty string is detected in the 's3-uri-style'
annotation for the pgBackRest repo secret for the cluster being
bootstrapped/restored from, a proper default value of 'host' is now
set. This ensures there is never an empty value for the
PGBACKREST_REPO1_S3_URI_STYLE environment variable in a bootstrap
Pod, which can lead to problems when running various pgBackRest
commands.
Additionally, tests have been created to verify the output of the
GetPgbackrestBootstrapS3EnvVars function that is utilized to populate
the proper S3 environment variables for a bootstrap Job (specifically
using the pgBackRest repo secret from the cluster being bootstrapped
from). This includes ensuring the proper default URI style is set
when the 's3-uri-style' annotation is empty, as well as ensuring
all annotation values are properly reflected in the final S3
environment variable output. In support of these tests, a
NewFakePGOClient function has also been created in the 'fake' package
(underneath 'kubeapi'). This is needed to create a fake client
containing the proper resources (i.e. a mock 'pgo-config' ConfigMap)
as need to initialize the Operator and therefore the various templates
needed to properly call the GetPgbackrestBootstrapS3EnvVars function
for these tests (PGOROOT must be properly set in the environment when
running tests so that the proper default template files and pgo.yaml
file can be found as needed to create the mock 'pgo-config' ConfigMap).
Issue: [ch8915]
See: c503b9d1 parent 04b6c48 commit 639324a
File tree
3 files changed
+24
-15
lines changed- internal/operator
- backrest
- cluster
3 files changed
+24
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
| 249 | + | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
779 | 783 | | |
780 | 784 | | |
781 | 785 | | |
782 | | - | |
| 786 | + | |
783 | 787 | | |
784 | 788 | | |
785 | 789 | | |
| |||
828 | 832 | | |
829 | 833 | | |
830 | 834 | | |
831 | | - | |
| 835 | + | |
| 836 | + | |
832 | 837 | | |
833 | 838 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
843 | 852 | | |
844 | 853 | | |
845 | 854 | | |
| |||
0 commit comments