Skip to content

Commit

Permalink
style: use correct capitalization for openstack
Browse files Browse the repository at this point in the history
The current form of OpenStack is not capitalized correctly. Stack should
be written with a large S, like OpenStack and not Openstack.

Signed-off-by: Birger J. Nordølum <contact@mindtooth.no>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
MindTooth authored and smira committed Apr 29, 2024
1 parent 4c0c626 commit 5aa0299
Show file tree
Hide file tree
Showing 21 changed files with 205 additions and 205 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ image-%: ## Builds the specified image. Valid options are aws, azure, digital-oc

images-essential: image-aws image-azure image-gcp image-metal secureboot-installer ## Builds only essential images used in the CI (AWS, GCP, and Metal).

images: image-akamai image-aws image-azure image-digital-ocean image-exoscale image-gcp image-hcloud image-iso image-metal image-nocloud image-opennebula image-openstack image-oracle image-scaleway image-upcloud image-vmware image-vultr ## Builds all known images (AWS, Azure, DigitalOcean, Exoscale, GCP, HCloud, Metal, NoCloud, OpenNebula, Openstack, Oracle, Scaleway, UpCloud, Vultr and VMware).
images: image-akamai image-aws image-azure image-digital-ocean image-exoscale image-gcp image-hcloud image-iso image-metal image-nocloud image-opennebula image-openstack image-oracle image-scaleway image-upcloud image-vmware image-vultr ## Builds all known images (AWS, Azure, DigitalOcean, Exoscale, GCP, HCloud, Metal, NoCloud, OpenNebula, OpenStack, Oracle, Scaleway, UpCloud, Vultr and VMware).

.PHONY: iso
iso: image-iso ## Builds the ISO and outputs it to the artifact directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const (

endpoint = "http://169.254.169.254/"

// OpenstackExternalIPEndpoint is the local Openstack endpoint for the external IP.
OpenstackExternalIPEndpoint = endpoint + "latest/meta-data/public-ipv4"
// OpenstackInstanceTypeEndpoint is the local Openstack endpoint for the instance-type.
OpenstackInstanceTypeEndpoint = endpoint + "latest/meta-data/instance-type"
// OpenstackMetaDataEndpoint is the local Openstack endpoint for the meta config.
OpenstackMetaDataEndpoint = endpoint + configMetadataPath
// OpenstackNetworkDataEndpoint is the local Openstack endpoint for the network config.
OpenstackNetworkDataEndpoint = endpoint + configNetworkDataPath
// OpenstackUserDataEndpoint is the local Openstack endpoint for the config.
OpenstackUserDataEndpoint = endpoint + configUserDataPath
// OpenStackExternalIPEndpoint is the local OpenStack endpoint for the external IP.
OpenStackExternalIPEndpoint = endpoint + "latest/meta-data/public-ipv4"
// OpenStackInstanceTypeEndpoint is the local OpenStack endpoint for the instance-type.
OpenStackInstanceTypeEndpoint = endpoint + "latest/meta-data/instance-type"
// OpenStackMetaDataEndpoint is the local OpenStack endpoint for the meta config.
OpenStackMetaDataEndpoint = endpoint + configMetadataPath
// OpenStackNetworkDataEndpoint is the local OpenStack endpoint for the network config.
OpenStackNetworkDataEndpoint = endpoint + configNetworkDataPath
// OpenStackUserDataEndpoint is the local OpenStack endpoint for the config.
OpenStackUserDataEndpoint = endpoint + configUserDataPath
)

// NetworkConfig holds NetworkData config.
Expand Down Expand Up @@ -86,32 +86,32 @@ type MetadataConfig struct {
InstanceType string `json:"instance_type"`
}

func (o *Openstack) configFromNetwork(ctx context.Context) (metaConfig []byte, networkConfig []byte, machineConfig []byte, err error) {
log.Printf("fetching meta config from: %q", OpenstackMetaDataEndpoint)
func (o *OpenStack) configFromNetwork(ctx context.Context) (metaConfig []byte, networkConfig []byte, machineConfig []byte, err error) {
log.Printf("fetching meta config from: %q", OpenStackMetaDataEndpoint)

metaConfig, err = download.Download(ctx, OpenstackMetaDataEndpoint)
metaConfig, err = download.Download(ctx, OpenStackMetaDataEndpoint)
if err != nil {
metaConfig = nil
}

log.Printf("fetching network config from: %q", OpenstackNetworkDataEndpoint)
log.Printf("fetching network config from: %q", OpenStackNetworkDataEndpoint)

networkConfig, err = download.Download(ctx, OpenstackNetworkDataEndpoint)
networkConfig, err = download.Download(ctx, OpenStackNetworkDataEndpoint)
if err != nil {
networkConfig = nil
}

log.Printf("fetching machine config from: %q", OpenstackUserDataEndpoint)
log.Printf("fetching machine config from: %q", OpenStackUserDataEndpoint)

machineConfig, err = download.Download(ctx, OpenstackUserDataEndpoint,
machineConfig, err = download.Download(ctx, OpenStackUserDataEndpoint,
download.WithErrorOnNotFound(errors.ErrNoConfigSource),
download.WithErrorOnEmptyResponse(errors.ErrNoConfigSource))

return metaConfig, networkConfig, machineConfig, err
}

//nolint:gocyclo
func (o *Openstack) configFromCD(ctx context.Context, r state.State) (metaConfig []byte, networkConfig []byte, machineConfig []byte, err error) {
func (o *OpenStack) configFromCD(ctx context.Context, r state.State) (metaConfig []byte, networkConfig []byte, machineConfig []byte, err error) {
if err := netutils.WaitForDevicesReady(ctx, r); err != nil {
return nil, nil, nil, fmt.Errorf("failed to wait for devices: %w", err)
}
Expand Down Expand Up @@ -175,21 +175,21 @@ func (o *Openstack) configFromCD(ctx context.Context, r state.State) (metaConfig
return metaConfig, networkConfig, machineConfig, nil
}

func (o *Openstack) instanceType(ctx context.Context) string {
log.Printf("fetching instance-type from: %q", OpenstackInstanceTypeEndpoint)
func (o *OpenStack) instanceType(ctx context.Context) string {
log.Printf("fetching instance-type from: %q", OpenStackInstanceTypeEndpoint)

sku, err := download.Download(ctx, OpenstackInstanceTypeEndpoint)
sku, err := download.Download(ctx, OpenStackInstanceTypeEndpoint)
if err != nil {
return ""
}

return string(sku)
}

func (o *Openstack) externalIPs(ctx context.Context) (addrs []netip.Addr) {
log.Printf("fetching externalIP from: %q", OpenstackExternalIPEndpoint)
func (o *OpenStack) externalIPs(ctx context.Context) (addrs []netip.Addr) {
log.Printf("fetching externalIP from: %q", OpenStackExternalIPEndpoint)

exIP, err := download.Download(ctx, OpenstackExternalIPEndpoint,
exIP, err := download.Download(ctx, OpenStackExternalIPEndpoint,
download.WithErrorOnNotFound(errors.ErrNoExternalIPs),
download.WithErrorOnEmptyResponse(errors.ErrNoExternalIPs))
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Package openstack provides the Openstack platform implementation.
// Package openstack provides the OpenStack platform implementation.
package openstack

import (
Expand Down Expand Up @@ -30,18 +30,18 @@ import (
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)

// Openstack is the concrete type that implements the runtime.Platform interface.
type Openstack struct{}
// OpenStack is the concrete type that implements the runtime.Platform interface.
type OpenStack struct{}

// Name implements the runtime.Platform interface.
func (o *Openstack) Name() string {
func (o *OpenStack) Name() string {
return "openstack"
}

// ParseMetadata converts OpenStack metadata to platform network configuration.
//
//nolint:gocyclo,cyclop
func (o *Openstack) ParseMetadata(
func (o *OpenStack) ParseMetadata(
ctx context.Context,
unmarshalledNetworkConfig *NetworkConfig,
extIPs []netip.Addr,
Expand Down Expand Up @@ -350,7 +350,7 @@ func (o *Openstack) ParseMetadata(
}

// Configuration implements the runtime.Platform interface.
func (o *Openstack) Configuration(ctx context.Context, r state.State) (machineConfig []byte, err error) {
func (o *OpenStack) Configuration(ctx context.Context, r state.State) (machineConfig []byte, err error) {
_, _, machineConfig, err = o.configFromCD(ctx, r)
if err != nil {
if err = netutils.Wait(ctx, r); err != nil {
Expand All @@ -373,20 +373,20 @@ func (o *Openstack) Configuration(ctx context.Context, r state.State) (machineCo
}

// Mode implements the runtime.Platform interface.
func (o *Openstack) Mode() runtime.Mode {
func (o *OpenStack) Mode() runtime.Mode {
return runtime.ModeCloud
}

// KernelArgs implements the runtime.Platform interface.
func (o *Openstack) KernelArgs(string) procfs.Parameters {
func (o *OpenStack) KernelArgs(string) procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

// NetworkConfiguration implements the runtime.Platform interface.
func (o *Openstack) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error {
func (o *OpenStack) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error {
networkSource := false

metadataConfigDl, metadataNetworkConfigDl, _, err := o.configFromCD(ctx, st)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var rawNetwork []byte
var expectedNetworkConfig string

func TestParseMetadata(t *testing.T) {
o := &openstack.Openstack{}
o := &openstack.OpenStack{}

var metadata openstack.MetadataConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func newPlatform(platform string) (p runtime.Platform, err error) {
case "opennebula":
p = &opennebula.OpenNebula{}
case "openstack":
p = &openstack.Openstack{}
p = &openstack.OpenStack{}
case "oracle":
p = &oracle.Oracle{}
case "nocloud":
Expand Down
20 changes: 10 additions & 10 deletions website/content/v0.10/cloud-platforms/openstack.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: "Openstack"
description: "Creating a cluster via the CLI on Openstack."
title: "OpenStack"
description: "Creating a cluster via the CLI on OpenStack."
---

## Creating a Cluster via the CLI

In this guide, we will create an HA Kubernetes cluster in Openstack with 1 worker node.
We will assume an existing some familiarity with Openstack.
If you need more information on Openstack specifics, please see the [official Openstack documentation](https://docs.openstack.org).
In this guide, we will create an HA Kubernetes cluster in OpenStack with 1 worker node.
We will assume an existing some familiarity with OpenStack.
If you need more information on OpenStack specifics, please see the [official OpenStack documentation](https://docs.openstack.org).

### Environment Setup

You should have an existing openrc file.
This file will provide environment variables necessary to talk to your Openstack cloud.
This file will provide environment variables necessary to talk to your OpenStack cloud.
See [here](https://docs.openstack.org/newton/user-guide/common/cli-set-environment-variables-using-openstack-rc.html) for instructions on fetching this file.

### Create the Image

First, download the Openstack image from a Talos [release](https://github.com/talos-systems/talos/releases).
First, download the OpenStack image from a Talos [release](https://github.com/talos-systems/talos/releases).
These images are called `openstack-$ARCH.tar.gz`.
Untar this file with `tar -xvf openstack-$ARCH.tar.gz`.
The resulting file will be called `disk.raw`.

#### Upload the Image

Once you have the image, you can upload to Openstack with:
Once you have the image, you can upload to OpenStack with:

```bash
openstack image create --public --disk-format raw --file disk.raw talos
Expand Down Expand Up @@ -79,7 +79,7 @@ openstack loadbalancer member create --subnet-id shared-subnet --address <PRIVAT

#### Security Groups

This example uses the default security group in Openstack.
This example uses the default security group in OpenStack.
Ports have been opened to ensure that connectivity from both inside and outside the group is possible.
You will want to allow, at a minimum, ports 6443 (Kubernetes API server) and 50000 (Talos API) from external sources.
It is also recommended to allow communication over all ports from within the subnet.
Expand All @@ -98,7 +98,7 @@ Additionally, you can specify `--config-patch` with RFC6902 jsonpatch which will

### Compute Creation

We are now ready to create our Openstack nodes.
We are now ready to create our OpenStack nodes.

Create control plane:

Expand Down
20 changes: 10 additions & 10 deletions website/content/v0.11/cloud-platforms/openstack.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: "Openstack"
description: "Creating a cluster via the CLI on Openstack."
title: "OpenStack"
description: "Creating a cluster via the CLI on OpenStack."
---

## Creating a Cluster via the CLI

In this guide, we will create an HA Kubernetes cluster in Openstack with 1 worker node.
We will assume an existing some familiarity with Openstack.
If you need more information on Openstack specifics, please see the [official Openstack documentation](https://docs.openstack.org).
In this guide, we will create an HA Kubernetes cluster in OpenStack with 1 worker node.
We will assume an existing some familiarity with OpenStack.
If you need more information on OpenStack specifics, please see the [official OpenStack documentation](https://docs.openstack.org).

### Environment Setup

You should have an existing openrc file.
This file will provide environment variables necessary to talk to your Openstack cloud.
This file will provide environment variables necessary to talk to your OpenStack cloud.
See [here](https://docs.openstack.org/newton/user-guide/common/cli-set-environment-variables-using-openstack-rc.html) for instructions on fetching this file.

### Create the Image

First, download the Openstack image from a Talos [release](https://github.com/talos-systems/talos/releases).
First, download the OpenStack image from a Talos [release](https://github.com/talos-systems/talos/releases).
These images are called `openstack-$ARCH.tar.gz`.
Untar this file with `tar -xvf openstack-$ARCH.tar.gz`.
The resulting file will be called `disk.raw`.

#### Upload the Image

Once you have the image, you can upload to Openstack with:
Once you have the image, you can upload to OpenStack with:

```bash
openstack image create --public --disk-format raw --file disk.raw talos
Expand Down Expand Up @@ -79,7 +79,7 @@ openstack loadbalancer member create --subnet-id shared-subnet --address <PRIVAT

#### Security Groups

This example uses the default security group in Openstack.
This example uses the default security group in OpenStack.
Ports have been opened to ensure that connectivity from both inside and outside the group is possible.
You will want to allow, at a minimum, ports 6443 (Kubernetes API server) and 50000 (Talos API) from external sources.
It is also recommended to allow communication over all ports from within the subnet.
Expand All @@ -98,7 +98,7 @@ Additionally, you can specify `--config-patch` with RFC6902 jsonpatch which will

### Compute Creation

We are now ready to create our Openstack nodes.
We are now ready to create our OpenStack nodes.

Create control plane:

Expand Down
20 changes: 10 additions & 10 deletions website/content/v0.12/cloud-platforms/openstack.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: "Openstack"
description: "Creating a cluster via the CLI on Openstack."
title: "OpenStack"
description: "Creating a cluster via the CLI on OpenStack."
---

## Creating a Cluster via the CLI

In this guide, we will create an HA Kubernetes cluster in Openstack with 1 worker node.
We will assume an existing some familiarity with Openstack.
If you need more information on Openstack specifics, please see the [official Openstack documentation](https://docs.openstack.org).
In this guide, we will create an HA Kubernetes cluster in OpenStack with 1 worker node.
We will assume an existing some familiarity with OpenStack.
If you need more information on OpenStack specifics, please see the [official OpenStack documentation](https://docs.openstack.org).

### Environment Setup

You should have an existing openrc file.
This file will provide environment variables necessary to talk to your Openstack cloud.
This file will provide environment variables necessary to talk to your OpenStack cloud.
See [here](https://docs.openstack.org/newton/user-guide/common/cli-set-environment-variables-using-openstack-rc.html) for instructions on fetching this file.

### Create the Image

First, download the Openstack image from a Talos [release](https://github.com/talos-systems/talos/releases).
First, download the OpenStack image from a Talos [release](https://github.com/talos-systems/talos/releases).
These images are called `openstack-$ARCH.tar.gz`.
Untar this file with `tar -xvf openstack-$ARCH.tar.gz`.
The resulting file will be called `disk.raw`.

#### Upload the Image

Once you have the image, you can upload to Openstack with:
Once you have the image, you can upload to OpenStack with:

```bash
openstack image create --public --disk-format raw --file disk.raw talos
Expand Down Expand Up @@ -79,7 +79,7 @@ openstack loadbalancer member create --subnet-id shared-subnet --address <PRIVAT

#### Security Groups

This example uses the default security group in Openstack.
This example uses the default security group in OpenStack.
Ports have been opened to ensure that connectivity from both inside and outside the group is possible.
You will want to allow, at a minimum, ports 6443 (Kubernetes API server) and 50000 (Talos API) from external sources.
It is also recommended to allow communication over all ports from within the subnet.
Expand All @@ -98,7 +98,7 @@ Additionally, you can specify `--config-patch` with RFC6902 jsonpatch which will

### Compute Creation

We are now ready to create our Openstack nodes.
We are now ready to create our OpenStack nodes.

Create control plane:

Expand Down
Loading

0 comments on commit 5aa0299

Please sign in to comment.