Skip to content

Commit ac78ba6

Browse files
committed
implement review findings
1 parent bbfafaa commit ac78ba6

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

internal/cmd/observability/scrape-config/create/create_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package create
22

33
import (
44
"context"
5+
"fmt"
56
"testing"
67

78
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
@@ -69,7 +70,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
6970
flagValues := map[string]string{
7071
projectIdFlag: testProjectId,
7172
instanceIdFlag: testInstanceId,
72-
payloadFlag: `{
73+
payloadFlag: fmt.Sprintf(`{
7374
"jobName": "default-name",
7475
"basicAuth": {
7576
"username": "username",
@@ -95,7 +96,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
9596
"key2": []
9697
},
9798
"sampleLimit": 1.0,
98-
"scheme": "https",
99+
"scheme": "%s",
99100
"scrapeInterval": "interval",
100101
"scrapeTimeout": "timeout",
101102
"staticConfigs": [
@@ -110,7 +111,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
110111
"tlsConfig": {
111112
"insecureSkipVerify": true
112113
}
113-
}`,
114+
}`, observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTPS),
114115
}
115116
for _, mod := range mods {
116117
mod(flagValues)

internal/cmd/ske/cluster/create/create_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package create
22

33
import (
44
"context"
5+
"fmt"
56
"testing"
67
"time"
78

@@ -81,7 +82,7 @@ func fixtureArgValues(mods ...func(argValues []string)) []string {
8182
func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
8283
flagValues := map[string]string{
8384
projectIdFlag: testProjectId,
84-
payloadFlag: `{
85+
payloadFlag: fmt.Sprintf(`{
8586
"name": "cli-jp",
8687
"kubernetes": {
8788
"version": "1.25.15"
@@ -100,7 +101,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
100101
"maximum": 2,
101102
"maxSurge": 1,
102103
"volume": { "type": "storage_premium_perf0", "size": 40 },
103-
"cri": { "name": "docker" },
104+
"cri": { "name": "%s" },
104105
"availabilityZones": ["eu01-3"]
105106
}
106107
],
@@ -115,7 +116,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
115116
"start": "0000-01-01T03:00:00+02:00"
116117
}
117118
}
118-
}`,
119+
}`, ske.CRINAME_DOCKER),
119120
}
120121
for _, mod := range mods {
121122
mod(flagValues)

internal/cmd/ske/cluster/update/update_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package update
22

33
import (
44
"context"
5+
"fmt"
56
"testing"
67
"time"
78

@@ -81,7 +82,7 @@ func fixtureArgValues(mods ...func(argValues []string)) []string {
8182
func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
8283
flagValues := map[string]string{
8384
projectIdFlag: testProjectId,
84-
payloadFlag: `{
85+
payloadFlag: fmt.Sprintf(`{
8586
"name": "cli-jp",
8687
"kubernetes": {
8788
"version": "1.25.15"
@@ -100,7 +101,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
100101
"maximum": 2,
101102
"maxSurge": 1,
102103
"volume": { "type": "storage_premium_perf0", "size": 40 },
103-
"cri": { "name": "docker" },
104+
"cri": { "name": "%s" },
104105
"availabilityZones": ["eu01-3"]
105106
}
106107
],
@@ -115,7 +116,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
115116
"start": "0000-01-01T03:00:00+02:00"
116117
}
117118
}
118-
}`,
119+
}`, ske.CRINAME_DOCKER),
119120
}
120121
for _, mod := range mods {
121122
mod(flagValues)

0 commit comments

Comments
 (0)