From 1891ac26670c590d14ef2b152c9cdf23531b99c3 Mon Sep 17 00:00:00 2001 From: Paul Habfast Date: Wed, 4 Feb 2026 22:10:24 +0100 Subject: [PATCH 1/2] chore: update to latest egoscale and fix compilation issues --- cmd/dbaas/dbaas_create_mysql.go | 2 +- cmd/dbaas/dbaas_user_reset_mysql.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../github.com/exoscale/egoscale/v3/README.md | 61 ++++++++++++ .../github.com/exoscale/egoscale/v3/errors.go | 10 +- .../exoscale/egoscale/v3/operations.go | 94 ++++++++++++++++--- .../exoscale/egoscale/v3/schemas.go | 86 +++++++++++++++-- vendor/modules.txt | 2 +- 9 files changed, 236 insertions(+), 27 deletions(-) diff --git a/cmd/dbaas/dbaas_create_mysql.go b/cmd/dbaas/dbaas_create_mysql.go index c35401369..4dafb2005 100644 --- a/cmd/dbaas/dbaas_create_mysql.go +++ b/cmd/dbaas/dbaas_create_mysql.go @@ -45,7 +45,7 @@ func (c *dbaasServiceCreateCmd) createMysql(_ *cobra.Command, _ []string) error } if c.MysqlAdminPassword != "" { - databaseService.AdminPassword = c.MysqlAdminPassword + databaseService.AdminPassword = v3.DBAASMysqlUserPassword(c.MysqlAdminPassword) } if c.MysqlAdminUsername != "" { diff --git a/cmd/dbaas/dbaas_user_reset_mysql.go b/cmd/dbaas/dbaas_user_reset_mysql.go index f190a237f..1e032db81 100644 --- a/cmd/dbaas/dbaas_user_reset_mysql.go +++ b/cmd/dbaas/dbaas_user_reset_mysql.go @@ -22,7 +22,7 @@ func (c *dbaasUserResetCmd) resetMysql(cmd *cobra.Command, _ []string) error { req := v3.ResetDBAASMysqlUserPasswordRequest{} if c.Password != "" { - req.Password = v3.DBAASUserPassword(c.Password) + req.Password = v3.DBAASMysqlUserPassword(c.Password) } if c.MysqlAuthenticationMethod != "" { req.Authentication = v3.EnumMysqlAuthenticationPlugin(c.MysqlAuthenticationMethod) diff --git a/go.mod b/go.mod index 240b69ab4..e19511446 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 github.com/aws/smithy-go v1.1.0 github.com/dustin/go-humanize v1.0.1 - github.com/exoscale/egoscale/v3 v3.1.34-0.20260107090256-18aa51606080 + github.com/exoscale/egoscale/v3 v3.1.34-0.20260204205607-841b140c4adc github.com/exoscale/openapi-cli-generator v1.2.0 github.com/fatih/camelcase v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index 43576c3f1..db7cc833f 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/exoscale/egoscale/v3 v3.1.34-0.20260107090256-18aa51606080 h1:oQptChlHoTy/rh/hoDmmH4hLGMZ7Qp/N2jdOaeIkBQo= -github.com/exoscale/egoscale/v3 v3.1.34-0.20260107090256-18aa51606080/go.mod h1:0iY8OxgHJCS5TKqDNhwOW95JBKCnBZl3YGU4Yt+NqkU= +github.com/exoscale/egoscale/v3 v3.1.34-0.20260204205607-841b140c4adc h1:afmNeED0XhllWEfNRLrwJ1UjHrPoZXC1E8HVLpkOf0Y= +github.com/exoscale/egoscale/v3 v3.1.34-0.20260204205607-841b140c4adc/go.mod h1:0iY8OxgHJCS5TKqDNhwOW95JBKCnBZl3YGU4Yt+NqkU= github.com/exoscale/openapi-cli-generator v1.2.0 h1:xgTff1bInBP+JZCauD7Jq9GNBFoKK31Cnv5FIAcxtrk= github.com/exoscale/openapi-cli-generator v1.2.0/go.mod h1:TZBnbT7f3hJ5ImyUphJwRM+X5xF/zCQZ6o8a42gQeTs= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= diff --git a/vendor/github.com/exoscale/egoscale/v3/README.md b/vendor/github.com/exoscale/egoscale/v3/README.md index e3da183b1..8a6a5fb37 100644 --- a/vendor/github.com/exoscale/egoscale/v3/README.md +++ b/vendor/github.com/exoscale/egoscale/v3/README.md @@ -155,3 +155,64 @@ The generator support two types of extension: return ElasticIP{}, fmt.Errorf("%q not found in ListElasticIPSResponse: %w", idOrIP, ErrNotFound) } ``` + +## Generator Overrides System + +The Egoscale v3 generator incorporates an overrides system to preserve backwards compatibility in the Go API when the OpenAPI specification changes, such as renaming schemas or references. This ensures that existing code using the SDK does not break due to type, field name, or JSON tag changes. + +The system consists of a unified overrides system working during code generation, scoped to schemas with overrides to avoid affecting new APIs. + +### Components + +#### Schema Property and Reference Overrides +- **Location**: `generator/helpers/helpers.go` (`SchemaPropertyOverrides` map) +- **Purpose**: Unified map for property names and reference paths in legacy schemas to preserve backwards compatibility. Schemas with `Refs` are treated as legacy (applying ref overrides); others use spec defaults. Property overrides are applied per-schema as needed. +- **Example**: + ```go + var SchemaPropertyOverrides = map[string]*Overrides{ + "AttachInstanceToElasticIPRequest": { + Props: map[string]string{ + "instance-target": "instance", + }, + Refs: map[string]string{ + "#/components/schemas/ssh-key-ref": "SSHKey", + "#/components/schemas/instance-ref": "InstanceTarget", + }, + }, + "CreateInstance": { + Props: nil, + Refs: map[string]string{ + // ... ref overrides map + }, + }, + } + ``` + - In `AttachInstanceToElasticIPRequest`, a property `"instance-target"` generates `Instance` with JSON `"instance"`, and refs like `"#/components/schemas/ssh-key-ref"` generate `SSHKey`. + - Schemas without entries or with `Refs: nil` use spec defaults. + +#### Backwards Compatibility Full Types +- **Purpose**: Generates full struct definitions for old type names (e.g., `Template`) directly from the OpenAPI spec to maintain backwards compatibility, ensuring old types have complete field sets for operations like listing. +- **Generation**: All schemas in the spec are generated, including full types (e.g., `Template` with 18 fields from `template`) and ref types (e.g., `TemplateRef` with 1 field from `template-ref`). + +#### Special Aliases +- **Location**: `generator/schemas/schemas.go` (hardcoded in `Generate` function) +- **Purpose**: Adds specific type aliases for complex backwards compatibility cases where aliasing is appropriate. +- **Example**: + ```go + type InstanceTarget = InstanceRef + type BlockStorageSnapshotTarget = BlockStorageSnapshotRef + type BlockStorageVolumeTarget = BlockStorageVolumeRef + ``` + - Provides aliases like `InstanceTarget` for operations requiring distinct field names. + +### How It Works +1. **Schema Processing**: Generates all schemas from the OpenAPI spec in alphabetical order, including full types (e.g., `Template`) and ref types (e.g., `TemplateRef`). +2. **Conditional Application**: For schemas with overrides in `SchemaPropertyOverrides`, applies `Refs` (if present) and `Props` (if present); otherwise, uses spec defaults. +3. **Type and Field Generation**: References and properties are resolved with overrides, producing consistent Go structs. +4. **Special Aliases Addition**: Special aliases are appended globally. + +### Usage in Development +- Modify `SchemaPropertyOverrides` in `generator/helpers/helpers.go` for spec updates (add/update `Props` or `Refs` per schema). +- Regenerate with `make generate`, build with `go build ./...`, and inspect with `GENERATOR_DEBUG=schemas make generate`. + +This system enables the SDK to evolve with the OpenAPI spec while preserving API stability for existing users. diff --git a/vendor/github.com/exoscale/egoscale/v3/errors.go b/vendor/github.com/exoscale/egoscale/v3/errors.go index 39ba09dff..4c90b1998 100644 --- a/vendor/github.com/exoscale/egoscale/v3/errors.go +++ b/vendor/github.com/exoscale/egoscale/v3/errors.go @@ -98,6 +98,7 @@ func handleHTTPErrorResp(resp *http.Response) error { if resp.StatusCode >= 400 && resp.StatusCode <= 599 { var res struct { Message string `json:"message"` + Error string `json:"error"` } data, err := io.ReadAll(resp.Body) @@ -113,12 +114,17 @@ func handleHTTPErrorResp(resp *http.Response) error { res.Message = string(data) } + message := res.Message + if message == "" && res.Error != "" { + message = res.Error + } + err, ok := httpStatusCodeErrors[resp.StatusCode] if ok { - return fmt.Errorf("%w: %s", err, res.Message) + return fmt.Errorf("%w: %s", err, message) } - return fmt.Errorf("unmapped HTTP error: status code %d, message: %s", resp.StatusCode, res.Message) + return fmt.Errorf("unmapped HTTP error: status code %d, message: %s", resp.StatusCode, message) } return nil diff --git a/vendor/github.com/exoscale/egoscale/v3/operations.go b/vendor/github.com/exoscale/egoscale/v3/operations.go index 5ba6fc660..b767f68ad 100644 --- a/vendor/github.com/exoscale/egoscale/v3/operations.go +++ b/vendor/github.com/exoscale/egoscale/v3/operations.go @@ -258,8 +258,16 @@ func (c Client) RevealDeploymentAPIKey(ctx context.Context, id UUID) (*RevealDep return bodyresp, nil } +type GetDeploymentLogsOpt func(url.Values) + +func GetDeploymentLogsWithTail(tail int64) GetDeploymentLogsOpt { + return func(q url.Values) { + q.Add("tail", fmt.Sprint(tail)) + } +} + // Return logs for the vLLM deployment (deploy/--deployment-vllm). Optional ?stream=true to request streaming (may not be supported). -func (c Client) GetDeploymentLogs(ctx context.Context, id UUID) (*GetDeploymentLogsResponse, error) { +func (c Client) GetDeploymentLogs(ctx context.Context, id UUID, opts ...GetDeploymentLogsOpt) (*GetDeploymentLogsResponse, error) { path := fmt.Sprintf("/ai/deployment/%v/logs", id) request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) @@ -269,6 +277,14 @@ func (c Client) GetDeploymentLogs(ctx context.Context, id UUID) (*GetDeploymentL request.Header.Add("User-Agent", c.getUserAgent()) + if len(opts) > 0 { + q := request.URL.Query() + for _, opt := range opts { + opt(q) + } + request.URL.RawQuery = q.Encode() + } + if err := c.executeRequestInterceptors(ctx, request); err != nil { return nil, fmt.Errorf("GetDeploymentLogs: execute request editors: %w", err) } @@ -4928,8 +4944,7 @@ type CreateDBAASServiceMysqlRequestMigration struct { } type CreateDBAASServiceMysqlRequest struct { - // Custom password for admin user. Defaults to random string. This must be set only when a new service is being created. - AdminPassword string `json:"admin-password,omitempty" validate:"omitempty,gte=8,lte=256"` + AdminPassword DBAASMysqlUserPassword `json:"admin-password,omitempty" validate:"omitempty,gte=8,lte=256"` // Custom username for admin user. This must be set only when a new service is being created. AdminUsername string `json:"admin-username,omitempty" validate:"omitempty,gte=1,lte=64"` BackupSchedule *CreateDBAASServiceMysqlRequestBackupSchedule `json:"backup-schedule,omitempty"` @@ -5449,7 +5464,7 @@ func (c Client) DeleteDBAASMysqlUser(ctx context.Context, serviceName string, us type ResetDBAASMysqlUserPasswordRequest struct { Authentication EnumMysqlAuthenticationPlugin `json:"authentication,omitempty"` - Password DBAASUserPassword `json:"password,omitempty" validate:"omitempty,gte=8,lte=256"` + Password DBAASMysqlUserPassword `json:"password,omitempty" validate:"omitempty,gte=8,lte=256"` } // If no password is provided one will be generated automatically. @@ -10552,11 +10567,15 @@ func (c Client) ListIAMRoles(ctx context.Context) (*ListIAMRolesResponse, error) } type CreateIAMRoleRequest struct { + // Policy + AssumeRolePolicy *IAMPolicy `json:"assume-role-policy,omitempty"` // IAM Role description Description string `json:"description,omitempty" validate:"omitempty,gte=1,lte=255"` // Sets if the IAM Role Policy is editable or not (default: true). This setting cannot be changed after creation Editable *bool `json:"editable,omitempty"` Labels Labels `json:"labels,omitempty"` + // Maximum TTL requester is allowed to ask for when assuming a role + MaxSessionTtl int64 `json:"max-session-ttl,omitempty" validate:"omitempty,gt=0"` // IAM Role name Name string `json:"name" validate:"required,gte=1,lte=191"` // IAM Role permissions @@ -10708,6 +10727,8 @@ type UpdateIAMRoleRequest struct { // IAM Role description Description string `json:"description,omitempty" validate:"omitempty,gte=1,lte=255"` Labels Labels `json:"labels,omitempty"` + // Maximum TTL requester is allowed to ask for when assuming a role + MaxSessionTtl int64 `json:"max-session-ttl,omitempty" validate:"omitempty,gt=0"` // IAM Role permissions Permissions []string `json:"permissions,omitempty"` } @@ -10763,6 +10784,57 @@ func (c Client) UpdateIAMRole(ctx context.Context, id UUID, req UpdateIAMRoleReq return bodyresp, nil } +// Update IAM Assume role Policy +func (c Client) UpdateIAMAssumeRolePolicy(ctx context.Context, id UUID, req IAMPolicy) (*Operation, error) { + path := fmt.Sprintf("/iam-role/%v:assume-role-policy", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "PUT", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "update-iam-assume-role-policy") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: prepare Json response: %w", err) + } + + return bodyresp, nil +} + // Update IAM Role Policy func (c Client) UpdateIAMRolePolicy(ctx context.Context, id UUID, req IAMPolicy) (*Operation, error) { path := fmt.Sprintf("/iam-role/%v:policy", id) @@ -10963,11 +11035,11 @@ type CreateInstanceRequest struct { ApplicationConsistentSnapshotEnabled *bool `json:"application-consistent-snapshot-enabled,omitempty"` // Start Instance on creation (default: true) AutoStart *bool `json:"auto-start,omitempty"` - // Deploy target + // Deploy target reference DeployTarget *DeployTarget `json:"deploy-target,omitempty"` // Instance disk size in GiB DiskSize int64 `json:"disk-size" validate:"required,gte=10,lte=51200"` - // Compute instance type + // Instance type reference InstanceType *InstanceType `json:"instance-type" validate:"required"` // Enable IPv6. DEPRECATED: use `public-ip-assignments`. Ipv6Enabled *bool `json:"ipv6-enabled,omitempty"` @@ -10979,11 +11051,11 @@ type CreateInstanceRequest struct { SecurebootEnabled *bool `json:"secureboot-enabled,omitempty"` // Instance Security Groups SecurityGroups []SecurityGroup `json:"security-groups,omitempty"` - // SSH key + // SSH key reference SSHKey *SSHKey `json:"ssh-key,omitempty"` // Instance SSH Keys SSHKeys []SSHKey `json:"ssh-keys,omitempty"` - // Instance template + // Template reference Template *Template `json:"template" validate:"required"` // Enable Trusted Platform Module (TPM) TpmEnabled *bool `json:"tpm-enabled,omitempty"` @@ -11512,7 +11584,7 @@ func (c Client) EvictInstancePoolMembers(ctx context.Context, id UUID, req Evict type ScaleInstancePoolRequest struct { // Number of managed Instances - Size int64 `json:"size" validate:"required,gt=0"` + Size int64 `json:"size" validate:"required,gte=0"` } // Scale an Instance Pool @@ -12148,7 +12220,7 @@ func (c Client) RemoveInstanceProtection(ctx context.Context, id UUID) (*Operati type ResetInstanceRequest struct { // Instance disk size in GiB DiskSize int64 `json:"disk-size,omitempty" validate:"omitempty,gte=10,lte=51200"` - // Instance template + // Template reference Template *Template `json:"template,omitempty"` } @@ -12304,7 +12376,7 @@ func (c Client) ResizeInstanceDisk(ctx context.Context, id UUID, req ResizeInsta } type ScaleInstanceRequest struct { - // Compute instance type + // Instance type reference InstanceType *InstanceType `json:"instance-type" validate:"required"` } diff --git a/vendor/github.com/exoscale/egoscale/v3/schemas.go b/vendor/github.com/exoscale/egoscale/v3/schemas.go index f1d0c3955..4080a2a75 100644 --- a/vendor/github.com/exoscale/egoscale/v3/schemas.go +++ b/vendor/github.com/exoscale/egoscale/v3/schemas.go @@ -86,6 +86,12 @@ type AntiAffinityGroup struct { Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` } +// Anti-affinity group reference +type AntiAffinityGroupRef struct { + // Anti-affinity group ID + ID UUID `json:"id,omitempty"` +} + type BlockStorageSnapshotState string const ( @@ -119,7 +125,7 @@ type BlockStorageSnapshot struct { } // Target block storage snapshot -type BlockStorageSnapshotTarget struct { +type BlockStorageSnapshotRef struct { // Block storage snapshot ID ID UUID `json:"id,omitempty"` } @@ -160,7 +166,7 @@ type BlockStorageVolume struct { } // Target block storage volume -type BlockStorageVolumeTarget struct { +type BlockStorageVolumeRef struct { // Block storage volume ID ID UUID `json:"id,omitempty"` } @@ -741,6 +747,8 @@ type DBAASMigrationStatus struct { type DBAASMysqlDatabaseName string +type DBAASMysqlUserPassword string + type DBAASNodeStateRole string const ( @@ -1872,6 +1880,12 @@ type DeployTarget struct { Type DeployTargetType `json:"type,omitempty"` } +// Deploy target reference +type DeployTargetRef struct { + // Deploy target ID + ID UUID `json:"id,omitempty"` +} + // DNS domain type DNSDomain struct { // DNS domain creation date @@ -1981,6 +1995,12 @@ type ElasticIPHealthcheck struct { URI string `json:"uri,omitempty" validate:"omitempty,gte=1,lte=255"` } +// Elastic IP reference +type ElasticIPRef struct { + // Elastic IP ID + ID UUID `json:"id,omitempty"` +} + type EnumComponentRoute string const ( @@ -2288,6 +2308,12 @@ type GetModelResponse struct { UpdatedAT time.Time `json:"updated-at,omitempty"` } +// GPU usage for an organization +type GetOrganizationUsageResponse struct { + // Total GPU count + Gpu int64 `json:"gpu,omitempty" validate:"omitempty,gte=0"` +} + // IAM API Key type IAMAPIKey struct { // IAM API Key @@ -2327,6 +2353,8 @@ type IAMPolicy struct { // IAM Role type IAMRole struct { + // Policy + AssumeRolePolicy *IAMPolicy `json:"assume-role-policy,omitempty"` // IAM Role description Description string `json:"description,omitempty" validate:"omitempty,gte=1,lte=255"` // IAM Role mutability @@ -2334,6 +2362,8 @@ type IAMRole struct { // IAM Role ID ID UUID `json:"id,omitempty"` Labels Labels `json:"labels,omitempty"` + // Maximum TTL requester is allowed to ask for when assuming a role + MaxSessionTtl int64 `json:"max-session-ttl,omitempty" validate:"omitempty,gt=0"` // IAM Role name Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` // IAM Role permissions @@ -2513,6 +2543,12 @@ type InstancePool struct { UserData string `json:"user-data,omitempty" validate:"omitempty,gte=1"` } +// Target Instance +type InstanceRef struct { + // Instance ID + ID UUID `json:"id,omitempty"` +} + type InstanceState string const ( @@ -2527,12 +2563,6 @@ const ( InstanceStateDestroyed InstanceState = "destroyed" ) -// Target Instance -type InstanceTarget struct { - // Instance ID - ID UUID `json:"id,omitempty"` -} - type InstanceTypeFamily string const ( @@ -2587,6 +2617,12 @@ type InstanceType struct { Zones []ZoneName `json:"zones,omitempty"` } +// Instance type reference +type InstanceTypeRef struct { + // Instance type ID + ID UUID `json:"id,omitempty"` +} + type JSONSchemaGrafanaAlertingErrorORTimeout string const ( @@ -4100,6 +4136,12 @@ type PrivateNetworkOptions struct { Routers []net.IP `json:"routers,omitempty"` } +// Private network reference +type PrivateNetworkRef struct { + // Private network ID + ID UUID `json:"id,omitempty"` +} + type PublicIPAssignment string const ( @@ -4155,6 +4197,12 @@ type SecurityGroup struct { Rules []SecurityGroupRule `json:"rules,omitempty"` } +// Security group reference +type SecurityGroupRef struct { + // Security group ID + ID UUID `json:"id,omitempty"` +} + type SecurityGroupResourceVisibility string const ( @@ -4328,6 +4376,12 @@ type SKSClusterDeprecatedResource struct { type SKSClusterLabels map[string]string +// SKS cluster reference +type SKSClusterRef struct { + // SKS cluster ID + ID UUID `json:"id,omitempty"` +} + // Kubeconfig request for a SKS cluster type SKSKubeconfigRequest struct { // List of roles. The certificate present in the Kubeconfig will have these roles set in the Org field. @@ -4500,6 +4554,12 @@ type SSHKey struct { Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` } +// SSH key reference +type SSHKeyRef struct { + // SSH key name + Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` +} + type TemplateBootMode string const ( @@ -4554,6 +4614,12 @@ type Template struct { Zones []ZoneName `json:"zones,omitempty"` } +// Template reference +type TemplateRef struct { + // Template ID + ID UUID `json:"id,omitempty"` +} + // User type User struct { // User Email @@ -4591,3 +4657,7 @@ const ( ZoneNameATVie2 ZoneName = "at-vie-2" ZoneNameHrZag1 ZoneName = "hr-zag-1" ) + +type InstanceTarget = InstanceRef +type BlockStorageSnapshotTarget = BlockStorageSnapshotRef +type BlockStorageVolumeTarget = BlockStorageVolumeRef diff --git a/vendor/modules.txt b/vendor/modules.txt index fb1b8df0d..87a4e1817 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -154,7 +154,7 @@ github.com/dlclark/regexp2/syntax # github.com/dustin/go-humanize v1.0.1 ## explicit; go 1.16 github.com/dustin/go-humanize -# github.com/exoscale/egoscale/v3 v3.1.34-0.20260107090256-18aa51606080 +# github.com/exoscale/egoscale/v3 v3.1.34-0.20260204205607-841b140c4adc ## explicit; go 1.23.8 github.com/exoscale/egoscale/v3 github.com/exoscale/egoscale/v3/credentials From 55d244b9a2f9e0cc129162a3e823498edf7b70d2 Mon Sep 17 00:00:00 2001 From: Paul Habfast Date: Wed, 4 Feb 2026 22:45:43 +0100 Subject: [PATCH 2/2] [sc-160169] support for deployment logs --tail in cli --- CHANGELOG.md | 3 ++- cmd/aiservices/deployment/deployment_logs.go | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee43cef9..02e3f00eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,11 @@ - instance snapshot show: now displays the Application Consistent Snapshot Enabled field - instance-template register: added support for the new --application-consistent-snapshot-enabled flag - instance-template show: now displays the Application Consistent Snapshot Enabled field - +- dedicated-inference/deployment logs: support for --tail ### Bug fixes - fix(instance): create instance with an IPv6 #788 +- dedicated-inference/deployment logs: works again even without the --tail argument ### Breaking changes - instance create: merge --ipv6 and --private-instance into --public-ip #788 diff --git a/cmd/aiservices/deployment/deployment_logs.go b/cmd/aiservices/deployment/deployment_logs.go index 787c8ea3b..a723466d4 100644 --- a/cmd/aiservices/deployment/deployment_logs.go +++ b/cmd/aiservices/deployment/deployment_logs.go @@ -17,6 +17,7 @@ type DeploymentLogsCmd struct { Deployment string `cli-arg:"#" cli-usage:"ID or NAME"` Zone v3.ZoneName `cli-short:"z" cli-usage:"zone"` + Tail int64 `cli-usage:"number of lines to tail (default 10)"` } func (c *DeploymentLogsCmd) CmdAliases() []string { return nil } @@ -28,6 +29,7 @@ func (c *DeploymentLogsCmd) CmdPreRun(cmd *cobra.Command, args []string) error { exocmd.CmdSetZoneFlagFromDefault(cmd) return exocmd.CliCommandDefaultPreRun(c, cmd, args) } + func (c *DeploymentLogsCmd) CmdRun(_ *cobra.Command, _ []string) error { ctx := exocmd.GContext client, err := exocmd.SwitchClientZoneV3(ctx, globalstate.EgoscaleV3Client, c.Zone) @@ -46,7 +48,12 @@ func (c *DeploymentLogsCmd) CmdRun(_ *cobra.Command, _ []string) error { } id := entry.ID - resp, err := client.GetDeploymentLogs(ctx, id) + tail := c.Tail + if tail <= 0 { + tail = 10 + } + + resp, err := client.GetDeploymentLogs(ctx, id, v3.GetDeploymentLogsWithTail(tail)) if err != nil { return err }