Skip to content

Commit

Permalink
Merge pull request #1256 from Infisical/add-crd-owner
Browse files Browse the repository at this point in the history
add crd owner
  • Loading branch information
maidul98 authored Dec 19, 2023
2 parents bc6bf33 + 1861dc8 commit d0b8998
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion backend/src/controllers/v1/universalAuthController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,14 @@ export const renewAccessToken = async (req: Request, res: Response) => {
accessTokenTTL,
accessTokenLastRenewedAt,
accessTokenMaxTTL,
createdAt: accessTokenCreatedAt
createdAt: accessTokenCreatedAt,
accessTokenNumUses,
accessTokenNumUsesLimit
} = identityAccessToken;

if (accessTokenNumUses >= accessTokenNumUsesLimit) {
throw BadRequestError({ message: "Unable to renew because access token number of uses limit reached" })
}

// ttl check
if (accessTokenTTL > 0) {
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/secrets-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 8 additions & 1 deletion k8-operator/controllers/infisicalsecret_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit d0b8998

Please sign in to comment.