- update release documentation
- update various dependencies to address security vulnerabilities
- Fix Release configuration
- Fix typo in model.md:
- Fix Go Releaser build step
- Added support for helm as an external data source
- Add ability to filter by namespaces using
-p
and-P
and the ability to filter out cluster-scoped-objects via--include-cluster-objects=false
- Fix info in
qbec version
apply
now waits forbatch/job
objects (thanks @kvaps)- Improved error message includes helpful hints on operations requiring exactly one qbec environment as input (thanks @kalhanreddy)
eval
now supports inline datasources without the need to specify a qbec environment- Kubernetes list operations now use a page size of
1000
by default.--k8s:list-page-size
can be used to adjust the size Setting this value too low can impact performance when dealing with large lists - Update jsonnet library to
v0.18.0
, k8s client libs tov1.23.1
and golang version to1.17
- Misc. housekeeping improvements
Backward incompatibilities:
apply
now waits forbatch/job
objects. To disable waiting for all objects--wait-all=false
can be used.- Adjustments to the internal behaviour around listing Kubernetes objects. Use
--k8s:list-page-size
with appropriate values. - Any corner-case behavior from updating k8s client, jsonnet libraries or golang version
- Expose data source creation in the VM implementation for public use
- Expose VM implementation as a publicly consumable library
- Change
params.jsonnet
created byqbec init
to automatically pull environment files using the glob importer (thanks to @kvaps)
- Add a
renderYaml
native function to the qbec VM to generate YAML output compatible withqbec fmt
. If this native function is passed an array, it will render multiple YAML docs with separators. Top-level nils are ignored for output. If you want an array value to be serialized as a single document, wrap it in a single-element array.
- Fix a bug where glob imports could not import relative files outside the qbec root/ current working dir
fmt
andalpha lint
commands now accept exclusion patterns using which vendored files, intentionally bad test data etc. can be filtered out. Pattern matching of exlcudes is done using the doublestar library.qbec.yaml
can now contain examples of data source outputs. These are returned by the mock linter implementation when data source imports are found. This allows you to correctly lint files that use data source imports.
fmt
is now a top-level qbec command. Thealpha fmt
version is deprecated and will be removed in a later release.fmt
has the following enhancements:- no longer requires a qbec.yaml to be present to function
- prints all errors in check mode as opposed to failing fast on the first error encountered
- prints the filenames of all files that were modified in write mode
- allows for explicit control on whether it should fail fast or not. The default behavior is to fail fast when not in check mode and continue on errors otherwise.
- a new
alpha lint
command can now be used to lint jsonnet and libsonnet files using jsonnet-lint. This command is alpha quality in both interface and implementation although it should work just fine on most projects. Known issues are:- data sources are not correctly supported
- the linter can hang on complex jsonnet files
- the linter can panic under certain conditions
- Releases now contain ARM64 builds for Darwin and Linux
- Allows the QPS and Burst for the kubernetes client to be configured on the command line via the
k8s:qps
andk8s:burst
flags. Setting these values can be beneficial to large projects producing thousands of objects to improve the performance ofdiff
andapply
.
- Add ability to inherit the qbec shell environment when processing data sources.
There are no changes in this release. The previous release used a jsonnet version
that had a regression in the std.manifestJson[Ex]
functions.
This version uses a commit
that fixes this issue.
Note: there is a regression with the std.manifestJson[Ex]
function in this release. Please use v0.14.1 instead.
-
qbec now allows data to be imported from external data sources. The current implementation allows you to run a command whose standard output may be included in your jsonnet component code. The reference page has more details. At this point, the
expandHelmTemplate
native function should be considered deprecated and will be removed in a future release. There is nothing that this function could do that cannot be accomplished using an external data source. -
A new command
qbec eval
can now evaluate a single jsonnet file similar tojsonnet eval
. This can also be run in the context of a qbec environment to be able to access environment specific properties. Seeqbec eval --help
for more details. This deprecates thejsonnet-qbec
executable that is packaged in the release. This executable may no longer be packaged in a future release. -
qbec now allows computed variables to be defined in qbec.yaml. This works especially well with external data sources and also allow you to cache complex calculations. The reference page for qbec.yaml has more details.
-
Environment files for a qbec environment may now be specified as a glob pattern. qbec will load all matching files in sorted alphabetical order.
-
Miscellaneous improvements and optimizations for jsonnet evaluation. Most users, unless they are generating hundreds of objects or using complex jsonnet libraries will not see any significant performance improvements.
-
Preprocessors introduced in
v0.13.4
have now been removed. These had awkward semantics and were honestly not ready for prime-time. No one was probably using this. The replacement functionality is more general and allows you to define computed vaiables in qbec.yaml. -
Qbec no longer sets the
qbec.io/component
variable when evaluating components. This was also introduced inv0.13.4
and had dodgy semantics. There is no replacement for this functionality. If you started using this and are now stuck, please raise an issue where we can discuss this.
Note: some of the features in this release have been removed in v0.14.0
. Please refer to those release
notes as well.
a.k.a the "scale" release. This release mainly contains enhancements that allow qbec to be used at scale on large monorepos and/ or when deploying to tens of clusters.
This release has no backwards-incompatible changes.
- update the glob importer to support
**
patterns. Glob references are now matched using the doublestar library - Add a native function
labelsMatchSelector
to expose K8s label matching in jsonnet code - Allow
componentsDir
to be a glob as opposed to a single directory. This change makes qbec load components from potentially multiple directories but does not introduce any namespace semantics. Components must still be uniquely named across all such directories. It is only useful for compartmentalizing files in a monorepo where different directories have different code owners. - Add support for pre-processors. A pre-processor is some jsonnet code that is evaluated before any components is.
The return value of every such preprocessor is set as the external code variable called
computed.qbec.io/<base-name>
where<base-name>
is the base name of the preprocessor file without its extension. This variable is available for use in component code. This allows for caching values that are costly to compute. - qbec now sets the
qbec.io/component
external variable when it evaluates components, pre- and post-processors. This may be used in component code to key into a params object, for example. For pre- and post-processors, the component name is set to<pre|post>processor.qbec.io/<base-name>
where<base-name>
has the same semantics as described above. - Allow multiple pre- and post-processors. The qbec.yaml attributes,
preProcessor
andpostProcessor
although singular, can be set to a list of files separated by:
. Attribute names will be fixed to be in plural form and accept an array of strings in a future, backwards-incompatible release.
- Add ability to add the component name as a label in addition to the existing annotation. This is opt-in and is activated
by setting the
addComponentLabel
property totrue
in qbec.yaml (thanks @korroot and @hudymi).
- Allow force options to be set via environment variables (thanks @splkforrest)
- Fix a bug where the
alpha fmt
command would stop processing arguments after encountering a directory.
- Misc. CI build changes
- Update jsonnet library to
v0.17.0
and k8s client libs tov1.17.13
- Add json formatter to the
qbec alpha fmt
command - Fix diff commands to show skipped updates and deletes based on qbec directives specified for existing objects. This will no longer show spurious diffs for deletes and updates if those have been turned off.
- Use per-namespace queries by default when multiple namespaces are present, allow using cluster-scoped queries using an opt-in flag.
- The
--env-file
option now allows http(s) URLs in addition to local files. In addition, theenvFiles
attribute inqbec.yaml
can also contain http(s) URLs. (thanks @dan1) - String data in secrets is now obfuscated in addition to binary data
This release is incompatible from previous minor versions in the following ways:
qbec apply
will now wait on all objects by default. That is, the--wait-all
now defaults totrue
. To get the previous behavior, you need to add--wait-all=false
to theapply
command.qbec diff
now exits 0 by default even when diffs are found. To restore previous behavior, add--error-exit
to the command.- qbec now defaults to per-namespace queries when multiple namespaces are present. To get the previous behavior
of using cluster-scoped queries add
clusterScopedLists: true
underspec
inqbec.yaml
- The command line syntax of the
qbec alpha fmt
command has changed in incompatible ways. Instead of options like--jsonnet
,--yaml
etc. you need to specify options as--type=jsonnet
,--type=yaml
and so on. - YAML formatter now follows
prettier
conventions requiring arrays to be indented under the parent key. - Any corner-case behavior from updating k8s client and jsonnet libraries.
- Add a new
wait-policy
directive to disable waits on specific deployments and daemonsets. The annotation"directives.qbec.io/wait-policy": "never"
will cause qbec to not wait on the deployment even if it has changed.
- Add
--wait-all
flag to theapply
command to wait on all objects instead of just the ones that were changed in the current run.
- Add ability to import a bag of files using a glob pattern (see #153 for details). At this point this should be considered experimental. Do not rely on it yet until the next release when we will have docs for it.
- Add windows build in CI, thanks to @harsimranmaan
- Fix a bug where under certain circumstances of failed discovery, qbec would delete resources not meant to be deleted. Thanks to @sj14 for the bug report and partial fix.
- Add a warning when remote listing for GC switches to cluster scoped mode with a reason as to why this is happening. These are typically setup errors by authors who want to deploy to a single namespace.
- Fix pluralization for more kinds when using the kind filter
- Create and run basic integration tests for qbec against a local kind cluster
- Add an
error-exit
option to thediff
command to be able to exit 0 even when diffs are present. This currently has atrue
default for backwards compatibility. The next minor release of qbec will flip this default tofalse
. - Improve error message when object processing fails due to bad json created by a component. Thanks to @wurbanski for this contribution.
There are no backwards-incompatible changes in this release. The minor version upgrade is to account for any inadvertent incompatibilities introduced by the jsonnet library upgrade.
- Add
alpha fmt
command to format jsonnet/ libsonnet files and, optionally, yaml files (thanks to @harsimranmaan). This also has facilities to only check if all files are well-formatted. Typeqbec alpha fmt --help
for details.
- Fix regression in previous release where
LD_FLAGS
were not set correctly causing qbec to report a wrong version.
Please avoid using v0.11.1
as a result.
- Add ability to refer to an environment by context name rather than server URL. This is useful for environments
such as
minikube
andkind
that do not have a stable URL. Since this requires a shared context name, it should be used sparingly. - Add ability to introduce an environment file not declared in qbec.yaml. This is controlled by the
--env-file
parameter to qbec commands. Environments in this additional file will override environments of the same name if they already exist. - Add ability to force namespace to the current value in the kubeconfig using the keywork
__current__
. This can only be done only if the context is also similarly forced. - Reduce verbosity of
apply
output. By default, dry-run works as before and actual apply only shows a single line per object added/ updated/ deleted. This behavior can be explicitly controlled by the--show-details
flag for the apply command.
There are no backwards-incompatible changes in this release. The minor version upgrade is to account for any inadvertent incompatibilities introduced by the jsonnet library upgrade.
- Fix a bug with namespace forced on the command line not being used in every place that it should have, especially
when setting the
qbec.io/defaultNs
external variable. - Upgrade jsonnet to v0.15.0
- change alogirthm of merging environment properties with base properties to not use a merge patch. This means that
null
s in property values will be retained.
- no code changes in this release. This version will be the first to be published as a brew tap thanks to @harsimranmaan and @aaqel-s
- when returning environment properties introduced in the previous release, first apply a JSON merge-patch on to base properties before returning it.
- Provide the ability to load environment definitions from external files in addition to defining them inline.
- Add the ability to associate a properties object with every environment and also define baseline properties.
These are exposed as the
qbec.io/envProperties
external variable.
The test app under examples
demonstrates both of these features.
- Internal build improvements: add code coverage (thanks @harsimranmaan)
Fix a regression in the metadata check introduced in v0.10.0. Nil maps for annotations and labels were being reported as an error, when they shouldn't have.
- better support for custom types that are created lazily, for example, by an operator.
- qbec now waits for custom types to be available in discovery for up to 2 minutes before applying their instances.
- support for annotations to control qbec processing. This includes the ability to lock objects for updates and deletes, and to specify a custom apply order for objects. This includes standard rules to ensure that the default and system namespaces are never deleted.
- various internal CI and release process fixes (thanks @harsimranmaan)
Backward incompatibilities:
qbec now checks every object to ensure that their labels and annotations have values that are strictly strings. Previously metadata having non-string values were dropped in their entirety.
- allow for component subdirectories at one level of nesting. A subdirectory directly under the components directory
is treated as a multi-file component if it has an
index.jsonnet
file (which is the file loaded for the component), or anindex.yaml
file (in which case all JSON and YAML files in the directory are loaded). - add
--force:*
options to be able to override K8s context and namespace from command line (thanks @abhide). This allows for new use-cases like in-cluster applies.qbec options
shows the available options and special values. Note that using these options suppresses qbec safety checks. Use with care. - add
QBEC_YES
environment variable as default for the--yes
option. Provide better messages when a non-interactive build needs confirmation (thanks @harsimranmaan) - update
client-go
version tokubernetes-1.15.5
. Add client-go version to the list of versions displayed by theqbec version
command. - various internal CI improvements (thanks @harsimranmaan)
- github actions workflow for builds
- release workflow for tags
- break build on
gofmt
failures
Backward incompatibilities:
- If you previously had a component subdirectory that has an
index.jsonnet
orindex.yaml
file, qbec will now treat it as a component. Rename these files to restore previous behavior. - client-go upgrade has the potential to be backwards-incompatible for edge cases.
- update jsonnet version to v0.14.0
- add initial version of bash completion command (thanks @e-zhang)
- add qbec logo (thanks @kvaps)
- minor bug fixes
There are no backwards-incompatible changes in this release. The minor version upgrade is to account for any unintentional backward incompatibilities caused by the jsonnet library upgrade.
- Fixes #51 by aligning the patch logic between qbec and kubectl more closely.
- Fix a bug (#33) where the original object for patches was using the live server object when it was not supposed to
- Add kubectl's last applied annotation as a source for the original object when qbec annotation not found
- allow user to define a jsonnet post-processor in
qbec.yaml
that is provided with every object returned from evaliating jsonnet components and has the ability to decorate it, typically with additional annotations and labels. This allows common metadata to be set in one place. - add a
--clean
option to theshow
command that strips qbec metadata from the output. This reduces the noise when inspecting objects for debugging. Introduce a standard external variable calledqbec.io/cleanMode
that isoff
by default for all commands and only turnedon
for theshow --clean
command. - the above means that the post processor can use the value of the external variable to add annotations or not. This provides for a "real clean" experience.
- add a
--wait
option to theapply
command to automatically wait for deployments, daemonsets and statefulsets to be rolled out before the command exits.
- update
jsonnet
version tov0.13
- add
env list
andenv vars
command to enable arbitrary scripts to iterate over and get cluster information from qbec environments. - add support for transient objects
that do not have a name but have
generateName
set. Always create such objects and garbage collect the versions of the object created in previous runs.
safety feature: add duplicate checks to disallow more than one object with the same API group, kind, namespace and name.
These checks occur before any component or kind filtering and cannot be suppressed. To this end, this release may be backwards-incompatible if you already have duplicate objects in your component list.
- add global options to pass in a list of string var definitions from a file
- add
--silent
option to validate to suppress success/ unknown type messages
- enhance diffs to show content that will be added and removed rather than single lines that said 'object not on sever', 'object not present locally' etc.
- correctly configure the Kubernetes client such that auth plugins are supported. There are no features in this release.
- add support for declaring and defaulting jsonnet variables including TLAs
- add support for GC tag scope, expose more standard variables
- usability fix: ensure confirmation prompts for apply do not get obscured by background goroutine warnings
- additions to qbec spec, no backwards incompatible changes
- change how components are evaluated internally
- add EXPERIMENTAL support to expand helm templates
- initial release