Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue #356 #365

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

sukhil-suresh
Copy link
Contributor

Improve logging for the prepare step

Before

$ logs -image tutorial-image -build 1
[prepare] prepare:fetch.go:88: Successfully cloned "https://github.com/spring-projects/spring-petclinic" @ "82cb521d636b282340378d80a6307a08e3d4a4c4" in path "/workspace"

After:

$ logs -image tutorial-image -build 5
[prepare] Loading secrets for "https://index.docker.io/v1/" from secret "tutorial-registry-credentials"
[prepare] Successfully cloned "https://github.com/spring-projects/spring-petclinic" @ "400e3028f48a6c23f5156f6598dd10cb5e6a2849" in path "/workspace"

Signed-off-by: Sukhil Suresh ssuresh@pivotal.io

@sukhil-suresh sukhil-suresh marked this pull request as ready for review April 27, 2020 20:38
@sukhil-suresh sukhil-suresh linked an issue Apr 27, 2020 that may be closed by this pull request
@matthewmcnew
Copy link
Collaborator

This looks good!

@matthewmcnew
Copy link
Collaborator

At the moment, it will only display annotated docker secrets. I believe most users will actually configure kubernetes.io/dockerconfigjson or kubernetes.io/dockercfg secrets. Would we able to also log those?

@matthewmcnew
Copy link
Collaborator

Also, would it be possible to log git secrets?

@matthewmcnew
Copy link
Collaborator

Those can definitely be future PRs 🙂

@codecov-io
Copy link

codecov-io commented Apr 28, 2020

Codecov Report

Merging #365 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
- Coverage   67.62%   67.60%   -0.02%     
==========================================
  Files          80       80              
  Lines        3296     3294       -2     
==========================================
- Hits         2229     2227       -2     
  Misses        796      796              
  Partials      271      271              
Impacted Files Coverage Δ
pkg/dockercreds/parse_annoted_secrets.go 73.33% <ø> (ø)
pkg/apis/build/v1alpha1/build_pod.go 97.23% <100.00%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3cf2b1...908282b. Read the comment docs.

sukhil-suresh and others added 2 commits April 29, 2020 15:24
Improve logging for the prepare step

Before
```
$ logs -image tutorial-image -build 1
[prepare] prepare:fetch.go:88: Successfully cloned "https://github.com/spring-projects/spring-petclinic" @ "82cb521d636b282340378d80a6307a08e3d4a4c4" in path "/workspace"
```

After:
```
$ logs -image tutorial-image -build 5
[prepare] Loading secrets for "https://index.docker.io/v1/" from secret "tutorial-registry-credentials"
[prepare] Successfully cloned "https://github.com/spring-projects/spring-petclinic" @ "400e3028f48a6c23f5156f6598dd10cb5e6a2849" in path "/workspace"
```

Signed-off-by: Sukhil Suresh <ssuresh@pivotal.io>
- Log loading of dockeconfigjson and dockercfg secrets
- Log loading of git secrets
- Refactored to avoid passing logger around

Sample logging:
```
$ logs -image tutorial-image -build 7
[prepare] Loading secrets for "https://index.docker.io/v1/" from secret "tutorial-registry-credentials"
[prepare] Loading secrets for "https://index.docker.io/v1/" from secret "docker-configjson"
[prepare] Loading secrets for "registry.pivotal.io" from secret "docker-configjson"
[prepare] Loading secrets for "git@github.com" from secret "git-ssh-auth"
[prepare] Successfully cloned "https://github.com/sukhil-suresh/spring-petclinic" @ "6108a8a7c2f82ed37968db017e3ff120fb5b2265" in path "/workspace"
```

Signed-off-by: Sukhil Suresh <ssukhil@vmware.com>
@matthewmcnew
Copy link
Collaborator

Nice!

@sukhil-suresh sukhil-suresh merged commit 262380c into buildpacks-community:master Apr 29, 2020
@sukhil-suresh sukhil-suresh deleted the issue_356 branch April 29, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prepare step should provide info on what secrets are being loaded
4 participants