Skip to content

Commit

Permalink
Merge pull request #146 from hamza3202/feature/add-support-for-azure-dns
Browse files Browse the repository at this point in the history
Add support for Azure DNS Zone
  • Loading branch information
openshift-merge-robot committed May 27, 2020
2 parents 0ea358a + ca2ebf6 commit 5c76c30
Show file tree
Hide file tree
Showing 9,364 changed files with 6,446,665 additions and 9 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
76 changes: 72 additions & 4 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ required = [
name = "github.com/openshift/hive"
# latest Hive master branch
revision = "571a9efe4fbe8f0bf5546292025a503558dfa139"

[[constraint]]
name = "github.com/Azure/azure-sdk-for-go"
version = "42.2.0"
12 changes: 12 additions & 0 deletions deploy/crds/certman_v1alpha1_certificaterequest_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ spec:
required:
- credentials
type: object
azure:
properties:
credentials:
description: Credentials refers to a secret that contains the
Azure account access credentials.
type: object
resourceGroupName:
description: The name of the resource group in which the dns zone is created.
type: string
required:
- credentials
- resourceGroupName
type: object
renewBeforeDays:
description: Reissue certificate before expiration duration in days.
Expand Down
14 changes: 12 additions & 2 deletions pkg/apis/certman/v1alpha1/certificaterequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ type CertificateRequestList struct {

// Platform defines information used by various clouds.
type Platform struct {
AWS *AWSPlatformSecrets `json:"aws,omitempty"`
GCP *GCPPlatformSecrets `json:"gcp,omitempty"`
AWS *AWSPlatformSecrets `json:"aws,omitempty"`
GCP *GCPPlatformSecrets `json:"gcp,omitempty"`
Azure *AzurePlatformSecrets `json:"azure,omitempty"`
}

// AWSPlatformSecrets contains secrets for clusters on the AWS platform.
Expand All @@ -166,6 +167,15 @@ type GCPPlatformSecrets struct {
Credentials corev1.LocalObjectReference `json:"credentials"`
}

// AzurePlatformSecrets contains secrets for clusters on the Azure platform.
type AzurePlatformSecrets struct {
// Credentials refers to a secret that contains the AZURE account access credentials.
Credentials corev1.LocalObjectReference `json:"credentials"`

// ResourceGroupName refers to the resource group that contains the dns zone.
ResourceGroupName string `json:"resourceGroupName"`
}

const (
// CertmanOperatorFinalizerLabel is a K8's finalizer. An arbitray string that when
// present ensures a hard delete of a resource is not possible.
Expand Down
4 changes: 4 additions & 0 deletions pkg/clients/aws/route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func (c *awsClient) createR53TXTRecordChange(name *string, action string, value
return change, nil
}

func (c *awsClient) GetDNSName() string {
return "Route53"
}

func (c *awsClient) AnswerDNSChallenge(reqLogger logr.Logger, acmeChallengeToken string, domain string, cr *certmanv1alpha1.CertificateRequest) (fqdn string, err error) {
fqdn = fmt.Sprintf("%s.%s", cTypes.AcmeChallengeSubDomain, domain)
reqLogger.Info(fmt.Sprintf("fqdn acme challenge domain is %v", fqdn))
Expand Down
Loading

0 comments on commit 5c76c30

Please sign in to comment.