feat(2450): add annotations to chart metadata ()

* feat(2450): add options to chart metadata
pull/2632/merge
Kira 8 years ago committed by Steven E. Harris
parent 1ced91bb6d
commit 4c1a47480e

@ -80,4 +80,8 @@ message Metadata {
// TillerVersion is a SemVer constraints on what version of Tiller is required.
// See SemVer ranges here: https://github.com/Masterminds/semver#basic-comparisons
string tillerVersion = 15;
// Annotations are additional mappings uninterpreted by Tiller,
// made available for inspection by other applications.
map<string,string> annotations = 16;
}

@ -88,6 +88,18 @@ func verifyChartfile(t *testing.T, f *chart.Metadata, name string) {
t.Error("Unexpected keywords")
}
if len(f.Annotations) != 2 {
t.Fatalf("Unexpected annotations")
}
if want, got := "extravalue", f.Annotations["extrakey"]; want != got {
t.Errorf("Want %q, but got %q", want, got)
}
if want, got := "anothervalue", f.Annotations["anotherkey"]; want != got {
t.Errorf("Want %q, but got %q", want, got)
}
kk := []string{"frobnitz", "sprocket", "dodad"}
for i, k := range f.Keywords {
if kk[i] != k {

@ -15,3 +15,6 @@ sources:
- https://example.com/foo/bar
home: http://example.com
icon: https://example.com/64x64.png
annotations:
extrakey: extravalue
anotherkey: anothervalue

Binary file not shown.

@ -15,3 +15,6 @@ sources:
- https://example.com/foo/bar
home: http://example.com
icon: https://example.com/64x64.png
annotations:
extrakey: extravalue
anotherkey: anothervalue

@ -15,3 +15,6 @@ sources:
- https://example.com/foo/bar
home: http://example.com
icon: https://example.com/64x64.png
annotations:
extrakey: extravalue
anotherkey: anothervalue

@ -95,6 +95,9 @@ type Metadata struct {
// TillerVersion is a SemVer constraints on what version of Tiller is required.
// See SemVer ranges here: https://github.com/Masterminds/semver#basic-comparisons
TillerVersion string `protobuf:"bytes,15,opt,name=tillerVersion" json:"tillerVersion,omitempty"`
// Annotations are additional mappings uninterpreted by Tiller,
// made available for inspection by other applications.
Annotations map[string]string `protobuf:"bytes,16,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *Metadata) Reset() { *m = Metadata{} }
@ -207,6 +210,13 @@ func (m *Metadata) GetTillerVersion() string {
return ""
}
func (m *Metadata) GetAnnotations() map[string]string {
if m != nil {
return m.Annotations
}
return nil
}
func init() {
proto.RegisterType((*Maintainer)(nil), "hapi.chart.Maintainer")
proto.RegisterType((*Metadata)(nil), "hapi.chart.Metadata")
@ -216,28 +226,31 @@ func init() {
func init() { proto.RegisterFile("hapi/chart/metadata.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 354 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x5f, 0x4b, 0xe3, 0x40,
0x14, 0xc5, 0x37, 0x9b, 0xe6, 0xdf, 0xcd, 0x76, 0xb7, 0x0c, 0x4b, 0x99, 0x5d, 0x44, 0x42, 0xf1,
0x21, 0x4f, 0x29, 0x28, 0x88, 0xcf, 0x82, 0xf8, 0xa0, 0x6d, 0x25, 0xf8, 0x07, 0x7c, 0x1b, 0x93,
0x4b, 0x3b, 0xd8, 0xcc, 0x84, 0xc9, 0xa8, 0xf8, 0x7d, 0xfd, 0x20, 0x32, 0x93, 0xa4, 0x8d, 0xe0,
0xdb, 0x3d, 0xe7, 0xe4, 0xfe, 0xc2, 0xb9, 0x0c, 0xfc, 0xdb, 0xb0, 0x9a, 0xcf, 0x8b, 0x0d, 0x53,
0x7a, 0x5e, 0xa1, 0x66, 0x25, 0xd3, 0x2c, 0xab, 0x95, 0xd4, 0x92, 0x80, 0x89, 0x32, 0x1b, 0xcd,
0x4e, 0x01, 0x16, 0x8c, 0x0b, 0xcd, 0xb8, 0x40, 0x45, 0x08, 0x8c, 0x04, 0xab, 0x90, 0x3a, 0x89,
0x93, 0x46, 0xb9, 0x9d, 0xc9, 0x5f, 0xf0, 0xb0, 0x62, 0x7c, 0x4b, 0x7f, 0x5a, 0xb3, 0x15, 0xb3,
0x0f, 0x17, 0xc2, 0x45, 0x87, 0xfd, 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, 0xe0, 0x5d, 0xae, 0x6e, 0x6f, 0xae, 0x27, 0xce, 0x79, 0xf0, 0xe8, 0xd9, 0x33, 0x3d,
0xf9, 0xf6, 0xe9, 0x9c, 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, 0xea, 0xb5, 0x4c, 0xbe, 0x57, 0x02,
0x00, 0x00,
// 412 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x5d, 0x6b, 0xd5, 0x40,
0x10, 0x35, 0xbd, 0x9f, 0x99, 0x58, 0x0d, 0x83, 0x94, 0xb5, 0x88, 0x84, 0x8b, 0x42, 0x9e, 0x52,
0x50, 0x90, 0xe2, 0x83, 0xa0, 0x50, 0xfa, 0xa0, 0xbd, 0x95, 0xe0, 0x07, 0xf8, 0xb6, 0x26, 0x43,
0xef, 0xd2, 0x64, 0x37, 0xec, 0x6e, 0x2b, 0xf7, 0x47, 0xfb, 0x1f, 0x64, 0x37, 0xd9, 0x26, 0x95,
0xbe, 0xcd, 0x39, 0x67, 0xe6, 0xec, 0x9e, 0x61, 0xe0, 0xf9, 0x8e, 0x77, 0xe2, 0xa4, 0xda, 0x71,
0x6d, 0x4f, 0x5a, 0xb2, 0xbc, 0xe6, 0x96, 0x17, 0x9d, 0x56, 0x56, 0x21, 0x38, 0xa9, 0xf0, 0xd2,
0xe6, 0x1d, 0xc0, 0x05, 0x17, 0xd2, 0x72, 0x21, 0x49, 0x23, 0xc2, 0x5c, 0xf2, 0x96, 0x58, 0x94,
0x45, 0x79, 0x5c, 0xfa, 0x1a, 0x9f, 0xc1, 0x82, 0x5a, 0x2e, 0x1a, 0x76, 0xe0, 0xc9, 0x1e, 0x6c,
0xfe, 0xce, 0x61, 0x7d, 0x31, 0xd8, 0x3e, 0x38, 0x86, 0x30, 0xdf, 0xa9, 0x96, 0x86, 0x29, 0x5f,
0x23, 0x83, 0x95, 0x51, 0x37, 0xba, 0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