Releases: deckhouse/lib-dhctl
Releases · deckhouse/lib-dhctl
Trim new line for success title in pretty
Returns correct process logger from tee logger
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
Fix:
in log:
- add new line in Success pretty logger
Add extensions rule error
Add:
in yaml
- extensions rule error. Needs for use another places to simplify error creating.
Call parent process logger in InMemoryLogger
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
Add:
in yaml package:
- ParseIndex check that document contains only one
apiVersionandkindkeys. 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
*Ffunctions. Because*Ffunctions 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
*Lnfunctions.
Add ExtractValidationError and ExtractValidationErrors func
Add:
in yaml package:
- Add
ExtractValidationErrorandExtractValidationErrorsfunc for extractingErrorKindfrom passed error
Add ErrUnknown to validation.ErrorKind
Add:
in package yaml:
- ErrUnknown in validation for fallback
SchemaIndex: add ParseIndex func and methods for extract group and group version
Add:
in yaml package:
- Add
ParseIndexfunc for parsingSchemaIndexfrom document only. - Add methods
GroupandGroupVersionfor extract group and group version fromSchemaIndex. - Add
ErrReaderror for causes when io.Reader returns error while parsing.
Add yaml package
Add:
-
yamlpackage:
Add Errors primitives.
It contains primaryValidatorstruct for validate yaml documents withapiVersionandkindfields. NowValidatorwrap validation and another errors with special pre-defined errors which handle is need witherrors.Is.
It was migratedSchemaStorefrom 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. PreValidatorfor additional validation before validate by schema. For example we validateModuleConfigresources in dhctl, but every module config has it own validation schema forsettingsfield. This settings should validate before validate entry document, because validation by schema only validateModuleConfigdocument as is (that document presentsettings,versionfield) andsettingswill not validate by own settings schema.- extensions validators, like
x-rulesfor validate separated fields by own validation functions. For example, in dhctl we validate ssh private key inConnectionConfigusing 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/v1alpha1todeckhouse.io/v1. LoadSchemasfor parse and load schemas fromio.Readerto[]openapi/*spec.Schema(schema can contains multiple apiVersions). Warning! InLoadSchemaswe add disallow additional properties if it was not set.
Also, we added some utils functions:
SplitYAML*for split content on multiple documents by\n---\nseparator.Unmarshalwrapper foryaml.Unmarshalbut this function is generic and return result as return, not by argument pointer.
- extended with transformers for transform