Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
971bedf
clean up loadbalance and iaas client
aniruddha2000 May 4, 2026
a608019
add volume methods
aniruddha2000 May 5, 2026
ad02b87
add volume methods in interface
aniruddha2000 May 5, 2026
da31102
add filter funcs and nits
aniruddha2000 May 6, 2026
97ae5f4
add client build code and helpers
aniruddha2000 May 6, 2026
0217e50
replace loadbalancer calls
aniruddha2000 May 7, 2026
e538ca2
replace iaas calls
aniruddha2000 May 8, 2026
c62bd98
fix waitbackup ready and replace more calls
aniruddha2000 May 8, 2026
f0b9304
fix more calls
aniruddha2000 May 8, 2026
ac3d525
replace client creation in main.go
aniruddha2000 May 8, 2026
26c7ff4
add cmd/controllerserver.go
aniruddha2000 May 8, 2026
75d273b
add mocks and fix iaas and loadbalancing option
aniruddha2000 May 9, 2026
b2f9bb8
add replace with new mock and old client imports with new
aniruddha2000 May 9, 2026
fed4a20
add test cases for the iaas methods
aniruddha2000 May 11, 2026
f038b8c
delete old client and mocks
aniruddha2000 May 11, 2026
05f3eeb
add fmt
aniruddha2000 May 11, 2026
7dd0d11
make verify
aniruddha2000 May 11, 2026
88405e5
make seperate test package
aniruddha2000 May 11, 2026
83ac303
push rest of the tests
aniruddha2000 May 11, 2026
490e32a
remove unused code
aniruddha2000 May 12, 2026
74627dc
rename test package
aniruddha2000 May 12, 2026
587d265
rename further packages
aniruddha2000 May 12, 2026
47b652a
make fmt
aniruddha2000 May 12, 2026
5bd0647
fix lints
aniruddha2000 May 13, 2026
6506b3a
fix lintts
aniruddha2000 May 13, 2026
88aef25
fix iaas tests with mock default api
aniruddha2000 May 13, 2026
3743096
convert back from client_test to client in tests
aniruddha2000 May 13, 2026
640ed4b
fix list return elements
aniruddha2000 May 13, 2026
1de848d
remove labels casting
aniruddha2000 May 13, 2026
459fdac
remove labels casting
aniruddha2000 May 13, 2026
8540bdb
fix test api calls
aniruddha2000 May 15, 2026
34cd84b
rebase go.mod
aniruddha2000 May 18, 2026
df37d67
make typed in IaaS client mock
aniruddha2000 May 18, 2026
d81c51a
use typed in loadbalancer mock
aniruddha2000 May 18, 2026
d85c8a8
fix test with broken type in DoAndReturn
aniruddha2000 May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ mocks: $(MOCKGEN)
@$(MOCKGEN) -destination ./pkg/mock/iaas/iaas.go -package iaas github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api DefaultAPI

# client mocks
@$(MOCKGEN) -destination ./pkg/stackit/iaas_mock.go -package stackit ./pkg/stackit IaasClient
@$(MOCKGEN) -destination ./pkg/stackit/loadbalancer_mock.go -package stackit ./pkg/stackit LoadbalancerClient
@$(MOCKGEN) -destination ./pkg/stackit/server_mock.go -package stackit ./pkg/stackit NodeClient
@$(MOCKGEN) -destination ./pkg/stackit/metadata/metadata_mock.go -package metadata ./pkg/stackit/metadata IMetadata
@$(MOCKGEN) -destination ./pkg/csi/util/mount/mount_mock.go -package mount ./pkg/csi/util/mount IMount
@$(MOCKGEN) -destination ./pkg/stackit/client/mock/iaas_mock.go -typed -package client ./pkg/stackit/client IaaSClient
@$(MOCKGEN) -destination ./pkg/stackit/client/mock/loadbalancer_mock.go -typed -package client ./pkg/stackit/client LoadBalancingClient
@$(MOCKGEN) -destination ./pkg/stackit/client/mock/mock.go -package client ./pkg/stackit/client Factory

.PHONY: generate
generate: mocks
Expand Down
30 changes: 17 additions & 13 deletions cmd/stackit-csi-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/component-base/cli"
"k8s.io/klog/v2"

"github.com/stackitcloud/cloud-provider-stackit/pkg/csi"
"github.com/stackitcloud/cloud-provider-stackit/pkg/csi/blockstorage"
"github.com/stackitcloud/cloud-provider-stackit/pkg/csi/util/mount"
"github.com/stackitcloud/cloud-provider-stackit/pkg/stackit"
"github.com/stackitcloud/cloud-provider-stackit/pkg/metrics"
stackitclient "github.com/stackitcloud/cloud-provider-stackit/pkg/stackit/client"
"github.com/stackitcloud/cloud-provider-stackit/pkg/stackit/metadata"
"github.com/stackitcloud/cloud-provider-stackit/pkg/version"
sdkconfig "github.com/stackitcloud/stackit-sdk-go/core/config"
"k8s.io/component-base/cli"
"k8s.io/klog/v2"
)

var (
Expand Down Expand Up @@ -73,7 +74,7 @@ func main() {
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true,
"If set to true then the CSI driver does provide the node service (default: true)")

stackit.AddExtraFlags(pflag.CommandLine)
stackitclient.AddExtraFlags(pflag.CommandLine)

code := cli.Run(cmd)
os.Exit(code)
Expand All @@ -89,29 +90,32 @@ func handle() {

if provideControllerService {
var err error
cfg, err := stackit.GetConfigFromFile(cloudConfig)
cfg, err := stackitclient.GetConfigFromFile(cloudConfig)
if err != nil {
klog.Fatal(err)
}

iaasClient, err := stackit.CreateIaaSClient(&cfg)
if err != nil {
klog.Fatalf("Failed to create IaaS client: %v", err)
iaasOpts := []sdkconfig.ConfigurationOption{
sdkconfig.WithHTTPClient(metrics.NewInstrumentedHTTPClient()), // TODO: Ask if this is needed or not
}

if cfg.Global.APIEndpoints.IaasAPI != "" {
iaasOpts = append(iaasOpts, sdkconfig.WithEndpoint(cfg.Global.APIEndpoints.IaasAPI))
}

stackitProvider, err := stackit.CreateSTACKITProvider(iaasClient, &cfg)
iaasClient, err := stackitclient.New(cfg.Global.Region, cfg.Global.ProjectID).IaaS(iaasOpts)
if err != nil {
klog.Fatalf("Failed to create STACKIT provider: %v", err)
klog.Fatalf("Failed to create STACKIT stackitclient: %v", err)
}

d.SetupControllerService(stackitProvider)
d.SetupControllerService(iaasClient)
}

if provideNodeService {
// Initialize mount
mountProvider := mount.GetMountProvider()

cfg, err := stackit.GetConfigFromFile(cloudConfig)
cfg, err := stackitclient.GetConfigFromFile(cloudConfig)
if err != nil {
klog.Fatal(err)
}
Expand Down
50 changes: 26 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,36 @@ require (
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.22.1 // indirect
github.com/go-openapi/jsonreference v0.21.2 // indirect
github.com/go-openapi/swag v0.25.1 // indirect
github.com/go-openapi/swag/cmdutils v0.25.1 // indirect
github.com/go-openapi/swag/conv v0.25.1 // indirect
github.com/go-openapi/swag/fileutils v0.25.1 // indirect
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
github.com/go-openapi/swag/loading v0.25.1 // indirect
github.com/go-openapi/swag/mangling v0.25.1 // indirect
github.com/go-openapi/swag/netutils v0.25.1 // indirect
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
github.com/go-openapi/jsonpointer v0.22.4 // indirect
github.com/go-openapi/jsonreference v0.21.4 // indirect
github.com/go-openapi/swag v0.25.4 // indirect
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/mangling v0.25.4 // indirect
github.com/go-openapi/swag/netutils v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/goccy/go-yaml v1.19.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/cel-go v0.27.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/term v0.5.2 // indirect
Expand All @@ -90,9 +92,9 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.23.0 // indirect
github.com/stoewer/go-strcase v1.3.1 // indirect
github.com/stretchr/objx v0.5.3 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.etcd.io/etcd/api/v3 v3.6.8 // indirect
Expand All @@ -102,8 +104,8 @@ require (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
Expand All @@ -113,13 +115,13 @@ require (
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/term v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
Expand Down
Loading