26 Commits

Author SHA1 Message Date
Dalton Hubble
95b18ba8b9 bootstrap/http: Format nested metadata in env file
* Serve /metadata including group metadata, selectors, and
query variables in KEY=value "env file" format lines
* Recurse into nested maps (e.g. OUTER_INNER=val)
2016-07-19 16:36:04 -07:00
Dalton Hubble
07751a4bba bootcfg/http: Add request query params to template variables
* Add query parameters to template variables, referenced by
 {{.request.query.param}}
* Render Ignition/Fuze, cloud-config, and generic templates and
metadata with collected variables
* Replace template variable {{.query}} with {{.request.raw_query}}
(breaking)
2016-07-19 16:25:01 -07:00
Dalton Hubble
c3645d22d3 CHANGES.md,README.md: Update changelog, links, and fix typos 2016-07-19 10:54:36 -07:00
Dalton Hubble
5575590393 bootcfg/http: Cleanup handler chains and source organization
* Simplify common http request handling chains
* Separate github.com/dghubble/ctxh source so we can move
it to a separate CoreOS package or vendor upstream
* Remove unused requireGET
2016-07-19 10:06:14 -07:00
Dalton Hubble
10cfa59970 bootcfg/http: Chain handlers with a simple chain func 2016-07-12 17:59:52 -07:00
Dalton Hubble
8404e34b9a bootcfg/http: Add structured info/debug logging
* Add info logs for errors matching machine groups
or resolving profiles, or supported templates
* Add debug logs with successful match info
2016-07-12 14:00:01 -07:00
Dalton Hubble
63e48160f6 bootcfg/http: Replace capnslog with logrus 2016-07-11 14:43:33 -07:00
Dalton Hubble
29f277f001 bootcfg/http: Replace store field with core Server
* Remove the bootcfg/http/server.Server store field
to enforce handlers use the core Server, not the Store
directly
2016-07-11 14:43:33 -07:00
Dalton Hubble
f2a89a6168 bootcfg/http: Convert logging handlers to methods
* Convert handlers which log to bootcfg/http/server.Server
methods to allow a Server instance scoped logger to be used
to replace the package logger
2016-07-11 14:43:33 -07:00
Dalton Hubble
62e0ec1976 bootcfg/http/ignition: Just warn for raw Ignition errors
* When raw Ignition (.ign/.ignition) content is provided, Parse
the contents with ignition, but return the contents as JSON
regardless of the result to respect user pass-through expectations
* Warn on parse errors which can occur if a newer Ignition format
is used than the version of Ignition that bootcfg was compiled
with
2016-07-05 10:46:32 -07:00
Dalton Hubble
235ebf6f62 bootcfg/http: Upgrade from Ignition v1 to 2.0.0 and Fuze
* By default, templates for Ignition are rendered and
parsed as github.com/coreos/fuze YAML configs, which
formalize the transform from YAML to Ignition JSON
* Ignition files (.ign/.ignition) should be validated and
served directly, without template rendering
* Remove support for Ignition v1
* This change is breaking! Users need to tweak any YAML
Ignition templates to the very similar Fuze YAML format
2016-07-05 10:46:32 -07:00
Curtis Gagliardi
7ef89e5f60 Add a newline to versionHandler output. 2016-06-24 13:48:08 -07:00
Adam Schaub
5bac35cc54 *: Add /generic docs and revert NetBoot protobuf id
* Revert NetBoot id in storage.proto for compatibility
* Add URL.RawQuery to data for generic templates
* Add generic directory to scripts/setup-data-dir
* Add documentation for generic templates.
2016-06-15 11:09:45 -07:00
Adam Schaub
95db4cba61 bootcfg/http: Added genericHandler + tests to the http server
genericHandler uses a Profile.GenericId to locate and render a "generic" go template using group metadata and selectors.

Partially addresses #224
2016-06-15 11:06:11 -07:00
Dalton Hubble
ba78c1291b bootcfg/http/server: Log requests for bootcfg assets 2016-05-26 14:14:47 -07:00
Dalton Hubble
3d27e7f051 bootcfg/http: Error for missing template metadata
* Rendering an Ignition config or cloud-config template
with machine group metadata will error and log if a metadata
value is missing.
* Previously, the default missing value was "no value"
2016-05-25 10:55:25 -07:00
Dalton Hubble
53a97f2d17 bootcfg/version: Don't show version at / path
* Stop showing version hash at / path. If bootcfg were deployed
at a public endpoint, the version could be used by attackers to
find out-of-date deployments.
2016-05-10 15:03:15 -07:00
Dalton Hubble
682bb72dde bootcfg/http: Allow Ignition 2.0.0 YAML
* Ignition 2.0.0 became available in CoreOS 1010.1.0
2016-05-05 14:59:15 -07:00
Dalton Hubble
d6e2d14560 bootcfg/http: Allow Ignition 2.0.0 JSON and arbitrary extensions
* Allow Ignition 2.0.0 JSON documents to be served
* Stop requiring Ignition templates to use file extensions to
specify their rendered format for parsing
2016-05-05 14:58:39 -07:00
Dalton Hubble
c2c29bb7ff examples/k8s: Remove k8s_version from machine metadata
* Setting k8s_version via metadata gives the impression
it can be bumped and the cluster will operate with the
desired version. In reality, the k8s profiles change in
minor but important ways which we validate between k8s
releases. It should be part of the k8s profile Ignition.
2016-05-03 15:54:46 -07:00
Dalton Hubble
3525abf84f bootcfg/version: Add version package and HTTP version output
* bootcfg/version package provides the linker's GIT SHA based
version to bootcfg components
* Display the bootcfg version via the HTTP server / path for
convenience and for validating a deployed version easily
* Log requests to the / rooted subtree paths to surface machines
which are making requests containing typos and mistakes that do
not match HTTP API endpoints
2016-04-26 18:21:59 -07:00
Dalton Hubble
f654879195 bootcfg/http: Fix http package log messages
* Package bootcfg/http logs show "api" which was the old
package name
2016-04-26 18:21:59 -07:00
Dalton Hubble
94ead0a1af bootcfg/http: Add selectors to template data
* Ignition and Cloud config templates can reference selector
key/value pairs by lowercase key name
* Metadata endpoint will provide metadata and selector key/val
pairs for the matching machine group
2016-04-12 16:51:44 -07:00
Dalton Hubble
0ffa17c12d Rename Group field requirements to selector
* Use label/selector terms for machine attribute labels and group
selectors requirements since it is familiar to many users
2016-04-12 13:32:46 -07:00
Dalton Hubble
9e5955e600 cmd/bootcfg: Allow bootcfg asset serving to be disabled
* Pass -assets-path="" to disable asset serving. Defaults to
/var/lib/bootcfg/assets.
2016-04-12 13:28:57 -07:00
Dalton Hubble
3e5115a6e0 bootcfg/: Rename and document packages with their purpose (#145) 2016-04-12 11:25:17 -07:00