Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/apps/krane/backend/docker/deployment_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (d *docker) CreateDeployment(ctx context.Context, req *connect.Request[kran
"unkey.managed.by": "krane",
},
ExposedPorts: exposedPorts,
Env: env,
// Env is set per-instance below with UNKEY_INSTANCE_ID
}

//nolint:exhaustruct // Docker SDK types have many optional fields
Expand Down
1 change: 1 addition & 0 deletions go/apps/krane/secrets/token/k8s_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func NewK8sValidator(cfg K8sValidatorConfig) *K8sValidator {
}

func (v *K8sValidator) Validate(ctx context.Context, token string, deploymentID string) (*ValidationResult, error) {
//nolint:exhaustruct // k8s API types have many optional fields
tokenReview := &authv1.TokenReview{
Spec: authv1.TokenReviewSpec{Token: token},
}
Expand Down
12 changes: 8 additions & 4 deletions go/apps/secrets-webhook/internal/services/mutator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package mutator
import "fmt"

const (
unkeyEnvVolumeName = "unkey-env-bin"
unkeyEnvMountPath = "/unkey"
unkeyEnvBinary = "/unkey/unkey-env"
unkeyEnvVolumeName = "unkey-env-bin"
unkeyEnvMountPath = "/unkey"
unkeyEnvBinary = "/unkey/unkey-env"
//nolint:gosec // G101: This is a file path, not credentials
ServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
)

Expand All @@ -31,7 +32,10 @@ type podConfig struct {
}

func (m *Mutator) loadPodConfig(annotations map[string]string) (*podConfig, error) {
cfg := &podConfig{}
cfg := &podConfig{
DeploymentID: "",
ProviderEndpoint: "",
}

cfg.DeploymentID = annotations[m.cfg.GetAnnotation(AnnotationDeploymentID)]
if cfg.DeploymentID == "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (m *Mutator) ShouldMutate(pod *corev1.Pod) bool {

func (m *Mutator) Mutate(ctx context.Context, pod *corev1.Pod, namespace string) (*Result, error) {
if !m.ShouldMutate(pod) {
return &Result{Mutated: false, Message: "pod not annotated for injection"}, nil
return &Result{Mutated: false, Patch: nil, Message: "pod not annotated for injection"}, nil
}

annotations := pod.GetAnnotations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (r *Registry) GetImageConfig(
container *corev1.Container,
podSpec *corev1.PodSpec,
) (*ImageConfig, error) {
//nolint:exhaustruct // k8schain has many optional fields
chainOpts := k8schain.Options{
Namespace: namespace,
ServiceAccountName: podSpec.ServiceAccountName,
Expand Down Expand Up @@ -134,7 +135,7 @@ func (r *Registry) findPlatformManifest(manifests []v1.Descriptor) (v1.Hash, boo
return m.Digest, true
}
}
return v1.Hash{}, false
return v1.Hash{}, false //nolint:exhaustruct // zero value for not-found case
}

func targetOS() string {
Expand Down
2 changes: 2 additions & 0 deletions go/apps/secrets-webhook/routes/mutate/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (h *Handler) Handle(ctx context.Context, s *zen.Session) error {
}

func (h *Handler) sendResponse(s *zen.Session, uid types.UID, allowed bool, message string) error {
//nolint:exhaustruct // k8s admission API types have many optional fields
response := admissionv1.AdmissionReview{
TypeMeta: metav1.TypeMeta{APIVersion: "admission.k8s.io/v1", Kind: "AdmissionReview"},
Response: &admissionv1.AdmissionResponse{UID: uid, Allowed: allowed},
Expand All @@ -80,6 +81,7 @@ func (h *Handler) sendResponse(s *zen.Session, uid types.UID, allowed bool, mess
func (h *Handler) sendResponseWithPatch(s *zen.Session, uid types.UID, patch []byte) error {
patchType := admissionv1.PatchTypeJSONPatch

//nolint:exhaustruct // k8s admission API types have many optional fields
response := admissionv1.AdmissionReview{
TypeMeta: metav1.TypeMeta{APIVersion: "admission.k8s.io/v1", Kind: "AdmissionReview"},
Response: &admissionv1.AdmissionResponse{
Expand Down
1 change: 1 addition & 0 deletions go/apps/secrets-webhook/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func Run(ctx context.Context, cfg Config) error {
return fmt.Errorf("failed to load TLS certificates: %w", err)
}

//nolint:exhaustruct // zen.Config has many optional fields with sensible defaults
server, err := zen.New(zen.Config{
Logger: logger,
TLS: tlsConfig,
Expand Down
2 changes: 2 additions & 0 deletions go/cmd/ctrl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func action(ctx context.Context, cmd *cli.Command) error {
Bucket: cmd.String("vault-s3-bucket"),
AccessKeyID: cmd.String("vault-s3-access-key-id"),
AccessKeySecret: cmd.String("vault-s3-access-key-secret"),
ExternalURL: "",
},
// ACME Vault configuration - Let's Encrypt certificates
AcmeVaultMasterKeys: cmd.StringSlice("acme-vault-master-keys"),
Expand All @@ -194,6 +195,7 @@ func action(ctx context.Context, cmd *cli.Command) error {
Bucket: cmd.String("acme-vault-s3-bucket"),
AccessKeyID: cmd.String("acme-vault-s3-access-key-id"),
AccessKeySecret: cmd.String("acme-vault-s3-access-key-secret"),
ExternalURL: "",
},

// Build configuration
Expand Down
1 change: 1 addition & 0 deletions go/cmd/dev/seed/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func seedIngress(ctx context.Context, cmd *cli.Command) error {
GitCommitAuthorAvatarUrl: sql.NullString{},
GitCommitTimestamp: sql.NullInt64{Int64: now, Valid: true},
OpenapiSpec: sql.NullString{},
SecretsConfig: nil,
Status: db.DeploymentsStatusReady,
CreatedAt: now,
UpdatedAt: sql.NullInt64{},
Expand Down