Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
misc: better condition naming
Daniel Hougaard7eb05afe2af9
diff --git a/k8-operator/controllers/infisicalpushsecret/conditions.go b/k8-operator/controllers/infisicalpushsecret/conditions.goindex 65f32d4a35..dd17bc913e 100644--- a/k8-operator/controllers/infisicalpushsecret/conditions.go+++ b/k8-operator/controllers/infisicalpushsecret/conditions.go@@ -9,7 +9,7 @@ import (metav1 "k8s.io/apimachinery/pkg/apis/meta/v1")-func (r *InfisicalPushSecretReconciler) SetSuccessfullyReconciledConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, err error) error {+func (r *InfisicalPushSecretReconciler) SetReconcileStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, err error) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}@@ -17,14 +17,14 @@ func (r *InfisicalPushSecretReconciler) SetSuccessfullyReconciledConditions(ctxif err != nil {meta.SetStatusCondition(&infisicalPushSecret.Status.Conditions, metav1.Condition{- Type: "secrets.infisical.com/SuccessfullyReconciled",+ Type: "secrets.infisical.com/Reconcile",Status: metav1.ConditionTrue,Reason: "Error",Message: fmt.Sprintf("Reconcile failed, secrets were not pushed to Infisical. Error: %s", err.Error()),})} else {meta.SetStatusCondition(&infisicalPushSecret.Status.Conditions, metav1.Condition{- Type: "secrets.infisical.com/SuccessfullyReconciled",+ Type: "secrets.infisical.com/Reconcile",Status: metav1.ConditionFalse,Reason: "OK",Message: "Reconcile succeeded, secrets were pushed to Infisical",@@ -35,7 +35,7 @@ func (r *InfisicalPushSecretReconciler) SetSuccessfullyReconciledConditions(ctx}-func (r *InfisicalPushSecretReconciler) SetFailedToReplaceSecretsConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {+func (r *InfisicalPushSecretReconciler) SetFailedToReplaceSecretsStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}}@@ -59,7 +59,7 @@ func (r *InfisicalPushSecretReconciler) SetFailedToReplaceSecretsConditions(ctxreturn r.Client.Status().Update(ctx, infisicalPushSecret)}-func (r *InfisicalPushSecretReconciler) SetFailedToCreateSecretsConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {+func (r *InfisicalPushSecretReconciler) SetFailedToCreateSecretsStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}}@@ -83,7 +83,7 @@ func (r *InfisicalPushSecretReconciler) SetFailedToCreateSecretsConditions(ctx creturn r.Client.Status().Update(ctx, infisicalPushSecret)}-func (r *InfisicalPushSecretReconciler) SetFailedToUpdateSecretsConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {+func (r *InfisicalPushSecretReconciler) SetFailedToUpdateSecretsStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}}@@ -107,7 +107,7 @@ func (r *InfisicalPushSecretReconciler) SetFailedToUpdateSecretsConditions(ctx creturn r.Client.Status().Update(ctx, infisicalPushSecret)}-func (r *InfisicalPushSecretReconciler) SetFailedToDeleteSecretsConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {+func (r *InfisicalPushSecretReconciler) SetFailedToDeleteSecretsStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, failMessage string) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}}@@ -131,7 +131,7 @@ func (r *InfisicalPushSecretReconciler) SetFailedToDeleteSecretsConditions(ctx creturn r.Client.Status().Update(ctx, infisicalPushSecret)}-func (r *InfisicalPushSecretReconciler) SetAuthenticatedConditions(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, errorToConditionOn error) error {+func (r *InfisicalPushSecretReconciler) SetAuthenticatedStatusCondition(ctx context.Context, infisicalPushSecret *v1alpha1.InfisicalPushSecret, errorToConditionOn error) error {if infisicalPushSecret.Status.Conditions == nil {infisicalPushSecret.Status.Conditions = []metav1.Condition{}}diff --git a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.goindex af5428ee7b..f2125485ee 100644--- a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go+++ b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_controller.go@@ -159,7 +159,7 @@ func (r *InfisicalPushSecretReconciler) Reconcile(ctx context.Context, req ctrl.}err = r.ReconcileInfisicalPushSecret(ctx, logger, infisicalPushSecretCRD)- r.SetSuccessfullyReconciledConditions(ctx, &infisicalPushSecretCRD, err)+ r.SetReconcileStatusCondition(ctx, &infisicalPushSecretCRD, err)if err != nil {logger.Error(err, fmt.Sprintf("unable to reconcile Infisical Push Secret. Will requeue after [requeueTime=%v]", requeueTime))diff --git a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.goindex 9ba514dbcc..47fc8e69b3 100644--- a/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go+++ b/k8-operator/controllers/infisicalpushsecret/infisicalpushsecret_helper.go@@ -112,7 +112,7 @@ func (r *InfisicalPushSecretReconciler) ReconcileInfisicalPushSecret(ctx contextif authDetails.AuthStrategy == "" {logger.Info("No authentication strategy found. Attempting to authenticate")authDetails, err = r.handleAuthentication(ctx, infisicalPushSecret, infisicalClient)- r.SetAuthenticatedConditions(ctx, &infisicalPushSecret, err)+ r.SetAuthenticatedStatusCondition(ctx, &infisicalPushSecret, err)if err != nil {return fmt.Errorf("unable to authenticate [err=%s]", err)@@ -401,28 +401,28 @@ func (r *InfisicalPushSecretReconciler) ReconcileInfisicalPushSecret(ctx context} else {errorMessage = ""}- r.SetFailedToCreateSecretsConditions(ctx, &infisicalPushSecret, fmt.Sprintf("Failed to create secrets: [%s]", errorMessage))+ r.SetFailedToCreateSecretsStatusCondition(ctx, &infisicalPushSecret, fmt.Sprintf("Failed to create secrets: [%s]", errorMessage))if len(secretsFailedToUpdate) > 0 {errorMessage = fmt.Sprintf("Failed to update secrets: [%s]", strings.Join(secretsFailedToUpdate, ", "))} else {errorMessage = ""}- r.SetFailedToUpdateSecretsConditions(ctx, &infisicalPushSecret, fmt.Sprintf("Failed to update secrets: [%s]", errorMessage))+ r.SetFailedToUpdateSecretsStatusCondition(ctx, &infisicalPushSecret, fmt.Sprintf("Failed to update secrets: [%s]", errorMessage))if len(secretsFailedToDelete) > 0 {errorMessage = fmt.Sprintf("Failed to delete secrets: [%s]", strings.Join(secretsFailedToDelete, ", "))} else {errorMessage = ""}- r.SetFailedToDeleteSecretsConditions(ctx, &infisicalPushSecret, errorMessage)+ r.SetFailedToDeleteSecretsStatusCondition(ctx, &infisicalPushSecret, errorMessage)if len(secretsFailedToReplaceById) > 0 {errorMessage = fmt.Sprintf("Failed to replace secrets: [%s]", strings.Join(secretsFailedToReplaceById, ", "))} else {errorMessage = ""}- r.SetFailedToReplaceSecretsConditions(ctx, &infisicalPushSecret, errorMessage)+ r.SetFailedToReplaceSecretsStatusCondition(ctx, &infisicalPushSecret, errorMessage)// Update the status of the InfisicalPushSecretif err := r.Client.Status().Update(ctx, &infisicalPushSecret); err != nil {