-
Notifications
You must be signed in to change notification settings - Fork 71
/
types.go
55 lines (47 loc) · 1.4 KB
/
types.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
54
55
// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0
package azure
import (
"strings"
provider "github.com/confidential-containers/cloud-api-adaptor/src/cloud-providers"
"github.com/confidential-containers/cloud-api-adaptor/src/cloud-providers/util"
)
type instanceSizes []string
func (i *instanceSizes) String() string {
return strings.Join(*i, ", ")
}
func (i *instanceSizes) Set(value string) error {
if len(value) == 0 {
*i = make(instanceSizes, 0)
} else {
*i = append(*i, strings.Split(value, ",")...)
}
return nil
}
type Config struct {
SubscriptionId string
ClientId string
ClientSecret string
TenantId string
ResourceGroupName string
Zone string
Region string
SubnetId string
SecurityGroupName string
SecurityGroupId string
Size string
ImageId string
SSHKeyPath string
SSHUserName string
DisableCVM bool
InstanceSizes instanceSizes
InstanceSizeSpecList []provider.InstanceTypeSpec
Tags provider.KeyValueFlag
DisableCloudConfig bool
// Disabled by default, we want to do measured boot.
// Secure boot brings no additional security.
EnableSecureBoot bool
}
func (c Config) Redact() Config {
return *util.RedactStruct(&c, "ClientId", "TenantId", "ClientSecret").(*Config)
}