Skip to content

Commit

Permalink
feat(chart): Adding maintainer url
Browse files Browse the repository at this point in the history
Each maintainer can have an optional URL. There are seceral use
cases for providing a URL instead of an email address:
- The case where a maintainer wants to hide their email address
  behind a webform for personal security
- When the maintainer is an organization and feedback should
  go to an issue queue

This change:
- Adds the proto field for url
- Updates the generated files for the chart proto
- Includes linting for the url
- Updates the docs to include the url

Closes #3056
  • Loading branch information
mattfarina committed Oct 24, 2017
1 parent 4b6ecb4 commit 22e5381
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 27 deletions.
3 changes: 3 additions & 0 deletions _proto/hapi/chart/metadata.proto
Expand Up @@ -25,6 +25,9 @@ message Maintainer {

// Email is an optional email address to contact the named maintainer
string email = 2;

// Url is an optional URL to an address for the named maintainer
string url = 3;
}

// Metadata for a Chart file. This models the structure of a Chart.yaml file.
Expand Down
1 change: 1 addition & 0 deletions docs/charts.md
Expand Up @@ -52,6 +52,7 @@ sources:
maintainers: # (optional)
- name: The maintainer's name (required for each maintainer)
email: The maintainer's email (optional for each maintainer)
url: A URL for the maintainer (optional for each maintainer)
engine: gotpl # The name of the template engine (optional, defaults to gotpl)
icon: A URL to an SVG or PNG image to be used as an icon (optional).
appVersion: The version of the app that this contains (optional). This needn't be SemVer.
Expand Down
2 changes: 2 additions & 0 deletions pkg/lint/rules/chartfile.go
Expand Up @@ -141,6 +141,8 @@ func validateChartMaintainer(cf *chart.Metadata) error {
return errors.New("each maintainer requires a name")
} else if maintainer.Email != "" && !govalidator.IsEmail(maintainer.Email) {
return fmt.Errorf("invalid email '%s' for maintainer '%s'", maintainer.Email, maintainer.Name)
} else if maintainer.Url != "" && !govalidator.IsURL(maintainer.Url) {
return fmt.Errorf("invalid url '%s' for maintainer '%s'", maintainer.Url, maintainer.Name)
}
}
return nil
Expand Down
64 changes: 37 additions & 27 deletions pkg/proto/hapi/chart/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 22e5381

Please sign in to comment.