Skip to content

Commit c68a6c3

Browse files
authored
[deprecation] Deprecate stackscript (#724)
* Deleted stackscript code * Updated linodemachine controller helpers * Updated linodemachine controller * Updated tests
1 parent 15be027 commit c68a6c3

15 files changed

+20
-506
lines changed

api/v1alpha2/linodemachine_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ type LinodeMachineStatus struct {
172172
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
173173

174174
// CloudinitMetadataSupport determines whether to use cloud-init or not.
175+
// Deprecated: Stackscript no longer in use, so this field is not used.
176+
// +kubebuilder:deprecatedversion:warning="CloudinitMetadataSupport is deprecated"
175177
// +optional
176178
// +kubebuilder:default=true
177179
CloudinitMetadataSupport bool `json:"cloudinitMetadataSupport,omitempty"`

clients/clients.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ type LinodeInstanceClient interface {
5353
DeleteInstance(ctx context.Context, linodeID int) error
5454
GetRegion(ctx context.Context, regionID string) (*linodego.Region, error)
5555
GetImage(ctx context.Context, imageID string) (*linodego.Image, error)
56-
CreateStackscript(ctx context.Context, opts linodego.StackscriptCreateOptions) (*linodego.Stackscript, error)
57-
ListStackscripts(ctx context.Context, opts *linodego.ListOptions) ([]linodego.Stackscript, error)
5856
GetType(ctx context.Context, typeID string) (*linodego.LinodeType, error)
5957
}
6058

cloud/services/stackscript.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

cloud/services/stackscripts.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

cloud/services/stackscripts_test.go

Lines changed: 0 additions & 115 deletions
This file was deleted.

config/crd/bases/infrastructure.cluster.x-k8s.io_linodemachines.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,9 @@ spec:
456456
type: array
457457
cloudinitMetadataSupport:
458458
default: true
459-
description: CloudinitMetadataSupport determines whether to use cloud-init
460-
or not.
459+
description: |-
460+
CloudinitMetadataSupport determines whether to use cloud-init or not.
461+
Deprecated: Stackscript no longer in use, so this field is not used.
461462
type: boolean
462463
conditions:
463464
description: Conditions defines current service state of the LinodeMachine.

docs/src/reference/out.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ _Appears in:_
638638
| --- | --- | --- | --- |
639639
| `ready` _boolean_ | Ready is true when the provider resource is ready. | false | |
640640
| `addresses` _MachineAddress array_ | Addresses contains the Linode instance associated addresses. | | |
641-
| `cloudinitMetadataSupport` _boolean_ | CloudinitMetadataSupport determines whether to use cloud-init or not. | true | |
641+
| `cloudinitMetadataSupport` _boolean_ | CloudinitMetadataSupport determines whether to use cloud-init or not.<br />Deprecated: Stackscript no longer in use, so this field is not used. | true | |
642642
| `instanceState` _[InstanceStatus](#instancestatus)_ | InstanceState is the state of the Linode instance for this machine. | | |
643643
| `failureReason` _string_ | FailureReason will be set in the event that there is a terminal problem<br />reconciling the Machine and will contain a succinct value suitable<br />for machine interpretation.<br /><br />This field should not be set for transitive errors that a controller<br />faces that are expected to be fixed automatically over<br />time (like service outages), but instead indicate that something is<br />fundamentally wrong with the Machine's spec or the configuration of<br />the controller, and that manual intervention is required. Examples<br />of terminal errors would be invalid combinations of settings in the<br />spec, values that are unsupported by the controller, or the<br />responsible controller itself being critically misconfigured.<br /><br />Any transient errors that occur during the reconciliation of Machines<br />can be added as events to the Machine object and/or logged in the<br />controller's output. | | |
644644
| `failureMessage` _string_ | FailureMessage will be set in the event that there is a terminal problem<br />reconciling the Machine and will contain a more verbose string suitable<br />for logging and human consumption.<br /><br />This field should not be set for transitive errors that a controller<br />faces that are expected to be fixed automatically over<br />time (like service outages), but instead indicate that something is<br />fundamentally wrong with the Machine's spec or the configuration of<br />the controller, and that manual intervention is required. Examples<br />of terminal errors would be invalid combinations of settings in the<br />spec, values that are unsupported by the controller, or the<br />responsible controller itself being critically misconfigured.<br /><br />Any transient errors that occur during the reconciliation of Machines<br />can be added as events to the Machine object and/or logged in the<br />controller's output. | | |

docs/src/topics/cluster-object-store.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,5 @@ infrastructure Linode via one of the following services:
103103
| Service | Bootstrap Data Limit |
104104
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
105105
| [Metadata](https://techdocs.akamai.com/cloud-computing/docs/overview-of-the-metadata-service) | [65535 bytes](https://techdocs.akamai.com/linode-api/reference/post-linode-instance) |
106-
| [Stackscripts](https://www.linode.com/products/stackscripts/) | [65,535 characters](https://techdocs.akamai.com/linode-api/reference/post-linode-instance) |
107106

108107
These data limits are bypassed when the Cluster Object Store feature is enabled.

docs/src/topics/getting-started.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Make sure to create the token with at least the following read/write permissions
1212
- VPCs
1313
- IPs
1414
- Object Storage
15-
- Stackscripts
1615
- Firewalls
1716
- clusterctl is [installed](https://cluster-api.sigs.k8s.io/user/quick-start#installation)
1817
- Cluster API [management cluster](https://cluster-api.sigs.k8s.io/user/quick-start#install-andor-configure-a-kubernetes-cluster) is created
@@ -40,11 +39,6 @@ This project uses [linodego](https://github.com/linode/linodego) for Linode API
4039
Please refer to it for more details on environment variables used for client configuration.
4140
```
4241

43-
```admonish warning
44-
For Regions and Images that do not yet support Akamai's cloud-init datasource CAPL will automatically use a stackscript shim
45-
to provision the node. If you are using a custom image ensure the [cloud_init](https://www.linode.com/docs/api/images/#image-create) flag is set correctly on it
46-
```
47-
4842
## Setup management cluster
4943
A clusterAPI management cluster is a kubernetes cluster that is responsible for managing the lifecycle of other child k8s clusters provisioned using Cluster API (CAPI). It serves as a control plane for provisioning, scaling, upgrading and deleting child kubernetes clusters.
5044

internal/controller/linodemachine_controller.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"errors"
2222
"fmt"
2323
"net/http"
24-
"slices"
2524
"strings"
2625
"time"
2726

@@ -530,27 +529,20 @@ func (r *LinodeMachineReconciler) reconcilePreflightLinodeFirewallCheck(ctx cont
530529
}
531530

532531
func (r *LinodeMachineReconciler) reconcilePreflightMetadataSupportConfigure(ctx context.Context, logger logr.Logger, machineScope *scope.MachineScope) (ctrl.Result, error) {
533-
region, err := machineScope.LinodeClient.GetRegion(ctx, machineScope.LinodeMachine.Spec.Region)
532+
_, err := machineScope.LinodeClient.GetRegion(ctx, machineScope.LinodeMachine.Spec.Region)
534533
if err != nil {
535534
logger.Error(err, fmt.Sprintf("Failed to fetch region %s", machineScope.LinodeMachine.Spec.Region))
536535
return retryIfTransient(err, logger)
537536
}
538-
regionMetadataSupport := slices.Contains(region.Capabilities, linodego.CapabilityMetadata)
539537
imageName := reconciler.DefaultMachineControllerLinodeImage
540538
if machineScope.LinodeMachine.Spec.Image != "" {
541539
imageName = machineScope.LinodeMachine.Spec.Image
542540
}
543-
image, err := machineScope.LinodeClient.GetImage(ctx, imageName)
541+
_, err = machineScope.LinodeClient.GetImage(ctx, imageName)
544542
if err != nil {
545543
logger.Error(err, fmt.Sprintf("Failed to fetch image %s", imageName))
546544
return retryIfTransient(err, logger)
547545
}
548-
imageMetadataSupport := slices.Contains(image.Capabilities, "cloud-init")
549-
machineScope.LinodeMachine.Status.CloudinitMetadataSupport = true
550-
if !imageMetadataSupport || !regionMetadataSupport {
551-
logger.Info("cloud-init metadata support not available", "imageMetadataSupport", imageMetadataSupport, "regionMetadataSupport", regionMetadataSupport)
552-
machineScope.LinodeMachine.Status.CloudinitMetadataSupport = false
553-
}
554546
conditions.Set(machineScope.LinodeMachine, metav1.Condition{
555547
Type: ConditionPreflightMetadataSupportConfigured,
556548
Status: metav1.ConditionTrue,

0 commit comments

Comments
 (0)