Giter Club home page Giter Club logo

chart-doc-gen's Introduction

Go Report Card Build Status codecov Docker Pulls Slack Twitter

Kubepack

Configure Helm

helm repo add kubepack-bundles https://bundles.kubepack.com
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm repo update

Generate Test Bundles

$ go run cmd/bundle-generator/main.go --name=csi-vault-bundle --charts https://charts.appscode.com/stable/@[email protected]

$ go run cmd/bundle-generator/main.go --name=vault-operator-bundle \
  --charts https://charts.appscode.com/stable/@[email protected] \
  --charts https://charts.appscode.com/stable/@[email protected] \
  --bundles https://bundles.kubepack.com@[email protected]

$ go run cmd/bundle-generator/main.go --name=stash-mongodb-bundle \
  --charts https://charts.appscode.com/stable/@[email protected]:true,3.6.13:true,4.0.11:true,4.1.13:true@required@anyof

$ go run cmd/bundle-generator/main.go --name=stash-bundle \
  --charts https://bundles.kubepack.com@[email protected] \
  --bundles https://bundles.kubepack.com@[email protected]

# $ go run cmd/bundle-generator/main.go --name=cert-manager-bundle --charts https://charts.jetstack.io@[email protected]@@@cert-manager

$ go run cmd/bundle-generator/main.go --name=kubedb-bundle \
  --charts https://charts.appscode.com/stable/@[email protected] \
  --charts https://charts.appscode.com/stable/@[email protected] \
  --charts https://charts.jetstack.io@[email protected]@optional@@cert-manager \
  --bundles https://bundles.kubepack.com@[email protected]

$ ./hack/publish-testcharts.sh

Generate BundleView from a Bundle

$ go run cmd/bundleview-generator/main.go

Generate Order from a BundleView

$ go run cmd/order-generator/main.go

Generate Application from a selected Chart in an Order

$ go run cmd/app-generator/main.go

Generate PackageView for a Chart

$ go run cmd/packageview-generator/main.go

Generate Install scripts

Site for Hosting User YAMLs & Scripts

https://usercontent.kubepack.com. These files are public and hosted on Google Cloud Storage Bucket gs://usercontent.kubepack.com.

Helm 3

$ go run cmd/helm3-command-generator/main.go

Helm 2

$ go run cmd/helm2-command-generator/main.go

YAML

$ go run cmd/install-yaml-generator/main.go

Check Permission

$ go run cmd/permission-checker/main.go

Install / Uninstall Chart

$ go run cmd/install-order/main.go
$ go run cmd/uninstall-order/main.go

Read Helm Hub index to determine Chart Repository Name

$ go run cmd/helm-hub-reader/main.go

chart-doc-gen's People

Contributors

1gtm avatar cstruck avatar lanceea avatar tamalsaha avatar yehiyam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chart-doc-gen's Issues

Issue: Project cannot be built

Issue

The Project cannot be built as we got this error

go get -u kubepack.dev/[email protected]
go: downloading kubepack.dev/chart-doc-gen v0.3.4
go: downloading sigs.k8s.io/kustomize/kyaml v0.1.12
go: downloading k8s.io/apimachinery v0.18.3
go: downloading github.com/go-errors/errors v1.0.2
go: downloading github.com/olekukonko/tablewriter v0.0.5
go: downloading github.com/go-errors/errors v1.1.1
go: downloading k8s.io/apimachinery v0.21.0
go: downloading sigs.k8s.io/kustomize v1.0.11
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/mattn/go-runewidth v0.0.12
go: downloading sigs.k8s.io/kustomize/kyaml v0.10.17
go: downloading github.com/go-openapi/spec v0.20.3
go: downloading github.com/go-openapi/jsonpointer v0.19.5
go: downloading github.com/go-openapi/swag v0.19.15
go: downloading github.com/go-openapi/jsonreference v0.19.5
go: downloading golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading golang.org/x/text v0.3.6
go: downloading gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
go: downloading github.com/rivo/uniseg v0.1.0
go: downloading github.com/josharian/intern v1.0.0
go: downloading github.com/rivo/uniseg v0.2.0
# kubepack.dev/chart-doc-gen/walk
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:53:6: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:54:42: unknown field 'Key' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:54:52: unknown field 'Value' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:70:63: unknown field 'Key' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:70:73: unknown field 'Value' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:76:5: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/map.go:39:23: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/map.go:55:5: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/map.go:111:29: not enough arguments in call to openapi.Resolve
	have (*spec.Ref)
	want (*spec.Ref, *spec.Schema)
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/map.go:125:29: not enough arguments in call to openapi.Resolve
	have (*spec.Ref)
	want (*spec.Ref, *spec.Schema)
../../../golang/pkg/mod/kubepack.dev/[email protected]/walk/map.go:125:29: too many errors

Version

go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/usr/local/opt/go/libexec/bin"
GOCACHE="/Users/cmoullia/Library/Caches/go-build"
GOENV="/Users/cmoullia/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/cmoullia/code/golang"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.3/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/go-build515653748=/tmp/go-build -gno-record-gcc-switches -fno-common"

bump k8s and kyyaml dependencies to the latest

The two main dependencies k8s and kyaml are on older versions. I propose getting them updated to the latest.

  • bump k8s to v0.28.2 - along with transitive dependencies
  • bumpy kyaml 0.14.3

Note, newer versions of kyaml seem to have resolved #28

Support for lists

Thanks for this - really nice.

Got really excited and migrated to this format throughout, and then found that it doesn't look to handle list objects?

Some of the main values blocks in our helm chart look like:

tenants:
  # Some desc
- name: tenant_name
  features:
    # Some other desc
    bob: foo

Which you often see documented like:

Parameter Description
tenants[0].name Some desc
tenants[0].features.bob Some other desc

Is this possible? Is this easily implemented if not?

Keys with an empty value are no longer included in the generated README

Starting in version 0.4, keys that have an "empty" value are no longer included in the generated README.

E.g. the following values.yaml:

# annotations applied to the server pod
podAnnotations: {}

used to be included in the README.md as:

Parameter Description Default
podAnnotations annotations applied to the server pod {}

But is now no longer included at all. Is this expected behavior?

Multiline values are currently broken

the go package github.com/olekukonko/tablewriter handles newlines in strings a bit weird. It creates new table rows for each newline.

This kills the preview for multiline yaml values e.g:

someKey: |
   this is a
   multiline
   value

because it creates a table looking like

a b c
someKey
this is a
multiline
value

instead of how the table should actually look like

a b c
someKey |
this is a
multiline
value

Parsing Chart.yaml ?

Hi,

Your project is really geat ๐Ÿ‘
However, why do we have to provide a doc.yaml which contains a chart block ?
The Chart.yaml could be used as an input, no ?

issue during download

I am getting issue during download:

$ go get -u kubepack.dev/[email protected]
go: downloading kubepack.dev/chart-doc-gen v0.3.0
go: downloading sigs.k8s.io/kustomize/kyaml v0.1.8
go: downloading github.com/go-openapi/jsonreference v0.19.2
go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
# kubepack.dev/chart-doc-gen/walk
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:53:6: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:54:42: unknown field 'Key' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:54:52: unknown field 'Value' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:70:63: unknown field 'Key' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:70:73: unknown field 'Value' in struct literal of type "sigs.k8s.io/kustomize/kyaml/yaml".ElementSetter
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/associative_sequence.go:76:5: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/map.go:39:23: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/map.go:52:5: undefined: "sigs.k8s.io/kustomize/kyaml/yaml".IsEmpty
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/map.go:108:29: not enough arguments in call to openapi.Resolve
        have (*spec.Ref)
        want (*spec.Ref, *spec.Schema)
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/map.go:122:29: not enough arguments in call to openapi.Resolve
        have (*spec.Ref)
        want (*spec.Ref, *spec.Schema)
../../../go/pkg/mod/kubepack.dev/[email protected]/walk/map.go:122:29: too many errors
$ go version
go version go1.16.2 darwin/amd64

[Feature Request] Parent object documenation

In some cases it is useful to add some documenation at 2 diffent levels. Example :

# Bla bla about persistence
persistence:
  # Enable / disable persistence
  enabled: true

Currently, you can't have both comments. Using the +doc-gen:break tag which is nice to get persistence comment but you won't get sub attributes description.

Do you think it might be possible to add both :

parameter Description Default
persistence Bla bla about persistence { enabled: true }
persistence.enbaled Enable / disable persistence true

Moreover, in order to have shorter values.yaml files, it is common to add inline comments. Do you think you could handle it ?

# Bla bla about persistence
persistence:
  enabled: true  # Enable / disable persistence

Ignore values

Hi
Is it possible to ignore values - don't put them in the readme?
If not, are you open to a PR?

Preserve formatting of examples

My chart has a bunch of features which can be activated through the values.yaml. Those however aren't just switches, but can contain templating themselves. As an example, one might pass a complete custom object definition as a string:

# Define a list of custom objects as complete k8s object definition (with template strings included).
# Example:
# customObjects:
#   - |
#     apiVersion: v1
#     kind: Secret
#     metadata:
#       name: best-token-{{ include "chart.fullname" . }}
#     type: Opaque
#     data:
#       mykey: {{ uuidv4 | sha256sum | b64enc }}
customObjects: []

First of all it's nice to have the example feature, where one can include an example inside the description field. Sadly the formatting isn't preserved, i.e. all whitespace at the start of each line is trimmed, so that the actual output looks more like this:

image

Which of course would be the wrong format if a user wants to copy that example as a reference. Also in general it's hard to read, as one can not be sure which elements belong to which yaml object.

So I would like to propose to keep the original formatting. Maybe you could even introduce a new flag like # Code-Example or similiar, which would then keep all the formatting done in the strings below it.
If possible, it would also be nice if that code example would be wrapped inside a single codeblock, not one for each line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.