-
Notifications
You must be signed in to change notification settings - Fork 139
/
azure.go
72 lines (60 loc) · 3 KB
/
azure.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package azure
import (
"github.com/spf13/cobra"
"github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning"
)
type azureOptions struct {
CredRequestDir string
IssuerURL string
Name string
PublicKeyPath string
Region string
StorageAccountName string
BlobContainerName string
SubscriptionID string
TenantID string
OutputDir string
DryRun bool
EnableTechPreview bool
// UserTags is the map of user provided tags to be applied to Azure resources created by ccoctl.
// For example:
// userTags := map[string]string{"openshift.io_cloud-credential-operator": "owned"}
UserTags map[string]string
// InstallationResourceGroupName is the name of the Azure resource group which
// will be used for installer provisioned infrastructure (IPI). This Azure resource
// group will be created by ccoctl such that any permissions granted to managed identities created by ccoctl may
// be scoped within the Azure resource group identified by InstallationResourceGroupName.
InstallationResourceGroupName string
// OIDCResourceGroupName is the name of the Azure resource group which will contain OIDC
// and user-assigned managed identity resources. The resource group provided to the OpenShift
// installer for installer provisioned infrastructure (IPI) may not contain any resources so the
// resource group identified by OIDCResourceGroupName will be their home.
// Reference: https://github.com/openshift/installer/blob/85138dd3c4e9c27c4bd4fbe3588af7712404347b/pkg/asset/installconfig/azure/validation.go#L558-L570
OIDCResourceGroupName string
// DNSZoneResourceGroupName is the name of the Azure resource group in which the OpenShift
// cluster's base domain DNS zone exists. The permissions granted to the managed identity created
// for the ingress operator will be scoped to the DNSZoneResourceGroupName.
DNSZoneResourceGroupName string
// DeleteResourceGroup is a bool indicating that the OIDC resource group should be deleted when
// ccoctl azure delete is invoked with the --delete-oidc-resource-group flag
DeleteOIDCResourceGroup bool
// NetworkResourceGroupName is the name of the Azure resource group for network resources like
// the Virtual Network and Subnets used by the cluster. If provided, several operators
// (cluster-network-operator, machine-api-operator, and cluster-storage-operator(file)) will be
// scoped to the NetworkResourceGroupName.
NetworkResourceGroupName string
}
// NewAzureCmd implements the "azure" subcommand for credentials provisioning
func NewAzureCmd() *cobra.Command {
createCmd := &cobra.Command{
Use: "azure",
Short: "Manage credentials objects for Azure",
Long: "Creating/updating/deleting cloud credentials objects for Azure",
}
createCmd.AddCommand(provisioning.NewCreateKeyPairCmd())
createCmd.AddCommand(NewCreateOIDCIssuerCmd())
createCmd.AddCommand(NewCreateManagedIdentitiesCmd())
createCmd.AddCommand(NewCreateAllCmd())
createCmd.AddCommand(NewDeleteCmd())
return createCmd
}