Skip to content

Releases: deckhouse/lib-dhctl

Trim new line for success title in pretty

17 Apr 15:43
d711d8e

Choose a tag to compare

Fix:
in log:

  • trim new line for success title in pretty

Returns correct process logger from tee logger

17 Apr 14:00
5432041

Choose a tag to compare

Fix:
in log:

  • return correct process logger from tee logger.
    Tee logger always return wrappedProcessLogger.
    When we use pretty logger in tee we got incorrect output.

Add new line in Success pretty logger

16 Apr 20:24
9b977e6

Choose a tag to compare

Fix:
in log:

  • add new line in Success pretty logger

Add extensions rule error

31 Mar 13:06
9cdade5

Choose a tag to compare

Add:
in yaml

  • extensions rule error. Needs for use another places to simplify error creating.

Call parent process logger in InMemoryLogger

29 Jan 18:26
eb8ae1f

Choose a tag to compare

Fix:
in log:

  • Call parent process logger in InMemoryLogger for better observability

Check document has not contains multiple apiVersion an kind and trim last new line in *F in logger

28 Jan 20:41
d5ecc6a

Choose a tag to compare

Add:
in yaml package:

  • ParseIndex check that document contains only one apiVersion and kind keys. It needs to fail if user forget to add --- yaml documents separator to multi-documents yaml.

in log package:

  • trim last new line from format in *F functions. Because *F functions add new line to format we can get situation in migration when we forget to delete new line at end of format in old code.

Chore:
in log package:

  • add deprecation warnings to all loggers for *Ln functions.

Add ExtractValidationError and ExtractValidationErrors func

16 Jan 20:07
0f7fe15

Choose a tag to compare

Add:
in yaml package:

  • Add ExtractValidationError and ExtractValidationErrors func for extracting ErrorKind from passed error

Add ErrUnknown to validation.ErrorKind

16 Jan 19:47
b151933

Choose a tag to compare

Add:
in package yaml:

  • ErrUnknown in validation for fallback

SchemaIndex: add ParseIndex func and methods for extract group and group version

16 Jan 19:30
b9e397b

Choose a tag to compare

Add:
in yaml package:

  • Add ParseIndex func for parsing SchemaIndex from document only.
  • Add methods Group and GroupVersion for extract group and group version from SchemaIndex.
  • Add ErrRead error for causes when io.Reader returns error while parsing.

Add yaml package

16 Jan 17:45
378b2dc

Choose a tag to compare

Add:

  • yaml package:
    Add Errors primitives.
    It contains primary Validator struct for validate yaml documents with apiVersion and kind fields. Now Validator wrap validation and another errors with special pre-defined errors which handle is need with errors.Is.
    It was migrated SchemaStore from dhctl. But new struct can:

    • extended with transformers for transform Schema (for example we add by default disallow additional properties). User can add your own transformers.
    • PreValidator for additional validation before validate by schema. For example we validate ModuleConfig resources in dhctl, but every module config has it own validation schema for settings field. This settings should validate before validate entry document, because validation by schema only validate ModuleConfig document as is (that document present settings, version field) and settings will not validate by own settings schema.
    • extensions validators, like x-rules for validate separated fields by own validation functions. For example, in dhctl we validate ssh private key in ConnectionConfig using parsing go-ssh parse string, for private is valid private key string but not random string.
    • apiVersion fallbacks. For example old clients can use deleted apiVersion from specs user of library can add fallback from deleted versions for present. By default, we add fallback from version deckhouse.io/v1alpha1 to deckhouse.io/v1.
    • LoadSchemas for parse and load schemas from io.Reader to []openapi/*spec.Schema (schema can contains multiple apiVersions). Warning! In LoadSchemas we add disallow additional properties if it was not set.

    Also, we added some utils functions:

    • SplitYAML* for split content on multiple documents by \n---\n separator.
    • Unmarshal wrapper for yaml.Unmarshal but this function is generic and return result as return, not by argument pointer.