Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add re-sync interval

Maidul Islamcb5c371a4f86
diff --git a/helm-charts/secrets-operator/Chart.yaml b/helm-charts/secrets-operator/Chart.yaml
index 6a290b96c2..c3e0073b5f 100644
--- a/helm-charts/secrets-operator/Chart.yaml
+++ b/helm-charts/secrets-operator/Chart.yaml
@@ -18,4 +18,4 @@ version: 0.1.6
# 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.1.7"
+appVersion: "0.1.8"
diff --git a/helm-charts/secrets-operator/templates/infisicalsecret-crd.yaml b/helm-charts/secrets-operator/templates/infisicalsecret-crd.yaml
index eee275f5e8..ceeac67093 100644
--- a/helm-charts/secrets-operator/templates/infisicalsecret-crd.yaml
+++ b/helm-charts/secrets-operator/templates/infisicalsecret-crd.yaml
@@ -95,6 +95,9 @@ spec:
- secretName
- secretNamespace
type: object
+ resyncInterval:
+ default: 60
+ type: integer
tokenSecretReference:
properties:
secretName:
@@ -109,6 +112,7 @@ spec:
type: object
required:
- managedSecretReference
+ - resyncInterval
type: object
status:
description: InfisicalSecretStatus defines the observed state of InfisicalSecret
diff --git a/k8-operator/api/v1alpha1/infisicalsecret_types.go b/k8-operator/api/v1alpha1/infisicalsecret_types.go
index 96364bf869..203394417a 100644
--- a/k8-operator/api/v1alpha1/infisicalsecret_types.go
+++ b/k8-operator/api/v1alpha1/infisicalsecret_types.go
@@ -42,6 +42,9 @@ type InfisicalSecretSpec struct {
// +kubebuilder:validation:Required
ManagedSecretReference KubeSecretReference `json:"managedSecretReference"`
+ // +kubebuilder:default:=60
+ ResyncInterval int `json:"resyncInterval"`
+
// Infisical host to pull secrets from
// +kubebuilder:validation:Optional
HostAPI string `json:"hostAPI"`
diff --git a/k8-operator/config/crd/bases/secrets.infisical.com_infisicalsecrets.yaml b/k8-operator/config/crd/bases/secrets.infisical.com_infisicalsecrets.yaml
index 3bcdb0020e..f47efb0614 100644
--- a/k8-operator/config/crd/bases/secrets.infisical.com_infisicalsecrets.yaml
+++ b/k8-operator/config/crd/bases/secrets.infisical.com_infisicalsecrets.yaml
@@ -95,6 +95,9 @@ spec:
- secretName
- secretNamespace
type: object
+ resyncInterval:
+ default: 60
+ type: integer
tokenSecretReference:
properties:
secretName:
@@ -109,6 +112,7 @@ spec:
type: object
required:
- managedSecretReference
+ - resyncInterval
type: object
status:
description: InfisicalSecretStatus defines the observed state of InfisicalSecret
diff --git a/k8-operator/config/samples/sample.yaml b/k8-operator/config/samples/sample.yaml
index 1109654211..971df9f7c1 100644
--- a/k8-operator/config/samples/sample.yaml
+++ b/k8-operator/config/samples/sample.yaml
@@ -4,6 +4,7 @@ metadata:
name: infisicalsecret-sample
spec:
hostAPI: http://localhost:7070/api
+ resyncInterval: 60
authentication:
serviceAccount:
serviceAccountSecretReference:
diff --git a/k8-operator/controllers/infisicalsecret_controller.go b/k8-operator/controllers/infisicalsecret_controller.go
index ddfc39e029..7aca836512 100644
--- a/k8-operator/controllers/infisicalsecret_controller.go
+++ b/k8-operator/controllers/infisicalsecret_controller.go
@@ -33,8 +33,8 @@ type InfisicalSecretReconciler struct {
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
- requeueTime := time.Minute * 1
var infisicalSecretCR v1alpha1.InfisicalSecret
+ requeueTime := time.Minute // seconds
err := r.Get(ctx, req.NamespacedName, &infisicalSecretCR)
if err != nil {
@@ -51,6 +51,13 @@ func (r *InfisicalSecretReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}
}
+ if infisicalSecretCR.Spec.ResyncInterval != 0 {
+ requeueTime = time.Second * time.Duration(infisicalSecretCR.Spec.ResyncInterval)
+ fmt.Println("Manual re-sync interval set", "requeueAfter", requeueTime)
+ }
+
+ fmt.Println("Requeue duration set", "requeueAfter", requeueTime)
+
// Check if the resource is already marked for deletion
if infisicalSecretCR.GetDeletionTimestamp() != nil {
return ctrl.Result{
diff --git a/k8-operator/kubectl-install/install-secrets-operator.yaml b/k8-operator/kubectl-install/install-secrets-operator.yaml
index 6c9d5ef0db..f362bcfa1d 100644
--- a/k8-operator/kubectl-install/install-secrets-operator.yaml
+++ b/k8-operator/kubectl-install/install-secrets-operator.yaml
@@ -101,6 +101,9 @@ spec:
- secretName
- secretNamespace
type: object
+ resyncInterval:
+ default: 60
+ type: integer
tokenSecretReference:
properties:
secretName:
@@ -115,6 +118,7 @@ spec:
type: object
required:
- managedSecretReference
+ - resyncInterval
type: object
status:
description: InfisicalSecretStatus defines the observed state of InfisicalSecret