Documentation
¶
Index ¶
- Constants
- Variables
- func MonoRepoNotice(writer io.Writer, monoRepoClusters ...string)
- func NewWriter(out io.Writer) *tabwriter.Writer
- func PrintErr(err error) error
- func PrintErrOrDie(err error)
- func WriteObject(printer printers.ResourcePrinter, dir string, object ast.FileObject) error
- type ConfigManagementClient
- func (c *ConfigManagementClient) EnableMultiRepo(ctx context.Context) (*unstructured.Unstructured, *unstructured.Unstructured, error)
- func (c *ConfigManagementClient) IsMultiRepo(ctx context.Context) (*bool, error)
- func (c *ConfigManagementClient) NestedBool(ctx context.Context, fields ...string) (bool, error)
- func (c *ConfigManagementClient) NestedInt(ctx context.Context, fields ...string) (int, error)
- func (c *ConfigManagementClient) NestedString(ctx context.Context, fields ...string) (string, error)
- func (c *ConfigManagementClient) NestedStringSlice(ctx context.Context, fields ...string) ([]string, error)
- func (c *ConfigManagementClient) UpdateConfigManagement(ctx context.Context, obj *unstructured.Unstructured) error
- func (c *ConfigManagementClient) Version(ctx context.Context) (string, error)
Constants ¶
const ( // ConfigManagementName is the name of the ConfigManagement object. ConfigManagementName = "config-management" // ConfigManagementResource is the config management resource ConfigManagementResource = "configmanagements" // ConfigManagementVersionName is the field name that indicates the ConfigManagement version. ConfigManagementVersionName = "configManagementVersion" )
const ( // Indent is the extra spaces for indentation. Indent = " " // Separator is the delimiter before each cluster. Separator = "--------------------" // Bullet is the separator before each bullet item. Bullet = "- " // ColorDefault is the default color code ColorDefault = "\033[0m" // ColorRed is the red color code ColorRed = "\033[31m" // ColorGreen is the green color code ColorGreen = "\033[32m" // ColorYellow is the yellow color code ColorYellow = "\033[33m" // ColorCyan is the cyan color code ColorCyan = "\033[36m" )
const ( // ErrorMsg indicates that an error has occurred when retrieving or calculating a field value. ErrorMsg = "ERROR" // NotInstalledMsg indicates that ACM is not installed on a cluster. NotInstalledMsg = "NOT INSTALLED" // NotRunningMsg indicates that ACM is installed but not running on a cluster. NotRunningMsg = "NOT RUNNING" // NotConfiguredMsg indicates that ACM is installed but not configured for a cluster. NotConfiguredMsg = "NOT CONFIGURED" // UnknownMsg indicates that a field's value is unknown or unavailable. UnknownMsg = "UNKNOWN" )
Status enums shared across nomos subcommands.
Variables ¶
var DynamicClient = dynamic.NewForConfig
DynamicClient obtains a client based on the supplied REST config. Can be overridden in tests.
Functions ¶
func MonoRepoNotice ¶
MonoRepoNotice logs a notice for the clusters that are running in the legacy mode.
func NewWriter ¶
NewWriter returns a standardized writer for the CLI for writing tabular output to the console.
func PrintErrOrDie ¶
func PrintErrOrDie(err error)
PrintErrOrDie attempts to print an error to STDERR, and panics if it is unable to.
func WriteObject ¶
func WriteObject(printer printers.ResourcePrinter, dir string, object ast.FileObject) error
WriteObject writes a FileObject to a file using the provided ResourcePrinter. Writes to the file at object.OSPath(), overwriting if one exists.
Types ¶
type ConfigManagementClient ¶
type ConfigManagementClient struct {
// contains filtered or unexported fields
}
ConfigManagementClient wraps a dynamic resource interface for reading ConfigManagement resources.
func NewConfigManagementClient ¶
func NewConfigManagementClient(cfg *rest.Config) (*ConfigManagementClient, error)
NewConfigManagementClient returns a new ConfigManagementClient.
func (*ConfigManagementClient) EnableMultiRepo ¶
func (c *ConfigManagementClient) EnableMultiRepo(ctx context.Context) (*unstructured.Unstructured, *unstructured.Unstructured, error)
EnableMultiRepo removes the spec.git field and sets spec.enableMultiRepo to true. It returns both the original and the updated ConfigManagement objects.
func (*ConfigManagementClient) IsMultiRepo ¶
func (c *ConfigManagementClient) IsMultiRepo(ctx context.Context) (*bool, error)
IsMultiRepo returns if the enableMultiRepoMode is true in the ConfigManagement objects.
func (*ConfigManagementClient) NestedBool ¶
NestedBool returns the boolean value specified by the given path of field names. Returns false if a value is not found and an error if value is not a bool.
func (*ConfigManagementClient) NestedInt ¶
NestedInt returns the integer value specified by the given path of field names. Returns false if a value is not found and an error if value is not a bool.
func (*ConfigManagementClient) NestedString ¶
func (c *ConfigManagementClient) NestedString(ctx context.Context, fields ...string) (string, error)
NestedString returns the string value specified by the given path of field names. Returns empty string if a value is not found and an error if value is not a string.
func (*ConfigManagementClient) NestedStringSlice ¶
func (c *ConfigManagementClient) NestedStringSlice(ctx context.Context, fields ...string) ([]string, error)
NestedStringSlice returns the string slice specified by the given path of field names. Returns nil if a value is not found and an error if value is not a string slice.
func (*ConfigManagementClient) UpdateConfigManagement ¶
func (c *ConfigManagementClient) UpdateConfigManagement(ctx context.Context, obj *unstructured.Unstructured) error
UpdateConfigManagement updates the ConfigManagement object in the API server.