Fix default Airshipctl config parameters
Problems description: Once we execute airshipctl config init, the default config in ~/.airship/config doesn't contain default values for: currentContext: ~ clusters: default: clusterType: target: bootstrapInfo: ~ managementConfiguration: ~ --- This PS set default values for Airshipctl config to use it out of the box. Closes: #234 Change-Id: I57449e678f19ab1c0e2212c38b01ea195f62aa44
This commit is contained in:
parent
fc0b53d2b3
commit
84f2bc60c9
2
pkg/cluster/initinfra/testdata/config.yaml
vendored
2
pkg/cluster/initinfra/testdata/config.yaml
vendored
@ -3,7 +3,7 @@ bootstrapInfo:
|
||||
dummy_bootstrap_config:
|
||||
container:
|
||||
volume: /tmp/airship:/config
|
||||
image: quay.io/airshipit/isogen:latest
|
||||
image: quay.io/airshipit/isogen:latest-debian_stable
|
||||
containerRuntime: docker
|
||||
builder:
|
||||
userDataFileName: user-data
|
||||
|
@ -3,7 +3,7 @@ bootstrapInfo:
|
||||
dummy_bootstrap_config:
|
||||
container:
|
||||
volume: /tmp/airship:/config
|
||||
image: quay.io/airshipit/isogen:latest
|
||||
image: quay.io/airshipit/isogen:latest-debian_stable
|
||||
containerRuntime: docker
|
||||
builder:
|
||||
userDataFileName: user-data
|
||||
|
@ -188,8 +188,8 @@ func (c *Config) reconcileClusters() (map[string]string, bool) {
|
||||
}
|
||||
configCluster := c.Clusters[clusterComplexName.Name].ClusterTypes[clusterComplexName.Type]
|
||||
configCluster.NameInKubeconf = clusterComplexName.String()
|
||||
// TODO What do we do with the BOOTSTRAP CONFIG
|
||||
|
||||
configCluster.Bootstrap = AirshipDefaultBootstrapInfo
|
||||
configCluster.ManagementConfiguration = AirshipDefaultManagementConfiguration
|
||||
// Store the reference to the KubeConfig Cluster in the Airship Config
|
||||
configCluster.SetKubeCluster(cluster)
|
||||
}
|
||||
|
@ -36,22 +36,24 @@ var AllClusterTypes = [2]string{Ephemeral, Target}
|
||||
|
||||
// Constants defining default values
|
||||
const (
|
||||
AirshipConfigGroup = "airshipit.org"
|
||||
AirshipConfigVersion = "v1alpha1"
|
||||
AirshipConfigAPIVersion = AirshipConfigGroup + "/" + AirshipConfigVersion
|
||||
AirshipConfigKind = "Config"
|
||||
AirshipConfigDir = ".airship"
|
||||
AirshipConfig = "config"
|
||||
AirshipKubeConfig = "kubeconfig"
|
||||
AirshipConfigEnv = "AIRSHIPCONFIG"
|
||||
AirshipKubeConfigEnv = "AIRSHIP_KUBECONFIG"
|
||||
AirshipDefaultContext = "default"
|
||||
AirshipDefaultManifest = "default"
|
||||
AirshipDefaultManifestRepo = "treasuremap"
|
||||
AirshipDefaultManifestRepoLocation = "https://opendev.org/airship/" + AirshipDefaultManifestRepo
|
||||
AirshipConfig = "config"
|
||||
AirshipConfigAPIVersion = AirshipConfigGroup + "/" + AirshipConfigVersion
|
||||
AirshipConfigDir = ".airship"
|
||||
AirshipConfigEnv = "AIRSHIPCONFIG"
|
||||
AirshipConfigGroup = "airshipit.org"
|
||||
AirshipConfigKind = "Config"
|
||||
AirshipConfigVersion = "v1alpha1"
|
||||
AirshipDefaultBootstrapInfo = "default"
|
||||
AirshipDefaultContext = "default"
|
||||
AirshipDefaultManagementConfiguration = "default"
|
||||
AirshipDefaultManifest = "default"
|
||||
AirshipDefaultManifestRepo = "treasuremap"
|
||||
AirshipDefaultManifestRepoLocation = "https://opendev.org/airship/" + AirshipDefaultManifestRepo
|
||||
AirshipKubeConfig = "kubeconfig"
|
||||
AirshipKubeConfigEnv = "AIRSHIP_KUBECONFIG"
|
||||
|
||||
// Modules
|
||||
AirshipDefaultBootstrapImage = "quay.io/airshipit/isogen:latest"
|
||||
AirshipDefaultBootstrapImage = "quay.io/airshipit/isogen:latest-debian_stable"
|
||||
AirshipDefaultIsoURL = "http://localhost:8099/debian-custom.iso"
|
||||
AirshipDefaultRemoteType = redfish.ClientType
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ func NewConfig() *Config {
|
||||
Kind: AirshipConfigKind,
|
||||
APIVersion: AirshipConfigAPIVersion,
|
||||
BootstrapInfo: map[string]*Bootstrap{
|
||||
AirshipDefaultContext: {
|
||||
AirshipDefaultBootstrapInfo: {
|
||||
Container: &Container{
|
||||
Volume: "/srv/iso:/config",
|
||||
Image: AirshipDefaultBootstrapImage,
|
||||
@ -56,8 +56,9 @@ func NewConfig() *Config {
|
||||
Manifest: AirshipDefaultManifest,
|
||||
},
|
||||
},
|
||||
CurrentContext: AirshipDefaultContext,
|
||||
ManagementConfiguration: map[string]*ManagementConfiguration{
|
||||
AirshipDefaultContext: {
|
||||
AirshipDefaultManagementConfiguration: {
|
||||
Type: redfish.ClientType,
|
||||
Insecure: true,
|
||||
UseProxy: false,
|
||||
|
2
pkg/phase/apply/testdata/config.yaml
vendored
2
pkg/phase/apply/testdata/config.yaml
vendored
@ -3,7 +3,7 @@ bootstrapInfo:
|
||||
dummy_bootstrap_config:
|
||||
container:
|
||||
volume: /tmp/airship:/config
|
||||
image: quay.io/airshipit/isogen:latest
|
||||
image: quay.io/airshipit/isogen:latest-debian_stable
|
||||
containerRuntime: docker
|
||||
builder:
|
||||
userDataFileName: user-data
|
||||
|
@ -16,7 +16,7 @@ airship_config_manifest_directory: /tmp/airship
|
||||
airship_config_primary_repo_url: "https://review.opendev.org/airship/airshipctl"
|
||||
airship_config_primary_repo_branch: "master"
|
||||
airship_config_ephemeral_ip: "10.23.25.101"
|
||||
airship_config_iso_builder_docker_image: quay.io/airshipit/isogen:latest
|
||||
airship_config_iso_builder_docker_image: quay.io/airshipit/isogen:latest-debian_stable
|
||||
airship_config_iso_port: 8099
|
||||
airship_config_iso_serve_host: localhost
|
||||
airship_config_iso_name: debian-custom.iso
|
||||
|
2
testdata/k8s/config.yaml
vendored
2
testdata/k8s/config.yaml
vendored
@ -7,7 +7,7 @@ bootstrapInfo:
|
||||
userDataFileName: user-data
|
||||
container:
|
||||
containerRuntime: docker
|
||||
image: quay.io/airshipit/isogen:latest
|
||||
image: quay.io/airshipit/isogen:latest-debian_stable
|
||||
volume: /srv/iso:/config
|
||||
remoteDirect:
|
||||
isoUrl: http://localhost:8099/debian-custom.iso
|
||||
|
Loading…
Reference in New Issue
Block a user