Compare commits

...

3 Commits

Author SHA1 Message Date
7e4ccc35fc Merge pull request #1255 from Infisical/patch-6
add owner reference to InfisicalSecret
2023-12-18 19:20:37 -05:00
95f6f2dcea increase chart version 2023-12-18 19:20:17 -05:00
4ac8c004d7 add owner reference 2023-12-18 19:17:25 -05:00
2 changed files with 9 additions and 2 deletions

View File

@ -13,7 +13,7 @@ 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.3.2
version: 0.3.3
# 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.

View File

@ -13,6 +13,7 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
)
const SERVICE_ACCOUNT_ACCESS_KEY = "serviceAccountAccessKey"
@ -159,7 +160,13 @@ func (r *InfisicalSecretReconciler) CreateInfisicalManagedKubeSecret(ctx context
Data: plainProcessedSecrets,
}
err := r.Client.Create(ctx, newKubeSecretInstance)
// Set InfisicalSecret instance as the owner and controller
err := ctrl.SetControllerReference(&infisicalSecret, newKubeSecretInstance, r.Scheme)
if err != nil {
return err
}
err = r.Client.Create(ctx, newKubeSecretInstance)
if err != nil {
return fmt.Errorf("unable to create the managed Kubernetes secret : %w", err)
}