Skip to content

Commit

Permalink
Merge pull request #2 from grafeas/master
Browse files Browse the repository at this point in the history
Merge from Master
  • Loading branch information
judavi committed Nov 4, 2019
2 parents 860b169 + 46886af commit 21f5b13
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
This is the changelog of Grafeas server releases. For more information on
versionining, see [versioning](docs/versioning.md) document.

v0.1.2:
* Support for multiple storage implementations.

v0.1.1:
* Grafeas helm chart is compliant with stable requirements.
* Code cleanup.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ control of different types of metadata.

## Getting Started

* Watch the talk on [Software Supply Chain Management with Grafeas and Kritis](https://www.infoq.com/presentations/supply-grafeas-kritis/)
* Read the Grafeas [announcement](https://grafeas.io/blog/introducing-grafeas)
* Learn the [Grafeas concepts](docs/grafeas_concepts.md) and [core design
principles](docs/design_principles.md)
Expand Down
7 changes: 6 additions & 1 deletion go/v1/api/occurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ func (g *API) ListNoteOccurrences(ctx context.Context, req *gpb.ListNoteOccurren
return err
}

occs, npt, err := g.Storage.ListNoteOccurrences(ctx, pID, nID, req.Filter, req.PageToken, req.PageSize)
ps, err := validatePageSize(req.PageSize)
if err != nil {
return err
}

occs, npt, err := g.Storage.ListNoteOccurrences(ctx, pID, nID, req.Filter, req.PageToken, ps)
if err != nil {
return err
}
Expand Down
10 changes: 9 additions & 1 deletion go/v1/api/occurrence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ func TestListNoteOccurrencesErrors(t *testing.T) {
tests := []struct {
desc string
noteName string
pageSize int32
internalStorageErr, authErr bool
wantErrStatus codes.Code
}{
Expand All @@ -723,6 +724,12 @@ func TestListNoteOccurrencesErrors(t *testing.T) {
internalStorageErr: true,
wantErrStatus: codes.Internal,
},
{
desc: "invalid page size error",
noteName: "projects/goog-vulnz/notes/CVE-UH-OH",
pageSize: -1,
wantErrStatus: codes.InvalidArgument,
},
}

for _, tt := range tests {
Expand All @@ -735,7 +742,8 @@ func TestListNoteOccurrencesErrors(t *testing.T) {
}

req := &gpb.ListNoteOccurrencesRequest{
Name: tt.noteName,
Name: tt.noteName,
PageSize: tt.pageSize,
}
resp := &gpb.ListNoteOccurrencesResponse{}
err := g.ListNoteOccurrences(ctx, req, resp)
Expand Down
8 changes: 4 additions & 4 deletions go/v1/filter/filter.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package filter handles filtering the results of list methods.
// Package filter handles filtering the results of methods that support filtering.
package filter

import (
Expand All @@ -16,11 +16,11 @@ type Resource interface{}
//
// The base resource name
// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) is an optional
// dimension the filter works on. For example it could be the project name if the list method this
// filter handler is for acts on a project level.
// dimension the filter works on. For example it could be the project name if the method this filter
// handler is for acts on a project level.
type Handler func(ctx context.Context, baseResourceName, filter, pageToken string, pageSize int32) (Resource, string, bool, error)

// Filterer holds functions on how to handle various filter patterns for listing resources.
// Filterer holds functions on how to handle various filter patterns for filtering resources.
type Filterer struct {
// Handlers contain all functions that handle specific filter patterns.
Handlers []Handler
Expand Down
2 changes: 1 addition & 1 deletion grafeas-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v1
appVersion: "v0.1.0"
description: A Helm chart for Kubernetes
name: grafeas-charts
version: 0.1.1
version: 0.1.2
icon: https://raw.githubusercontent.com/grafeas/grafeas/master/logo/grafeas-logo-128.png
5 changes: 4 additions & 1 deletion grafeas-charts/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.secret.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -11,4 +13,5 @@ type: Opaque
data:
ca.crt: {{ .Values.certificates.ca | b64enc }}
server.crt : {{ .Values.certificates.cert | b64enc }}
server.key: {{ .Values.certificates.key | b64enc }}
server.key: {{ .Values.certificates.key | b64enc }}
{{- end }}
5 changes: 4 additions & 1 deletion grafeas-charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
replicaCount: 1

secret:
enabled: false

image:
repository: us.gcr.io/grafeas
name: grafeas-server
tag: v0.1.1
tag: v0.1.2
pullPolicy: IfNotPresent

nameOverride: "grafeas-server"
Expand Down

0 comments on commit 21f5b13

Please sign in to comment.