Skip to content

Commit 816de29

Browse files
authored
NOJIRA: Remove SendAksInitData as it's obsolete. (#170)
Remove SendAksInitData as it's obsolete.
1 parent a349ee8 commit 816de29

File tree

9 files changed

+0
-315
lines changed

9 files changed

+0
-315
lines changed

internal/actions/send_aks_init_data_handler.go

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

internal/actions/send_aks_init_data_handler_test.go

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

internal/castai/client.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const (
2727
type CastAIClient interface {
2828
GetActions(ctx context.Context, k8sVersion string) ([]*ClusterAction, error)
2929
AckAction(ctx context.Context, actionID string, req *AckClusterActionRequest) error
30-
SendAKSInitData(ctx context.Context, req *AKSInitDataRequest) error
3130
SendLog(ctx context.Context, e *LogEntry) error
3231
}
3332

@@ -126,21 +125,6 @@ func createTLSConfig(ca string) (*tls.Config, error) {
126125
}, nil
127126
}
128127

129-
func (c *Client) SendAKSInitData(ctx context.Context, req *AKSInitDataRequest) error {
130-
resp, err := c.rest.R().
131-
SetBody(req).
132-
SetContext(ctx).
133-
Post(fmt.Sprintf("/v1/kubernetes/external-clusters/%s/aks-init-data", c.clusterID))
134-
if err != nil {
135-
return fmt.Errorf("sending aks init data: %w", err)
136-
}
137-
if resp.IsError() {
138-
return fmt.Errorf("sending aks init data: request error status_code=%d body=%s", resp.StatusCode(), resp.Body())
139-
}
140-
141-
return nil
142-
}
143-
144128
func (c *Client) SendLog(ctx context.Context, e *LogEntry) error {
145129
// Server expects fields values to be strings. If they're not it fails with BAD_REQUEST/400.
146130
// Alternatively we could use "google/protobuf/any.proto" on server side but ATM it doesn't work.

internal/castai/mock/client.go

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/castai/types.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type ClusterAction struct {
3434
ActionChartUninstall *ActionChartUninstall `json:"actionChartUninstall,omitempty"`
3535
ActionChartRollback *ActionChartRollback `json:"actionChartRollback,omitempty"`
3636
ActionDisconnectCluster *ActionDisconnectCluster `json:"actionDisconnectCluster,omitempty"`
37-
ActionSendAKSInitData *ActionSendAKSInitData `json:"actionSendAksInitData,omitempty"`
3837
ActionCheckNodeDeleted *ActionCheckNodeDeleted `json:"actionCheckNodeDeleted,omitempty"`
3938
ActionCheckNodeStatus *ActionCheckNodeStatus `json:"actionCheckNodeStatus,omitempty"`
4039
ActionEvictPod *ActionEvictPod `json:"actionEvictPod,omitempty"`
@@ -74,9 +73,6 @@ func (c *ClusterAction) Data() interface{} {
7473
if c.ActionDisconnectCluster != nil {
7574
return c.ActionDisconnectCluster
7675
}
77-
if c.ActionSendAKSInitData != nil {
78-
return c.ActionSendAKSInitData
79-
}
8076
if c.ActionCheckNodeDeleted != nil {
8177
return c.ActionCheckNodeDeleted
8278
}
@@ -189,8 +185,6 @@ type ActionCreateEvent struct {
189185

190186
type ActionDisconnectCluster struct{}
191187

192-
type ActionSendAKSInitData struct{}
193-
194188
type ActionCheckNodeDeleted struct {
195189
NodeName string `json:"nodeName"`
196190
NodeID string `json:"nodeId"`
@@ -250,9 +244,3 @@ func (c *ChartSource) Validate() error {
250244
}
251245
return nil
252246
}
253-
254-
type AKSInitDataRequest struct {
255-
CloudConfigBase64 string `json:"cloudConfigBase64"`
256-
ProtectedSettingsBase64 string `json:"protectedSettingsBase64"`
257-
Architecture string `json:"architecture"`
258-
}

internal/controller/controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func NewService(
6060
reflect.TypeOf(&castai.ActionChartUninstall{}): actions.NewChartUninstallHandler(log, helmClient),
6161
reflect.TypeOf(&castai.ActionChartRollback{}): actions.NewChartRollbackHandler(log, helmClient, cfg.Version),
6262
reflect.TypeOf(&castai.ActionDisconnectCluster{}): actions.NewDisconnectClusterHandler(log, clientset),
63-
reflect.TypeOf(&castai.ActionSendAKSInitData{}): actions.NewSendAKSInitDataHandler(log, castaiClient),
6463
reflect.TypeOf(&castai.ActionCheckNodeDeleted{}): actions.NewCheckNodeDeletedHandler(log, clientset),
6564
reflect.TypeOf(&castai.ActionCheckNodeStatus{}): actions.NewCheckNodeStatusHandler(log, clientset),
6665
reflect.TypeOf(&castai.ActionEvictPod{}): actions.NewEvictPodHandler(log, clientset),

internal/testdata/aks/CBD209E745FE4FC85066CBA305F32F9A1CFD89A3.prv

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

0 commit comments

Comments
 (0)