Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working with caBundle as env variable oneline base64 string #164

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type DatabaseSpec struct {
// User-defined root certificate authority that is added to system trust
// store of Storage pods on startup.
// +optional
CABundle []byte `json:"caBundle,omitempty"`
CABundle string `json:"caBundle,omitempty"`

// Secret names that will be mounted into the well-known directory of
// every storage pod. Directory: `/opt/ydb/secrets/<secret_name>/<secret_key>`
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/storage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type StorageSpec struct {
// User-defined root certificate authority that is added to system trust
// store of Storage pods on startup.
// +optional
CABundle []byte `json:"caBundle,omitempty"`
CABundle string `json:"caBundle,omitempty"`

// Secret names that will be mounted into the well-known directory of
// every storage pod. Directory: `/opt/ydb/secrets/<secret_name>/<secret_key>`
Expand Down
10 changes: 0 additions & 10 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deploy/ydb-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.35
version: 0.4.36

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.4.35"
appVersion: "0.4.36"
4 changes: 2 additions & 2 deletions internal/resources/database_statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (b *DatabaseStatefulSetBuilder) buildCaStorePatchingInitContainer() corev1.
container.Env = []corev1.EnvVar{
{
Name: caBundleEnvName,
Value: string(b.Spec.CABundle),
Value: b.Spec.CABundle,
},
}
}
Expand Down Expand Up @@ -490,7 +490,7 @@ func (b *DatabaseStatefulSetBuilder) buildCaStorePatchingInitContainerArgs() ([]
arg := ""

if len(b.Spec.CABundle) > 0 {
arg += fmt.Sprintf("echo $%s > %s/%s && ", caBundleEnvName, localCertsDir, caBundleFileName)
arg += fmt.Sprintf("printf $%s | base64 --decode > %s/%s && ", caBundleEnvName, localCertsDir, caBundleFileName)
}

if b.Spec.Service.GRPC.TLSConfiguration.Enabled {
Expand Down
4 changes: 2 additions & 2 deletions internal/resources/storage_statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainer() corev1.C
container.Env = []corev1.EnvVar{
{
Name: caBundleEnvName,
Value: string(b.Spec.CABundle),
Value: b.Spec.CABundle,
},
}
}
Expand Down Expand Up @@ -427,7 +427,7 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainerArgs() ([]s
arg := ""

if len(b.Spec.CABundle) > 0 {
arg += fmt.Sprintf("echo $%s > %s/%s && ", caBundleEnvName, localCertsDir, caBundleFileName)
arg += fmt.Sprintf("printf $%s | base64 --decode > %s/%s && ", caBundleEnvName, localCertsDir, caBundleFileName)
}

if IsGrpcSecure(b.Storage) {
Expand Down
Loading