Documentation
¶
Index ¶
- func GenerateSchema(schemaType interface{}, url string) (string, error)
- type BundleSchema
- type GrubOptionsSchema
- type InstallSchema
- type KConfig
- type KubeVIPSchema
- type NoPowerManagement
- type OneOfModel
- type P2PAutoDisabled
- type P2PAutoEnabled
- type P2PNetworkExtended
- type P2PSchema
- type PowerManagement
- type PowerOffOnly
- type RebootOnly
- type RootSchema
- type UserSchema
- type VPN
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSchema ¶
GenerateSchema takes the given schema type and builds a JSON Schema out of it if a URL is passed it will also add it as the $schema key, which is useful when defining a version of a Root Schema which will be available online.
Types ¶
type BundleSchema ¶
type BundleSchema struct { DB string `json:"db_path,omitempty"` LocalFile bool `json:"local_file,omitempty"` Repository string `json:"repository,omitempty"` Rootfs string `json:"rootfs_path,omitempty"` Targets []string `json:"targets,omitempty"` }
BundleSchema represents the bundle block which can be used in different places of the Kairos configuration. It is used to reference a bundle and its confguration.
type GrubOptionsSchema ¶
type GrubOptionsSchema struct { DefaultFallback string `json:"default_fallback,omitempty" description:"Sets default fallback logic"` DefaultMenuEntry string `json:"default_menu_entry,omitempty" description:"Change GRUB menu entry"` ExtraActiveCmdline string `json:"extra_active_cmdline,omitempty" description:"Additional Kernel option cmdline to apply just for active"` ExtraCmdline string `json:"extra_cmdline,omitempty" description:"Additional Kernel option cmdline to apply"` ExtraPassiveCmdline string `json:"extra_passive_cmdline,omitempty" description:"Additional Kernel option cmdline to apply just for passive"` ExtraRecoveryCmdline string `json:"extra_recovery_cmdline,omitempty" description:"Set additional boot commands when booting into recovery"` NextEntry string `json:"next_entry,omitempty" description:"Set the next reboot entry."` SavedEntry string `json:"saved_entry,omitempty" description:"Set the default boot entry."` }
GrubOptionsSchema represents the grub options block which can be used in different places of the Kairos configuration. It is used to configure grub.
type InstallSchema ¶
type InstallSchema struct { Auto bool `json:"auto,omitempty" description:"Set to true when installing without Pairing"` BindMounts []string `json:"bind_mounts,omitempty"` Bundles []BundleSchema `json:"bundles,omitempty" description:"Add bundles in runtime"` Device string `` /* 142-byte string literal not displayed */ EphemeralMounts []string `json:"ephemeral_mounts,omitempty"` EncryptedPartitions []string `json:"encrypted_partitions,omitempty"` Env []interface{} `json:"env,omitempty"` GrubOptionsSchema `json:"grub_options,omitempty"` Image string `json:"image,omitempty" description:"Use a different container image for the installation"` PowerManagement SkipEncryptCopyPlugins bool `json:"skip_copy_kcrypt_plugin,omitempty"` // contains filtered or unexported fields }
InstallSchema represents the install block in the Kairos configuration. It is used to drive automatic installations without user interaction.
type KConfig ¶
type KConfig struct { Source string ValidationError error // contains filtered or unexported fields }
KConfig is used to parse and validate Kairos configuration files.
func NewConfigFromYAML ¶
NewConfigFromYAML is a constructor for KConfig instances. The source of the configuration is passed in YAML and if there are any issues unmarshaling it will return an error.
type KubeVIPSchema ¶
type KubeVIPSchema struct { EIP string `json:"eip,omitempty" example:"192.168.1.110"` ManifestURL string `json:"manifest_url,omitempty" description:"Specify a manifest URL for KubeVIP." default:""` Enable bool `json:"enable,omitempty" description:"Enables KubeVIP"` Interface bool `json:"interface,omitempty" description:"Specifies a KubeVIP Interface" example:"ens18"` // contains filtered or unexported fields }
KubeVIPSchema represents the kubevip block in the Kairos configuration. It sets the Elastic IP used in KubeVIP. Only valid with p2p.
type NoPowerManagement ¶
type NoPowerManagement struct { Reboot bool `json:"reboot,omitempty" const:"false" default:"false" description:"Reboot after installation"` Poweroff bool `json:"poweroff,omitempty" const:"false" default:"false" description:"Power off after installation"` }
NoPowerManagement is a meta structure used when the user does not define any power management options or when the user does not want to reboot or poweroff the machine.
type OneOfModel ¶
type OneOfModel interface {
JSONSchemaOneOf() []interface{}
}
The OneOfModel interface is only needed for the tests that check the new schemas contain all needed fields it can be removed once the new schema is the single source of truth.
type P2PAutoDisabled ¶
type P2PAutoDisabled struct { NetworkToken string `json:"network_token,omitempty" const:"" required:"true"` Auto struct { Enable bool `json:"enable" const:"false" required:"true"` Ha struct { Enable bool `json:"enable" const:"false"` } `json:"ha"` } `json:"auto"` }
P2PAutoDisabled is used to validate that when p2p.auto is disabled, then neither p2p.auto.ha not p2p.network_token can be set.
type P2PAutoEnabled ¶
type P2PAutoEnabled struct { NetworkToken string `` /* 141-byte string literal not displayed */ Auto struct { Enable bool `json:"enable,omitempty" const:"true"` Ha struct { Enable bool `json:"enable" const:"true"` MasterNodes int `` /* 167-byte string literal not displayed */ } `json:"ha"` } `json:"auto,omitempty"` }
P2PAutoEnabled is used to validate that when p2p.auto is set, p2p.network_token has to be set.
type P2PNetworkExtended ¶
type P2PNetworkExtended struct { }
P2PNetworkExtended is a meta structure to hold the different rules for managing the P2P network, which are not compatible between each other.
func (P2PNetworkExtended) JSONSchemaOneOf ¶
func (P2PNetworkExtended) JSONSchemaOneOf() []interface{}
JSONSchemaOneOf defines that different which are the different valid p2p network rules and states that one and only one of them needs to be validated for the entire schema to be valid.
type P2PSchema ¶
type P2PSchema struct { Role string `json:"role,omitempty" default:"none" enum:"[\"master\",\"worker\",\"none\"]"` NetworkID string `json:"network_id,omitempty" description:"User defined network-id. Can be used to have multiple clusters in the same network"` DNS bool `json:"dns,omitempty" description:"Enable embedded DNS See also: https://mudler.github.io/edgevpn/docs/concepts/overview/dns/"` DisableDHT bool `` /* 135-byte string literal not displayed */ P2PNetworkExtended VPN `json:"vpn,omitempty"` // contains filtered or unexported fields }
P2PSchema represents the P2P block in the Kairos configuration. It is used to enables and configure the p2p full-mesh functionalities.
type PowerManagement ¶
type PowerManagement struct { }
PowerManagement is a meta structure to hold the different rules for managing power, which are not compatible between each other.
func (PowerManagement) JSONSchemaOneOf ¶
func (PowerManagement) JSONSchemaOneOf() []interface{}
JSONSchemaOneOf defines that different which are the different valid power management rules and states that one and only one of them needs to be validated for the entire schema to be valid.
type PowerOffOnly ¶
type PowerOffOnly struct { Reboot bool `json:"reboot,omitempty" const:"false" default:"false" description:"Reboot after installation"` Poweroff bool `json:"poweroff,omitempty" const:"true" default:"false" required:"true" description:"Power off after installation"` }
PowerOffOnly is a meta structure used to enforce that when the poweroff option is set, the reboot option is not set.
type RebootOnly ¶
type RebootOnly struct { Reboot bool `json:"reboot,omitempty" const:"true" default:"false" required:"true" description:"Reboot after installation"` Poweroff bool `json:"poweroff,omitempty" const:"false" default:"false" description:"Power off after installation"` }
RebootOnly is a meta structure used to enforce that when the reboot option is set, the poweroff option is not set.
type RootSchema ¶
type RootSchema struct { Bundles []BundleSchema `json:"bundles,omitempty" description:"Add bundles in runtime"` ConfigURL string `json:"config_url,omitempty" description:"URL download configuration from."` Env []string `json:"env,omitempty"` FailOnBundleErrors bool `json:"fail_on_bundles_errors,omitempty"` GrubOptionsSchema `json:"grub_options,omitempty"` Install InstallSchema `json:"install,omitempty"` Options []interface{} `json:"options,omitempty" description:"Various options."` Users []UserSchema `json:"users,omitempty" minItems:"1" required:"true"` P2P P2PSchema `json:"p2p,omitempty"` // contains filtered or unexported fields }
RootSchema groups all the different schemas of the Kairos configuration together.
type UserSchema ¶
type UserSchema struct { Name string `json:"name,omitempty" pattern:"([a-z_][a-z0-9_]{0,30})" required:"true" example:"kairos"` Passwd string `json:"passwd,omitempty" example:"kairos"` LockPasswd bool `json:"lockPasswd,omitempty" example:"true"` Groups string `json:"groups,omitempty" example:"admin"` SSHAuthorizedKeys []string `json:"ssh_authorized_keys,omitempty" examples:"[\"github:USERNAME\",\"ssh-ed25519 AAAF00BA5\"]"` // contains filtered or unexported fields }
UserSchema represents the users block in the Kairos configuration. It allows the creation of users in the system.