Documentation ¶
Index ¶
Constants ¶
const ( // ExtensionsLibFilename is the file name with the contents of the // generated ksonnet-lib ExtensionsLibFilename = "k.libsonnet" // KsonnetLibHome is name of the directory ksonnet lib files will be generated in. KsonnetLibHome = "ksonnet-lib" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterSpec ¶
type ClusterSpec interface { OpenAPI() ([]byte, error) Resource() string // For testing parsing logic. Version() (string, error) }
ClusterSpec represents the API supported by some cluster. There are several ways to specify a cluster, including: querying the API server, reading an OpenAPI spec in some file, or consulting the OpenAPI spec released in a specific version of Kubernetes.
func ParseClusterSpec ¶
ParseClusterSpec will parse a cluster spec flag and output a well-formed ClusterSpec object. For example, if the flag is `--version:v1.7.1`, then we will output a ClusterSpec representing the cluster specification associated with the `v1.7.1` build of Kubernetes.
type KsLibGenerator ¶ added in v0.12.0
type KsLibGenerator interface {
Generate() (*kslib.KsonnetLib, error)
}
KsLibGenerator generates ksonnet-lib.
type Manager ¶
type Manager struct { // K8sVersion is the Kubernetes version of the Open API spec. K8sVersion string // contains filtered or unexported fields }
Manager operates on the files in the lib directory of a ksonnet project. This included generating the ksonnet-lib files needed to compile the ksonnet (jsonnet) code.
func NewManager ¶
func NewManager(k8sSpecFlag string, fs afero.Fs, libPath string, httpClient *http.Client) (*Manager, error)
NewManager creates a new instance of lib.Manager
func (*Manager) GenerateLibData ¶
GenerateLibData will generate the swagger and ksonnet-lib files in the lib directory of a ksonnet project. The swagger and ksonnet-lib files are unique to each Kubernetes API version. If the files already exist for a specific Kubernetes API version, they won't be re-generated here.
func (*Manager) GetLibPath ¶
GetLibPath returns the absolute path pointing to the directory with the metadata files for the provided k8sVersion.