Skip to content

Conversation

Benjosh95
Copy link
Contributor

@Benjosh95 Benjosh95 commented Sep 23, 2025

Description

Problem:
The commands for server list and describe returns the userData as byteArray instead of base64 string.

Jira-Tickets:

Testing instruction:

  1. Create a server with userData ("test") via TF config looking something like this:
            resource "stackit_server" "server-01" {
              project_id = var.project_id
              name       = "user-data-test-server"
              boot_volume = {
                source_type           = "image"
                size                  = 32
                source_id             = "a2c127b2-b1b5-4aee-986f-41cd11b41279" // Ubuntu 24.04 image
                delete_on_termination = true
              }
              machine_type = "t1.1"
              availability_zone  = "eu01-1"
              user_data = "test"
            `}`
  1. Build the CLI for this branch
  2. Run the two commands stackit server describe -o yaml and stackit server list -o yaml to see if userData is correctly output as base64

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Benjosh95 Benjosh95 requested a review from a team as a code owner September 23, 2025 17:46
Copy link

Merging this branch changes the coverage (2 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/server/describe 36.52% (-0.32%) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/server/list 33.78% (-0.46%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/utils 55.68% (+10.48%) 🎉

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/server/describe/describe.go 36.52% (-0.32%) 115 (+1) 42 73 (+1) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/server/list/list.go 33.78% (-0.46%) 74 (+1) 25 49 (+1) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/utils/utils.go 58.46% (+14.46%) 65 (+15) 38 (+16) 27 (-1) 🎉

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/stackit-cli/internal/pkg/utils/utils_test.go

@Benjosh95 Benjosh95 merged commit a2d59a5 into main Sep 24, 2025
5 checks passed
@Benjosh95 Benjosh95 deleted the bf/server-bytearray-to-base64-convertion branch September 24, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants