From 9a33f53b6221df77840ab4d649dec6578ababaa8 Mon Sep 17 00:00:00 2001 From: Volkan Ozcelik Date: Mon, 17 Jun 2024 20:37:20 +0300 Subject: [PATCH] Documentation update. Signed-off-by: Volkan Ozcelik --- core/env/safe_test.go | 63 ------------------- core/log/std/envinfo_test.go | 26 +------- .../20240510-adr-0006-be-secure-by-default.md | 2 +- .../operations/release-management.md | 12 ++++ docs/sass/_search.scss | 2 +- hack/test.sh | 3 + 6 files changed, 19 insertions(+), 89 deletions(-) diff --git a/core/env/safe_test.go b/core/env/safe_test.go index 5b07ee96..913c96b8 100644 --- a/core/env/safe_test.go +++ b/core/env/safe_test.go @@ -472,69 +472,6 @@ func TestRootKeyInputMode(t *testing.T) { } } -//func TestManualRootKeyUpdatesK8sSecrets(t *testing.T) { -// tests := []struct { -// name string -// setup func() error -// cleanup func() error -// want bool -// }{ -// { -// name: "default_safe_manual_root_key_updates_k8s_secret", -// want: false, -// }, -// { -// name: "safe_manual_root_key_updates_k8s_secret_from_env_true", -// setup: func() error { -// return os.Setenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET", "true") -// }, -// cleanup: func() error { -// return os.Unsetenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET") -// }, -// want: true, -// }, -// { -// name: "safe_manual_root_key_updates_k8s_secret_from_env_false", -// setup: func() error { -// return os.Setenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET", "false") -// }, -// cleanup: func() error { -// return os.Unsetenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET") -// }, -// want: false, -// }, -// { -// name: "invalid_safe_manual_root_key_updates_k8s_secret_from_env", -// setup: func() error { -// return os.Setenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET", "test") -// }, -// cleanup: func() error { -// return os.Unsetenv("VSECM_MANUAL_ROOT_KEY_UPDATES_K8S_SECRET") -// }, -// want: false, -// }, -// } -// for _, tt := range tests { -// t.Run(tt.name, func(t *testing.T) { -// if tt.setup != nil { -// if err := tt.setup(); err != nil { -// t.Errorf("ManualRootKeyUpdatesK8sSecret() = failed to setup, with error: %+v", err) -// } -// } -// defer func() { -// if tt.cleanup != nil { -// if err := tt.cleanup(); err != nil { -// t.Errorf("ManualRootKeyUpdatesK8sSecret() = failed to cleanup, with error: %+v", err) -// } -// } -// }() -// if got := ManualRootKeyUpdatesK8sSecret(); got != tt.want { -// t.Errorf("ManualRootKeyUpdatesK8sSecret() = %v, want %v", got, tt.want) -// } -// }) -// } -//} - func TestSafeDataPath(t *testing.T) { tests := []struct { name string diff --git a/core/log/std/envinfo_test.go b/core/log/std/envinfo_test.go index 19510597..9600aead 100644 --- a/core/log/std/envinfo_test.go +++ b/core/log/std/envinfo_test.go @@ -197,30 +197,8 @@ package std // t.Errorf("Unexpected output:\nExpected: \n%s\nActual: \n%s", expectedOutput, capturedOutput.String()) // } //} -// -//func TestPrintAdditionalInformation(t *testing.T) { -// // Prepare the input data -// info := make(map[string]string) -// -// // Call the function -// printAdditionalInformation(info) -// -// // Expected values -// expectedEnvVariables := strings.Join(getAllEnvironmentVariables(), ", ") -// expectedGoVersion := runtime.Version() -// -// // Compare actual vs expected values -// if info["ENVIRONMENT_VARIABLES"] != expectedEnvVariables { -// t.Errorf("Unexpected value for ENVIRONMENT_VARIABLES:\nExpected: %s\nActual: %s", -// expectedEnvVariables, info["ENVIRONMENT_VARIABLES"]) -// } -// -// if info["GO_VERSION"] != expectedGoVersion { -// t.Errorf("Unexpected value for GO_VERSION:\nExpected: %s\nActual: %s", -// expectedGoVersion, info["GO_VERSION"]) -// } -//} -// + + //func mockLogger(t *testing.T) (*bufio.Scanner, *os.File, *os.File) { // reader, writer, err := os.Pipe() // if err != nil { diff --git a/docs/content/documentation/architecture/adrs/20240510-adr-0006-be-secure-by-default.md b/docs/content/documentation/architecture/adrs/20240510-adr-0006-be-secure-by-default.md index 00248a77..eb1cd09c 100644 --- a/docs/content/documentation/architecture/adrs/20240510-adr-0006-be-secure-by-default.md +++ b/docs/content/documentation/architecture/adrs/20240510-adr-0006-be-secure-by-default.md @@ -32,7 +32,7 @@ weight = 6 ## Context and Problem Statement **VMware Secrets Manager** stores your sensitive data in memory. None of your -secrets are stored as plain text on disk. Any secret that**VMware Secrets +secrets are stored as plain text on disk. Any secret that **VMware Secrets Manager** saves to any other medium is encrypted. Yes, that brings up resource limitations, since the amount of secrets you can diff --git a/docs/content/documentation/operations/release-management.md b/docs/content/documentation/operations/release-management.md index 3efec247..8ff1e194 100644 --- a/docs/content/documentation/operations/release-management.md +++ b/docs/content/documentation/operations/release-management.md @@ -269,6 +269,18 @@ For example `make k8s-manifests-update VERSION=0.22.4` ### 10. Release Helm Charts +> **Pull Recent `gh-pages` Changes** +> +> Before you proceed, make sure that you have your `gh-pages` local branc +> is up to date: +> +> ```bash +> cd $WORKSPACE/secrets-manager +> git checkout gh-pages +> git pull +> git checkout main +> ``` + We offer the [./hack/release-helm-chart.sh][release_script] script for your use. To execute the script, provide the version of the helm-charts that you want to release as an argument. diff --git a/docs/sass/_search.scss b/docs/sass/_search.scss index 090959b4..9768ece2 100644 --- a/docs/sass/_search.scss +++ b/docs/sass/_search.scss @@ -2,7 +2,7 @@ margin-top: 1em; display: inline-block; position: relative; - width: 300px; + width: 200px; z-index: 999; input { diff --git a/hack/test.sh b/hack/test.sh index 54b37247..89464e1b 100755 --- a/hack/test.sh +++ b/hack/test.sh @@ -13,6 +13,9 @@ # Enable strict error checking. set -euo pipefail +# Update vendor dependencies: +go mod vendor + echo "Running Go unit tests..." if ! go test ./... -cover; then echo "Go unit tests failed, exiting."