Skip to content

Commit 207f981

Browse files
committed
refactor(azure): remove dead code
1 parent 6750f7e commit 207f981

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

pkg/azure/azure.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ const (
2525
subsystem = "azure"
2626
)
2727

28-
var (
29-
errInvalidSubscriptionID = errors.New("subscription id was invalid")
30-
)
28+
var errInvalidSubscriptionID = errors.New("subscription id was invalid")
3129

3230
var (
3331
collectorDurationDesc = prometheus.NewDesc(
@@ -51,11 +49,10 @@ var (
5149
)
5250

5351
type Azure struct {
54-
config *Config
5552
context context.Context
5653
logger *slog.Logger
5754

58-
subscriptionID string
55+
subscriptionId string
5956
azCredentials *azidentity.DefaultAzureCredential
6057

6158
collectorTimeout time.Duration
@@ -143,7 +140,7 @@ func New(ctx context.Context, config *Config) (*Azure, error) {
143140
context: ctx,
144141
logger: logger,
145142

146-
subscriptionID: config.SubscriptionID,
143+
subscriptionId: config.SubscriptionId,
147144
azCredentials: creds,
148145

149146
collectorTimeout: config.CollectorTimeout,
@@ -188,7 +185,7 @@ func (a *Azure) Collect(ch chan<- prometheus.Metric) {
188185

189186
duration, hasError := collectormetrics.Collect(collectCtx, c, ch, a.logger, subsystem)
190187

191-
//TODO: remove collectorErrors once we have the new metrics
188+
// TODO: remove collectorErrors once we have the new metrics
192189
collectorErrors := 0.0
193190
if hasError {
194191
collectorErrors = 1.0

pkg/azure/azure_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func Test_CollectMetrics(t *testing.T) {
161161
c.EXPECT().Describe(gomock.Any()).Return(nil).AnyTimes()
162162
}
163163
azure := &Azure{
164-
config: &Config{Region: "eastus"},
165164
context: t.Context(),
166165
logger: testLogger,
167166
collectors: []provider.Collector{},

0 commit comments

Comments
 (0)