tileinspect

package module
v0.0.0-...-c235986 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 0 Imported by: 0

README

Tileinspect

Tileinspect is a helpful utility to gather and validate information about a tile. Most of this data is available inside the tile's metadata file, but this utility simplifies the retrieval of that data.

Commands

tileinspect metadata

Prints the entire metadata file.

tileinspect stemcell

Prints the stemcell criteria information for this tile.

tileinspect check-config

Compares the tile's property blueprints and a config file (in JSON or YAML format) and checks if this config could be used to deploy this tile.

Specifically, this will check that the config file:

  • Is proper JSON or YAML
  • Has a top-level product-properties section
  • Only has properties that are defined in the tile
  • Only has properties that are in a selected option of a selector property
  • Has values for all required properties without defaults.
tileinspect make-config

Creates a valid config file for this tile. This will provide a quick starting point for making config files for repeated testing.

Tileinspect will pick a value for the properties in this order:

  • A value provided with the -v|--value CLI option
  • A default value provided specified by the tile
  • For dropdown_select and selector properties, the first value
  • A sample value (e.g. SAMPLE_STRING_VALUE) that is meant to be replaced

For tiles with selectors, non-selected options will not have any values for their properties in the config file. Use the -v flag to set a value for that selector and tileinspect make-config will populate the config with the properties for the selected option.

Example:

tileinspect make-config -t my-tile.pivotal -v .properties.network_selector:"Use TCP"
tileinspect version

Prints the current version of Tileinspect.

Developing

When making changes, please utilize the Makefile for testing and building:

make test will execute the unit tests.

make test-features will execute the feature tests.

make build will build the tileinspect binary.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug bool `long:"debug" description:"Outputs more info than usual"`
}

type ConfigFile

type ConfigFile struct {
	ProductName       string                         `json:"product-name"`
	ProductProperties map[string]*ConfigFileProperty `json:"product-properties"`
}

type ConfigFileProperty

type ConfigFileProperty struct {
	Type     string      `json:"type"`
	Value    interface{} `json:"value"`
	Required *bool       `json:"required,omitempty"`
}

type JobType

type JobType struct {
	Name               string         `json:"name"`
	PropertyBlueprints []TileProperty `json:"property_blueprints"`
}

type MetadataCmd

type MetadataCmd interface {
	LoadMetadata(target interface{}) error
}

type Option

type Option struct {
	Name  interface{} `json:"name"`
	Label interface{} `json:"label"`
}

type TileConfig

type TileConfig struct {
	Tile string `long:"tile" short:"t" description:"path to product file" required:"true"`
}

type TileProperties

type TileProperties struct {
	Name               string                 `json:"name"`
	PropertyBlueprints []TileProperty         `json:"property_blueprints"`
	SelectValue        string                 `json:"select_value"`
	StemcellCriteria   map[string]interface{} `json:"stemcell_criteria"`
	JobTypes           []JobType              `json:"job_types"`
}

type TileProperty

type TileProperty struct {
	Name               string      `json:"name"`
	Type               string      `json:"type"`
	Configurable       bool        `json:"configurable"`
	Default            interface{} `json:"default"`
	Optional           bool        `json:"optional"`
	Options            []Option
	ChildProperties    []TileProperties `json:"option_templates"`
	PropertyBlueprints []TileProperty   `json:"property_blueprints"`
}

Directories

Path Synopsis
cmd
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL