Skip to content

Commit e8666e1

Browse files
authored
Update customUpdateCertificateAuthorityActivation (#51)
Description of changes: 1. Remove check if status is ACTIVE or DISABLED before calling UpdateCertificateAuthority. This isn't needed because UpdateCertificateAuthority will return an InvalidArgsException if the status is not ACTIVE or DISABLED. 2. Release artifacts for release v0.0.13 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e07bb9e commit e8666e1

File tree

7 files changed

+9
-22
lines changed

7 files changed

+9
-22
lines changed

config/controller/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ kind: Kustomization
66
images:
77
- name: controller
88
newName: public.ecr.aws/aws-controllers-k8s/acmpca-controller
9-
newTag: 0.0.12
9+
newTag: 0.0.13

helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
name: acmpca-chart
33
description: A Helm chart for the ACK service controller for AWS Private Certificate Authority (PCA)
4-
version: 0.0.12
5-
appVersion: 0.0.12
4+
version: 0.0.13
5+
appVersion: 0.0.13
66
home: https://github.com/aws-controllers-k8s/acmpca-controller
77
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
88
sources:

helm/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ .Chart.Name }} has been installed.
2-
This chart deploys "public.ecr.aws/aws-controllers-k8s/acmpca-controller:0.0.12".
2+
This chart deploys "public.ecr.aws/aws-controllers-k8s/acmpca-controller:0.0.13".
33

44
Check its status by running:
55
kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}"

helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
image:
66
repository: public.ecr.aws/aws-controllers-k8s/acmpca-controller
7-
tag: 0.0.12
7+
tag: 0.0.13
88
pullPolicy: IfNotPresent
99
pullSecrets: []
1010

pkg/resource/certificate_authority_activation/hooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (rm *resourceManager) customUpdateCertificateAuthorityActivation(
8383
input.SetCertificateAuthorityArn(*desired.ko.Spec.CertificateAuthorityARN)
8484
}
8585

86-
if desired.ko.Spec.Status != nil && (*desired.ko.Spec.Status == svcsdk.CertificateAuthorityStatusActive || *desired.ko.Spec.Status == svcsdk.CertificateAuthorityStatusDisabled) {
86+
if desired.ko.Spec.Status != nil {
8787
input.SetStatus(*desired.ko.Spec.Status)
8888
}
8989

test/e2e/tests/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ def disable_active_ca(self, ca_arn: str):
6868
ca = aws_res["CertificateAuthority"]
6969
logging.info(ca["Status"])
7070
assert ca["Status"] == "DISABLED"
71-
except self.acmpca_client.exceptions.ClientError:
72-
pass
71+
except self.acmpca_client.exceptions.ClientError as error:
72+
return error

test/e2e/tests/test_ca_activation.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def simple_certificate_authority(acmpca_client):
9494

9595
#Disable CA if status is ACTIVE
9696
acmpca_validator = ACMPCAValidator(acmpca_client)
97-
acmpca_validator.disable_active_ca(ca_resource_arn)
97+
assert acmpca_validator.disable_active_ca(ca_resource_arn) is None
9898

9999
#Delete CA k8s resource
100100
_, deleted = k8s.delete_custom_resource(ca_ref)
@@ -557,19 +557,6 @@ def test_activation_crud(self, acmpca_client, simple_root_certificate, create_ce
557557
# Check CA status is ACTIVE
558558
acmpca_validator.assert_certificate_authority(ca_arn, "ACTIVE")
559559

560-
# Update Status to PENDING_CERTIFICATE
561-
updates = {
562-
"spec": {
563-
"status": "PENDING_CERTIFICATE"
564-
},
565-
}
566-
patch_res = k8s.patch_custom_resource(act_ref, updates)
567-
logging.info(patch_res)
568-
time.sleep(UPDATE_WAIT_AFTER_SECONDS)
569-
570-
# Check CA status is still ACTIVE
571-
acmpca_validator.assert_certificate_authority(ca_arn, "ACTIVE")
572-
573560
#Delete CAActivation k8s resource
574561
_, deleted = k8s.delete_custom_resource(act_ref)
575562
assert deleted is True

0 commit comments

Comments
 (0)