Update readme

This commit is contained in:
Volodymyr Zotov
2025-09-30 16:59:30 -05:00
parent edde903759
commit a5e4a352e9

View File

@@ -1,6 +1,6 @@
# OnePassword Operator Test Helper # OnePassword Operator Test Helper
This is a standalone Go module that provides testing utilities for Kubernetes operators, specifically designed for testing OnePassword operators but can be used for any Kubernetes operator testing. This is a standalone Go module that provides testing utilities for Kubernetes operators and webhooks. It's specifically designed for testing 1Password Kubernetes operator and secrets injector, but it can be used for any Kubernetes operator or webhook testing.
## Installation ## Installation
@@ -35,19 +35,19 @@ kubeClient := kube.NewKubeClient(&kube.Config{
### Working with Secrets ### Working with Secrets
```go ```go
// Create a secret from environment variable // Create k8s secret from environment variable
secret := kubeClient.Secret("my-secret") k8sSecret := kubeClient.Secret("my-secret")
secret.CreateFromEnvVar(ctx, "MY_ENV_VAR") k8sSecret.CreateFromEnvVar(ctx, "MY_ENV_VAR")
// Create a secret from file // Create a secret from file
data := []byte("secret content") data := []byte("secret content")
secret.CreateFromFile(ctx, "filename", data) k8sSecret.CreateFromFile(ctx, "filename", data)
// Check if secret exists // Check if secret exists
secret.CheckIfExists(ctx) k8sSecret.CheckIfExists(ctx)
// Get secret // Get secret
secretObj := secret.Get(ctx) secretObj := k8sSecret.Get(ctx)
``` ```
### Working with Deployments ### Working with Deployments