From dbb824e7189d8545cde6ab296732df210ac4d543 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Sun, 23 Jul 2023 16:15:09 +0000 Subject: [PATCH] Add extra specs doc Signed-off-by: Gabriel Adrian Samfira --- doc/extra_specs.md | 8 ++++++++ go.mod | 2 +- go.sum | 4 ++-- .../cloudbase/garm-provider-common/cloudconfig/util.go | 1 + .../cloudbase/garm-provider-common/util/util.go | 2 +- vendor/modules.txt | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 doc/extra_specs.md diff --git a/doc/extra_specs.md b/doc/extra_specs.md new file mode 100644 index 00000000..8e55d11e --- /dev/null +++ b/doc/extra_specs.md @@ -0,0 +1,8 @@ +# ExtraSpecs + +ExtraSpecs is an opaque raw json that gets sent to the provider as part of the bootstrap params for instances. It can contain any kind of data needed by providers. The contents of this field means nothing to garm itself. We don't act on the information in this field at all. We only validate that it's a proper json. + +However, during the installation phase of the runners, GARM providers can leverage the information set in this field to augment the process in many ways. This can be used for anything rangin from overriding provider config values, to supplying a different runner install template, to passing in information that is relevant only to specific providers. + +For example, the [external OpenStack provider](https://github.com/cloudbase/garm-provider-openstack) uses this to [override](https://github.com/cloudbase/garm-provider-openstack#tweaking-the-provider) things like `security groups`, `storage backends`, `network ids`, etc. + diff --git a/go.mod b/go.mod index 86309ab5..8a0524a1 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/BurntSushi/toml v1.2.1 - github.com/cloudbase/garm-provider-common v0.0.0-20230723154741-c0a12146e69e + github.com/cloudbase/garm-provider-common v0.0.0-20230723165408-5d5ccbe7637e github.com/go-openapi/errors v0.20.4 github.com/go-openapi/runtime v0.26.0 github.com/go-openapi/strfmt v0.21.7 diff --git a/go.sum b/go.sum index 78c84f09..433711ef 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudbase/garm-provider-common v0.0.0-20230723154741-c0a12146e69e h1:a0vWKKqUKEGs4jiXw/RSZ72AkbyBwPscU49IeTMMSQY= -github.com/cloudbase/garm-provider-common v0.0.0-20230723154741-c0a12146e69e/go.mod h1:RKzgL0MXkNeGfloQpE2swz/y4LWJr5+2Wd45bSXPB0k= +github.com/cloudbase/garm-provider-common v0.0.0-20230723165408-5d5ccbe7637e h1:AHNNe59or9d67WF5muZrifFTIf3NGohzNCER1mjY8co= +github.com/cloudbase/garm-provider-common v0.0.0-20230723165408-5d5ccbe7637e/go.mod h1:RKzgL0MXkNeGfloQpE2swz/y4LWJr5+2Wd45bSXPB0k= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= diff --git a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go index 8916a855..0e75a9e4 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go +++ b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" ) +// CloudConfigSpec is a struct that holds extra specs that can be used to customize user data. type CloudConfigSpec struct { // RunnerInstallTemplate can be used to override the default runner install template. // If used, the caller is responsible for the correctness of the template as well as the diff --git a/vendor/github.com/cloudbase/garm-provider-common/util/util.go b/vendor/github.com/cloudbase/garm-provider-common/util/util.go index eca4d4ae..1f9e9415 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/util/util.go +++ b/vendor/github.com/cloudbase/garm-provider-common/util/util.go @@ -1,4 +1,4 @@ -// Copyright 2022 Cloudbase Solutions SRL +// Copyright 2023 Cloudbase Solutions SRL // // Licensed under the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain diff --git a/vendor/modules.txt b/vendor/modules.txt index be9a7472..fe6fe009 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -34,7 +34,7 @@ github.com/cespare/xxhash/v2 # github.com/chzyer/readline v1.5.1 ## explicit; go 1.15 github.com/chzyer/readline -# github.com/cloudbase/garm-provider-common v0.0.0-20230723154741-c0a12146e69e +# github.com/cloudbase/garm-provider-common v0.0.0-20230723165408-5d5ccbe7637e ## explicit; go 1.20 github.com/cloudbase/garm-provider-common/cloudconfig github.com/cloudbase/garm-provider-common/defaults