Documentation
¶
Index ¶
Constants ¶
const (
// ExtensionsLibFilename is the file name with the contents of the
// generated ksonnet-lib
ExtensionsLibFilename = "k.libsonnet"
)
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 ¶
func ParseClusterSpec(specFlag string, fs afero.Fs) (ClusterSpec, error)
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 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) (*Manager, error)
NewManager creates a new instance of lib.Manager
func (*Manager) GenerateLibData ¶
func (m *Manager) GenerateLibData(useVersionPath bool) error
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 ¶
func (m *Manager) GetLibPath(useVersionPath bool) (string, error)
GetLibPath returns the absolute path pointing to the directory with the metadata files for the provided k8sVersion.