Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-ignacio-rossi committed Jan 16, 2025
1 parent 81b8efc commit d422c3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions pkg/buildkit/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,11 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) (string, error) {
return "", err
}

c.log.Info(fmt.Sprintf("Adding secret %s", name))
secrets[name] = contents
}

// merge in preloaded data
for name, contents := range opts.SecretsData {
c.log.Info(fmt.Sprintf("Adding preload secret %s", name))
secrets[name] = contents
}

Expand Down
8 changes: 0 additions & 8 deletions pkg/controller/support/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package secrets

import (
"context"
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -39,11 +38,6 @@ func ReadSecrets(
// Extracts secrets into data to pass to buildkit
secretsData := make(map[string][]byte)
for _, secretRef := range obj.Spec.Secrets {
line := fmt.Sprintf("Processing secret reference ns:%s nm:%s mp:%s",
secretRef.Namespace, secretRef.Name, secretRef.MountPath)
log.Error(errors.New("error"), line)
secretRef.MountPath = "secrets"

secretClient := v1.Secrets(secretRef.Namespace)

path := strings.Join([]string{secretRef.Namespace, secretRef.Name}, "/")
Expand Down Expand Up @@ -76,14 +70,12 @@ func ReadSecrets(
}

if secretRef.MountPath != "" {
println("Replacing secret mount path with ", secretRef.MountPath)
path = secretRef.MountPath
}

// builds a path for the secret like {namespace}/{name}/{key} to avoid hash key collisions
for filename, data := range secret.Data {
name := strings.Join([]string{path, filename}, "/")
println("Secret name: ", name)
secretsData[name] = data
log.Info("Read secret bytes", "path", name, "bytes", len(data))
}
Expand Down

0 comments on commit d422c3a

Please sign in to comment.