diff --git a/go.mod b/go.mod index 7a5c09d372..a8f7124401 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-logr/zapr v0.1.1 github.com/google/go-cmp v0.3.1 github.com/kevinburke/go-bindata v3.11.0+incompatible - github.com/openshift/api v0.0.0-20200522173408-17ada6e4245b + github.com/openshift/api v0.0.0-20200609191024-dca637550e8c github.com/openshift/library-go v0.0.0-20200324092245-db2a8546af81 github.com/pkg/errors v0.8.1 github.com/spf13/cobra v0.0.5 diff --git a/go.sum b/go.sum index 261595c563..26f5ae4ae1 100644 --- a/go.sum +++ b/go.sum @@ -286,8 +286,8 @@ github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20191031171055-b133feaeeb2e/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/openshift/api v0.0.0-20200320142426-0de0d539b0c3/go.mod h1:7k3+uZYOir97walbYUqApHUA2OPhkQpVJHt0n7GJ6P4= -github.com/openshift/api v0.0.0-20200522173408-17ada6e4245b h1:yEY4zF6pEEWdR09wjuDJhupLEDM2vYdUgLoc10C0fFk= -github.com/openshift/api v0.0.0-20200522173408-17ada6e4245b/go.mod h1:TkhafijfTiRi1Q3120/ZSE4oIWKQ4DGRh3byPywv4Mw= +github.com/openshift/api v0.0.0-20200609191024-dca637550e8c h1:bKFV0gBWD+jg/xbR4jrf4jBFQE/c/jXj3bzDw8nZghU= +github.com/openshift/api v0.0.0-20200609191024-dca637550e8c/go.mod h1:l6TGeqJ92DrZBuWMNKcot1iZUHfbYSJyBWHGgg6Dn6s= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/client-go v0.0.0-20200320150128-a906f3d8e723/go.mod h1:wNBSSt4RZTHhUWyhBE3gxTR32QpF9DB2SfS14u2IxuE= diff --git a/pkg/dns/azure/client/auth.go b/pkg/dns/azure/client/auth.go index 3af50d63a6..c2ac3a8fb3 100644 --- a/pkg/dns/azure/client/auth.go +++ b/pkg/dns/azure/client/auth.go @@ -3,23 +3,17 @@ package client import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" - "github.com/Azure/go-autorest/autorest/azure" ) func getAuthorizerForResource(config Config) (autorest.Authorizer, error) { - env, err := azure.EnvironmentFromName(config.Environment) - if err != nil { - return nil, err - } - oauthConfig, err := adal.NewOAuthConfig( - env.ActiveDirectoryEndpoint, config.TenantID) + config.Environment.ActiveDirectoryEndpoint, config.TenantID) if err != nil { return nil, err } token, err := adal.NewServicePrincipalToken( - *oauthConfig, config.ClientID, config.ClientSecret, env.ResourceManagerEndpoint) + *oauthConfig, config.ClientID, config.ClientSecret, config.Environment.ResourceManagerEndpoint) if err != nil { return nil, err } diff --git a/pkg/dns/azure/client/client.go b/pkg/dns/azure/client/client.go index 9e79d15c12..8ddb0a08cb 100644 --- a/pkg/dns/azure/client/client.go +++ b/pkg/dns/azure/client/client.go @@ -5,6 +5,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns" privatedns "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" + "github.com/Azure/go-autorest/autorest/azure" "github.com/pkg/errors" ) @@ -14,7 +15,7 @@ type DNSClient interface { } type Config struct { - Environment string + Environment azure.Environment SubscriptionID string ClientID string ClientSecret string @@ -84,7 +85,7 @@ func newRecordSetClient(config Config, userAgentExtension string) (*recordSetCli return nil, err } - rc := dns.NewRecordSetsClient(config.SubscriptionID) + rc := dns.NewRecordSetsClientWithBaseURI(config.Environment.ResourceManagerEndpoint, config.SubscriptionID) rc.AddToUserAgent(userAgentExtension) rc.Authorizer = authorizer return &recordSetClient{client: rc}, nil @@ -129,7 +130,7 @@ func newPrivateRecordSetClient(config Config, userAgentExtension string) (*priva return nil, err } - prc := privatedns.NewRecordSetsClient(config.SubscriptionID) + prc := privatedns.NewRecordSetsClientWithBaseURI(config.Environment.ResourceManagerEndpoint, config.SubscriptionID) prc.AddToUserAgent(userAgentExtension) prc.Authorizer = authorizer return &privateRecordSetClient{client: prc}, nil diff --git a/pkg/dns/azure/dns.go b/pkg/dns/azure/dns.go index 84b20a1887..3556ce7e9d 100644 --- a/pkg/dns/azure/dns.go +++ b/pkg/dns/azure/dns.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "github.com/Azure/go-autorest/autorest/azure" "github.com/pkg/errors" configv1 "github.com/openshift/api/config/v1" @@ -43,8 +44,12 @@ type provider struct { // NewProvider creates a new dns.Provider for Azure. It only supports DNSRecords with // type A. func NewProvider(config Config, operatorReleaseVersion string) (dns.Provider, error) { + env, err := azure.EnvironmentFromName(config.Environment) + if err != nil { + return nil, fmt.Errorf("could not determine cloud environment: %w", err) + } c, err := client.New(client.Config{ - Environment: config.Environment, + Environment: env, SubscriptionID: config.SubscriptionID, ClientID: config.ClientID, ClientSecret: config.ClientSecret, diff --git a/pkg/operator/controller/dns/controller.go b/pkg/operator/controller/dns/controller.go index 9e5c1419ff..ce3c7d7e28 100644 --- a/pkg/operator/controller/dns/controller.go +++ b/pkg/operator/controller/dns/controller.go @@ -447,8 +447,12 @@ func (r *reconciler) createDNSProvider(dnsConfig *configv1.DNS, platformStatus * } dnsProvider = provider case configv1.AzurePlatformType: + environment := platformStatus.Azure.CloudName + if environment == "" { + environment = configv1.AzurePublicCloud + } provider, err := azuredns.NewProvider(azuredns.Config{ - Environment: "AzurePublicCloud", + Environment: string(environment), ClientID: string(creds.Data["azure_client_id"]), ClientSecret: string(creds.Data["azure_client_secret"]), TenantID: string(creds.Data["azure_tenant_id"]), diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml index 35e38f1037..ee22cd7e3a 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml @@ -227,6 +227,17 @@ spec: provider. type: object properties: + cloudName: + description: cloudName is the name of the Azure cloud environment + which can be used to configure the Azure SDK with the appropriate + Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`. + type: string + enum: + - "" + - AzurePublicCloud + - AzureUSGovernmentCloud + - AzureChinaCloud + - AzureGermanCloud networkResourceGroupName: description: networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets diff --git a/vendor/github.com/openshift/api/config/v1/types_feature.go b/vendor/github.com/openshift/api/config/v1/types_feature.go index 8bbed60777..7cb30c5d34 100644 --- a/vendor/github.com/openshift/api/config/v1/types_feature.go +++ b/vendor/github.com/openshift/api/config/v1/types_feature.go @@ -37,6 +37,9 @@ var ( // TopologyManager enables ToplogyManager support. Upgrades are enabled with this feature. LatencySensitive FeatureSet = "LatencySensitive" + + // IPv6DualStackNoUpgrade enables dual-stack. Turning this feature set on IS NOT SUPPORTED, CANNOT BE UNDONE, and PREVENTS UPGRADES. + IPv6DualStackNoUpgrade FeatureSet = "IPv6DualStackNoUpgrade" ) type FeatureGateSpec struct { @@ -108,6 +111,11 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ "TopologyManager", // sig-pod, sjenning ). toFeatures(), + IPv6DualStackNoUpgrade: newDefaultFeatures(). + with( + "IPv6DualStack", // sig-network, danwinship + ). + toFeatures(), } var defaultFeatures = &FeatureGateEnabledDisabled{ diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index baa5af3797..9c9dd2b6fe 100644 --- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -277,8 +277,32 @@ type AzurePlatformStatus struct { // If empty, the value is same as ResourceGroupName. // +optional NetworkResourceGroupName string `json:"networkResourceGroupName,omitempty"` + + // cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK + // with the appropriate Azure API endpoints. + // If empty, the value is equal to `AzurePublicCloud`. + // +optional + CloudName AzureCloudEnvironment `json:"cloudName,omitempty"` } +// AzureCloudEnvironment is the name of the Azure cloud environment +// +kubebuilder:validation:Enum="";AzurePublicCloud;AzureUSGovernmentCloud;AzureChinaCloud;AzureGermanCloud +type AzureCloudEnvironment string + +const ( + // AzurePublicCloud is the general-purpose, public Azure cloud environment. + AzurePublicCloud AzureCloudEnvironment = "AzurePublicCloud" + + // AzureUSGovernmentCloud is the Azure cloud environment for the US government. + AzureUSGovernmentCloud AzureCloudEnvironment = "AzureUSGovernmentCloud" + + // AzureChinaCloud is the Azure cloud environment used in China. + AzureChinaCloud AzureCloudEnvironment = "AzureChinaCloud" + + // AzureGermanCloud is the Azure cloud environment used in Germany. + AzureGermanCloud AzureCloudEnvironment = "AzureGermanCloud" +) + // GCPPlatformSpec holds the desired state of the Google Cloud Platform infrastructure provider. // This only includes fields that can be modified in the cluster. type GCPPlatformSpec struct{} diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index 5e8eca32c2..bc7ee9e906 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -720,6 +720,7 @@ var map_AzurePlatformStatus = map[string]string{ "": "AzurePlatformStatus holds the current status of the Azure infrastructure provider.", "resourceGroupName": "resourceGroupName is the Resource Group for new Azure resources created for the cluster.", "networkResourceGroupName": "networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster. If empty, the value is same as ResourceGroupName.", + "cloudName": "cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK with the appropriate Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`.", } func (AzurePlatformStatus) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/api/operator/v1/0000_20_etcd-operator_01.crd.yaml b/vendor/github.com/openshift/api/operator/v1/0000_20_etcd-operator_01.crd.yaml new file mode 100644 index 0000000000..ad1eadc5fd --- /dev/null +++ b/vendor/github.com/openshift/api/operator/v1/0000_20_etcd-operator_01.crd.yaml @@ -0,0 +1,197 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: etcds.operator.openshift.io +spec: + scope: Cluster + group: operator.openshift.io + version: v1 + names: + kind: Etcd + plural: etcds + singular: etcd + categories: + - coreoperators + preserveUnknownFields: false + subresources: + status: {} + "validation": + "openAPIV3Schema": + description: Etcd provides information to configure an operator to manage kube-apiserver. + type: object + required: + - spec + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + type: object + properties: + failedRevisionLimit: + description: failedRevisionLimit is the number of failed static pod + installer revisions to keep on disk and in the api -1 = unlimited, + 0 or unset = 5 (default) + type: integer + format: int32 + forceRedeploymentReason: + description: forceRedeploymentReason can be used to force the redeployment + of the operand by providing a unique string. This provides a mechanism + to kick a previously failed deployment and provide a reason why you + think it will work this time instead of failing again on the same + config. + type: string + logLevel: + description: logLevel is an intent based logging for an overall component. It + does not give fine grained control, but it is a simple way to manage + coarse grained logging choices that operators have to interpret for + their operands. + type: string + managementState: + description: managementState indicates whether and how the operator + should manage the component + type: string + pattern: ^(Managed|Unmanaged|Force|Removed)$ + observedConfig: + description: observedConfig holds a sparse config that controller has + observed from the cluster state. It exists in spec because it is + an input to the level for the operator + type: object + nullable: true + x-kubernetes-preserve-unknown-fields: true + operatorLogLevel: + description: operatorLogLevel is an intent based logging for the operator + itself. It does not give fine grained control, but it is a simple + way to manage coarse grained logging choices that operators have to + interpret for themselves. + type: string + succeededRevisionLimit: + description: succeededRevisionLimit is the number of successful static + pod installer revisions to keep on disk and in the api -1 = unlimited, + 0 or unset = 5 (default) + type: integer + format: int32 + unsupportedConfigOverrides: + description: 'unsupportedConfigOverrides holds a sparse config that + will override any previously set options. It only needs to be the + fields to override it will end up overlaying in the following order: + 1. hardcoded defaults 2. observedConfig 3. unsupportedConfigOverrides' + type: object + nullable: true + x-kubernetes-preserve-unknown-fields: true + status: + type: object + properties: + conditions: + description: conditions is a list of conditions and their status + type: array + items: + description: OperatorCondition is just the standard condition fields. + type: object + properties: + lastTransitionTime: + type: string + format: date-time + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + generations: + description: generations are used to determine when an item needs to + be reconciled or has changed in a way that needs a reaction. + type: array + items: + description: GenerationStatus keeps track of the generation for a + given resource so that decisions about forced updates can be made. + type: object + properties: + group: + description: group is the group of the thing you're tracking + type: string + hash: + description: hash is an optional field set for resources without + generation that are content sensitive like secrets and configmaps + type: string + lastGeneration: + description: lastGeneration is the last generation of the workload + controller involved + type: integer + format: int64 + name: + description: name is the name of the thing you're tracking + type: string + namespace: + description: namespace is where the thing you're tracking is + type: string + resource: + description: resource is the resource type of the thing you're + tracking + type: string + latestAvailableRevision: + description: latestAvailableRevision is the deploymentID of the most + recent deployment + type: integer + format: int32 + latestAvailableRevisionReason: + description: latestAvailableRevisionReason describe the detailed reason + for the most recent deployment + type: string + nodeStatuses: + description: nodeStatuses track the deployment values and errors across + individual nodes + type: array + items: + description: NodeStatus provides information about the current state + of a particular node managed by this operator. + type: object + properties: + currentRevision: + description: currentRevision is the generation of the most recently + successful deployment + type: integer + format: int32 + lastFailedRevision: + description: lastFailedRevision is the generation of the deployment + we tried and failed to deploy. + type: integer + format: int32 + lastFailedRevisionErrors: + description: lastFailedRevisionErrors is a list of the errors + during the failed deployment referenced in lastFailedRevision + type: array + items: + type: string + nodeName: + description: nodeName is the name of the node + type: string + targetRevision: + description: targetRevision is the generation of the deployment + we're trying to apply + type: integer + format: int32 + observedGeneration: + description: observedGeneration is the last generation change you've + dealt with + type: integer + format: int64 + readyReplicas: + description: readyReplicas indicates how many replicas are ready and + at the desired state + type: integer + format: int32 + version: + description: version is the level this availability applies to + type: string diff --git a/vendor/modules.txt b/vendor/modules.txt index 260a01a500..1a11a8ed4e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -123,7 +123,7 @@ github.com/matttproud/golang_protobuf_extensions/pbutil github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 -# github.com/openshift/api v0.0.0-20200522173408-17ada6e4245b +# github.com/openshift/api v0.0.0-20200609191024-dca637550e8c github.com/openshift/api/config/v1 github.com/openshift/api/operator/v1 github.com/openshift/api/operatoringress/v1