Skip to content

Commit

Permalink
Add privaceacm client check
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Yarmoluk <[email protected]>
  • Loading branch information
gordonbondon committed Jun 11, 2019
1 parent 7d46bec commit a3ade04
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pkg/issuer/privateACM/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import (
)

const (
errorPrivateACM = "PrivateACMError"
messagePrivateACMConfigRequired = "Private ACM config cannot be empty"
messageCertAuthorityARNRequired = "Certificate Authority ARN cannot be empty"
successPrivateACMVerified = "KeyPairVerified"
messagePrivateACMVerified = "Private ACM Verified"
errorPrivateACM = "PrivateACMError"
messagePrivateACMConfigRequired = "Private ACM config cannot be empty"
messageCertAuthorityARNRequired = "Certificate Authority ARN cannot be empty"
messagePrivateACMClientInitFailed = "Failed to initialize PrivateACM client: "
successPrivateACMVerified = "KeyPairVerified"
messagePrivateACMVerified = "Private ACM Verified"
)

func (acm *PrivateACM) Setup(ctx context.Context) error {
Expand All @@ -45,6 +46,14 @@ func (acm *PrivateACM) Setup(ctx context.Context) error {
return nil
}

_, err := acm.initAWSPCAClient()
if err != nil {
s := messagePrivateACMClientInitFailed + err.Error()
klog.V(4).Infof("%s: %s", acm.issuer.GetObjectMeta().Name, s)
apiutil.SetIssuerCondition(acm.issuer, v1alpha1.IssuerConditionReady, v1alpha1.ConditionFalse, errorPrivateACM, s)
return err
}

klog.Info(successPrivateACMVerified)
apiutil.SetIssuerCondition(acm.issuer, v1alpha1.IssuerConditionReady, v1alpha1.ConditionTrue, successPrivateACMVerified, messagePrivateACMVerified)
return nil
Expand Down

0 comments on commit a3ade04

Please sign in to comment.