Skip to content

Commit

Permalink
Merge pull request #2848 from Infisical/daniel/fix-k8-build
Browse files Browse the repository at this point in the history
fix(k8-operator): fix build
  • Loading branch information
DanielHougaard authored Dec 6, 2024
2 parents 1bc508b + a91f64f commit bbd8a04
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
4 changes: 2 additions & 2 deletions helm-charts/secrets-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ 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: v0.7.4
version: v0.7.5
# 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: "v0.7.4"
appVersion: "v0.7.5"
14 changes: 14 additions & 0 deletions helm-charts/secrets-operator/templates/infisicalsecret-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,20 @@ spec:
description: 'The Kubernetes Secret type (experimental feature).
More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types'
type: string
template:
description: The template to transform the secret data
properties:
data:
additionalProperties:
type: string
description: The template key values
type: object
includeAllSecrets:
description: This injects all retrieved secrets into the top
level of your template. Secrets defined in the template will
take precedence over the injected ones.
type: boolean
type: object
required:
- secretName
- secretNamespace
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/secrets-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ controllerManager:
- ALL
image:
repository: infisical/kubernetes-operator
tag: v0.7.4
tag: v0.7.5
resources:
limits:
cpu: 500m
Expand Down
31 changes: 29 additions & 2 deletions k8-operator/api/v1alpha1/zz_generated.deepcopy.go

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

8 changes: 4 additions & 4 deletions k8-operator/controllers/infisicalsecret_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ func (r *InfisicalSecretReconciler) CreateInfisicalManagedKubeSecret(ctx context
for templateKey, userTemplate := range managedTemplateData.Data {
tmpl, err := template.New("secret-templates").Parse(userTemplate)
if err != nil {
return fmt.Errorf("Unable to compile template: %s", templateKey, err)
return fmt.Errorf("unable to compile template: %s [err=%v]", templateKey, err)
}

buf := bytes.NewBuffer(nil)
err = tmpl.Execute(buf, secretKeyValue)
if err != nil {
return fmt.Errorf("Unable to execute template: %s", templateKey, err)
return fmt.Errorf("unable to execute template: %s [err=%v]", templateKey, err)
}
plainProcessedSecrets[templateKey] = buf.Bytes()
}
Expand Down Expand Up @@ -336,13 +336,13 @@ func (r *InfisicalSecretReconciler) UpdateInfisicalManagedKubeSecret(ctx context
for templateKey, userTemplate := range managedTemplateData.Data {
tmpl, err := template.New("secret-templates").Parse(userTemplate)
if err != nil {
return fmt.Errorf("Unable to compile template: %s", templateKey, err)
return fmt.Errorf("unable to compile template: %s [err=%v]", templateKey, err)
}

buf := bytes.NewBuffer(nil)
err = tmpl.Execute(buf, secretKeyValue)
if err != nil {
return fmt.Errorf("Unable to execute template: %s", templateKey, err)
return fmt.Errorf("unable to execute template: %s [err=%v]", templateKey, err)
}
plainProcessedSecrets[templateKey] = buf.Bytes()
}
Expand Down

0 comments on commit bbd8a04

Please sign in to comment.