-
Notifications
You must be signed in to change notification settings - Fork 195
/
config.go
53 lines (45 loc) · 1.99 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package controller
import (
"net/http"
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/jitter"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/dcl/conversion"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/k8s"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/servicemapping/servicemappingloader"
tfschema "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
type Config struct {
UserAgent string
// UserProjectOverride provides the option to use the resource project for preconditions, quota, and billing,
// instead of the project the credentials belong to; false by default
UserProjectOverride bool
// BillingProject is the project used by the TF provider and DCL client to determine preconditions,
// quota, and billing if UserProjectOverride is set to true. If this field is empty,
// but UserProjectOverride is set to true, resource project will be used.
BillingProject string
// HTTPClient allows us to specify the HTTP client to use with DCL.
// This is particularly useful in mocks/tests.
HTTPClient *http.Client
}
// Common controller dependencies.
type Deps struct {
TfProvider *tfschema.Provider
TfLoader *servicemappingloader.ServiceMappingLoader
DclConfig *dcl.Config
DclConverter *conversion.Converter
Defaulters []k8s.Defaulter
JitterGen jitter.Generator
}