This commit is contained in:
Daniel Hougaard
2025-08-27 19:54:31 +02:00
parent af2f21fe93
commit 1165b05e8a
16 changed files with 21 additions and 486 deletions

View File

@@ -24,7 +24,7 @@ resources:
controller: true
domain: infisical.com
group: secrets
kind: InfisicalPushSecretSecret
kind: InfisicalPushSecret
path: github.com/Infisical/infisical/k8-operator/api/v1alpha1
version: v1alpha1
- api:

View File

@@ -16,7 +16,7 @@ type InfisicalPushSecretDestination struct {
ProjectID string `json:"projectId"`
}
type InfisicalPushSecretSecretSource struct {
type InfisicalPushSecretSource struct {
// The name of the Kubernetes Secret
// +kubebuilder:validation:Required
SecretName string `json:"secretName"`
@@ -48,7 +48,7 @@ type SecretPushGenerator struct {
type SecretPush struct {
// +kubebuilder:validation:Optional
Secret *InfisicalPushSecretSecretSource `json:"secret,omitempty"`
Secret *InfisicalPushSecretSource `json:"secret,omitempty"`
// +kubebuilder:validation:Optional
Generators []SecretPushGenerator `json:"generators,omitempty"`
}

View File

@@ -22,13 +22,13 @@ resources:
# default, aiding admins in cluster management. Those roles are
# not used by the k8-operator itself. You can comment the following lines
# if you do not want those helpers be installed with your Project.
- infisicaldynamicsecret_admin_role.yaml
- infisicaldynamicsecret_editor_role.yaml
- infisicaldynamicsecret_viewer_role.yaml
- infisicalpushsecretsecret_admin_role.yaml
- infisicalpushsecretsecret_editor_role.yaml
- infisicalpushsecretsecret_viewer_role.yaml
- infisicalsecret_admin_role.yaml
- infisicalsecret_editor_role.yaml
- infisicalsecret_viewer_role.yaml
# - infisicaldynamicsecret_admin_role.yaml
# - infisicaldynamicsecret_editor_role.yaml
# - infisicaldynamicsecret_viewer_role.yaml
# - infisicalpushsecret_admin_role.yaml
# - infisicalpushsecret_editor_role.yaml
# - infisicalpushsecret_viewer_role.yaml
# - infisicalsecret_admin_role.yaml
# - infisicalsecret_editor_role.yaml
# - infisicalsecret_viewer_role.yaml

View File

@@ -42,7 +42,7 @@ import (
"github.com/go-logr/logr"
)
// InfisicalPushSecretReconciler reconciles a InfisicalPushSecretSecret object
// InfisicalPushSecretReconciler reconciles a InfisicalPushSecret object
type InfisicalPushSecretReconciler struct {
client.Client
BaseLogger logr.Logger

View File

@@ -30,7 +30,7 @@ import (
secretsv1alpha1 "github.com/Infisical/infisical/k8-operator/api/v1alpha1"
)
var _ = Describe("InfisicalPushSecretSecret Controller", func() {
var _ = Describe("InfisicalPushSecret Controller", func() {
Context("When reconciling a resource", func() {
const resourceName = "test-resource"
@@ -40,11 +40,11 @@ var _ = Describe("InfisicalPushSecretSecret Controller", func() {
Name: resourceName,
Namespace: "default", // TODO(user):Modify as needed
}
infisicalpushsecretsecret := &secretsv1alpha1.InfisicalPushSecret{}
infisicalpushsecret := &secretsv1alpha1.InfisicalPushSecret{}
BeforeEach(func() {
By("creating the custom resource for the Kind InfisicalPushSecretSecret")
err := k8sClient.Get(ctx, typeNamespacedName, infisicalpushsecretsecret)
By("creating the custom resource for the Kind InfisicalPushSecret")
err := k8sClient.Get(ctx, typeNamespacedName, infisicalpushsecret)
if err != nil && errors.IsNotFound(err) {
resource := &secretsv1alpha1.InfisicalPushSecret{
ObjectMeta: metav1.ObjectMeta{
@@ -63,7 +63,7 @@ var _ = Describe("InfisicalPushSecretSecret Controller", func() {
err := k8sClient.Get(ctx, typeNamespacedName, resource)
Expect(err).NotTo(HaveOccurred())
By("Cleanup the specific resource instance InfisicalPushSecretSecret")
By("Cleanup the specific resource instance InfisicalPushSecret")
Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
})
It("should successfully reconcile the resource", func() {