Skip to content

Commit 34ff167

Browse files
authored
Merge d922417 into 779a221
2 parents 779a221 + d922417 commit 34ff167

File tree

14 files changed

+558
-86
lines changed

14 files changed

+558
-86
lines changed

.github/workflows/keyfactor-bootstrap-workflow.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313

1414
build:
15-
name: Build and Lint
15+
name: Build and Check CRDs
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 8
1818
steps:
@@ -23,11 +23,17 @@ jobs:
2323
cache: true
2424
- run: go mod download
2525
- run: go build -v ./cmd/main.go
26+
- name: Regenerate CRDs
27+
run: make generate manifests
28+
- name: Check for CRD drift
29+
run: |
30+
git diff --compact-summary --exit-code || \
31+
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate manifests' and commit."; exit 1)
2632
# - name: Run linters
2733
# uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
2834
# with:
2935
# version: latest
30-
36+
3137
test:
3238
name: Go Test
3339
needs: build

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v2.3.2
2+
## Features
3+
- Add a `healthCheckIntervalSeconds` specification to Issuer / ClusterIssuer resources, allowing flexibility in the health check interval.
4+
15
# v2.3.1
26
## Fixes
37
- Add a manual dispatch of Helm chart release.

api/v1alpha1/issuer_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ type IssuerSpec struct {
4646
// +kubebuilder:default:=KeyfactorAPI
4747
APIPath string `json:"apiPath,omitempty"`
4848

49+
// The number of seconds between successful health checks. 60 seconds (1 minute) by default. Setting to 0 will disable the health check.
50+
// +kubebuilder:default:=60
51+
HealthCheckIntervalSeconds *int `json:"healthCheckIntervalSeconds,omitempty"`
52+
4953
// EnrollmentPatternId is the ID of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
5054
// If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
5155
// If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/command-issuer.keyfactor.com_clusterissuers.yaml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,58 +68,64 @@ spec:
6868
CertificateAuthorityLogicalName is the logical name of the certificate authority to use
6969
E.g. "Keyfactor Root CA" or "Intermediate CA"
7070
type: string
71+
certificateTemplate:
72+
description: |-
73+
Deprecated. CertificateTemplate is the name of the certificate template to use. If using Keyfactor Command 25.1 or later, use EnrollmentPatternName or EnrollmentPatternId instead.
74+
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75+
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
76+
Refer to the Keyfactor Command documentation for more information.
77+
type: string
78+
commandSecretName:
79+
description: |-
80+
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
81+
credentials for the Command instance configured in Hostname. The secret must
82+
be in the same namespace as the referent. If the
83+
referent is a ClusterIssuer, the reference instead refers to the resource
84+
with the given name in the configured 'cluster resource namespace', which
85+
is set as a flag on the controller component (and defaults to the
86+
namespace that the controller runs in).
87+
type: string
7188
enrollmentPatternId:
7289
description: |-
7390
EnrollmentPatternId is the ID of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
7491
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
92+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
7693
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
7794
Refer to the Keyfactor Command documentation for more information.
78-
type: integer
7995
format: int32
96+
type: integer
8097
enrollmentPatternName:
8198
description: |-
8299
EnrollmentPatternName is the name of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
83100
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
84-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
101+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
85102
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
86103
Refer to the Keyfactor Command documentation for more information.
87104
type: string
105+
healthCheckIntervalSeconds:
106+
default: 60
107+
description: The number of seconds between successful health checks.
108+
60 seconds (1 minute) by default. Setting to 0 will disable the
109+
health check.
110+
type: integer
111+
hostname:
112+
description: Hostname is the hostname of a Keyfactor Command instance.
113+
type: string
88114
ownerRoleId:
89115
description: |-
90116
OwnerRoleId is the ID of the security role assigned as the certificate owner.
91117
The specified security role must be assigned to the authorized identity context.
92118
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
93119
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
94-
type: integer
95120
format: int32
121+
type: integer
96122
ownerRoleName:
97123
description: |-
98124
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
99125
The specified security role must be assigned to the authorized identity context.
100126
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
101127
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
102128
type: string
103-
certificateTemplate:
104-
description: |-
105-
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.
106-
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
107-
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
108-
Refer to the Keyfactor Command documentation for more information.
109-
type: string
110-
commandSecretName:
111-
description: |-
112-
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
113-
credentials for the Command instance configured in Hostname. The secret must
114-
be in the same namespace as the referent. If the
115-
referent is a ClusterIssuer, the reference instead refers to the resource
116-
with the given name in the configured 'cluster resource namespace', which
117-
is set as a flag on the controller component (and defaults to the
118-
namespace that the controller runs in).
119-
type: string
120-
hostname:
121-
description: Hostname is the hostname of a Keyfactor Command instance.
122-
type: string
123129
scopes:
124130
description: |-
125131
A list of comma separated scopes used when requesting a Bearer token from an ambient token provider implied

config/crd/bases/command-issuer.keyfactor.com_issuers.yaml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,58 +68,64 @@ spec:
6868
CertificateAuthorityLogicalName is the logical name of the certificate authority to use
6969
E.g. "Keyfactor Root CA" or "Intermediate CA"
7070
type: string
71+
certificateTemplate:
72+
description: |-
73+
Deprecated. CertificateTemplate is the name of the certificate template to use. If using Keyfactor Command 25.1 or later, use EnrollmentPatternName or EnrollmentPatternId instead.
74+
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75+
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
76+
Refer to the Keyfactor Command documentation for more information.
77+
type: string
78+
commandSecretName:
79+
description: |-
80+
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
81+
credentials for the Command instance configured in Hostname. The secret must
82+
be in the same namespace as the referent. If the
83+
referent is a ClusterIssuer, the reference instead refers to the resource
84+
with the given name in the configured 'cluster resource namespace', which
85+
is set as a flag on the controller component (and defaults to the
86+
namespace that the controller runs in).
87+
type: string
7188
enrollmentPatternId:
7289
description: |-
7390
EnrollmentPatternId is the ID of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
7491
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
92+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
7693
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
7794
Refer to the Keyfactor Command documentation for more information.
78-
type: integer
7995
format: int32
96+
type: integer
8097
enrollmentPatternName:
8198
description: |-
8299
EnrollmentPatternName is the name of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
83100
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
84-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
101+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
85102
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
86103
Refer to the Keyfactor Command documentation for more information.
87104
type: string
105+
healthCheckIntervalSeconds:
106+
default: 60
107+
description: The number of seconds between successful health checks.
108+
60 seconds (1 minute) by default. Setting to 0 will disable the
109+
health check.
110+
type: integer
111+
hostname:
112+
description: Hostname is the hostname of a Keyfactor Command instance.
113+
type: string
88114
ownerRoleId:
89115
description: |-
90116
OwnerRoleId is the ID of the security role assigned as the certificate owner.
91117
The specified security role must be assigned to the authorized identity context.
92118
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
93119
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
94-
type: integer
95120
format: int32
121+
type: integer
96122
ownerRoleName:
97123
description: |-
98124
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
99125
The specified security role must be assigned to the authorized identity context.
100126
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
101127
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
102128
type: string
103-
certificateTemplate:
104-
description: |-
105-
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.
106-
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
107-
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
108-
Refer to the Keyfactor Command documentation for more information.
109-
type: string
110-
commandSecretName:
111-
description: |-
112-
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
113-
credentials for the Command instance configured in Hostname. The secret must
114-
be in the same namespace as the referent. If the
115-
referent is a ClusterIssuer, the reference instead refers to the resource
116-
with the given name in the configured 'cluster resource namespace', which
117-
is set as a flag on the controller component (and defaults to the
118-
namespace that the controller runs in).
119-
type: string
120-
hostname:
121-
description: Hostname is the hostname of a Keyfactor Command instance.
122-
type: string
123129
scopes:
124130
description: |-
125131
A list of comma separated scopes used when requesting a Bearer token from an ambient token provider implied

deploy/charts/command-cert-manager-issuer/templates/crds/clusterissuers.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ spec:
7979
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8080
Refer to the Keyfactor Command documentation for more information.
8181
type: string
82+
healthCheckIntervalSeconds:
83+
default: 60
84+
description: The number of seconds between successful health checks.
85+
60 seconds (1 minute) by default. Setting to 0 will disable the
86+
health check.
87+
type: integer
8288
ownerRoleId:
8389
description: |-
8490
OwnerRoleId is the ID of the security role assigned as the certificate owner.

deploy/charts/command-cert-manager-issuer/templates/crds/issuers.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ spec:
7979
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8080
Refer to the Keyfactor Command documentation for more information.
8181
type: string
82+
healthCheckIntervalSeconds:
83+
default: 60
84+
description: The number of seconds between successful health checks.
85+
60 seconds (1 minute) by default. Setting to 0 will disable the
86+
health check.
87+
type: integer
8288
ownerRoleId:
8389
description: |-
8490
OwnerRoleId is the ID of the security role assigned as the certificate owner.

docsource/content.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
219219
| ownerRoleName | The name of the security role assigned as the certificate owner. The security role must be assigned to the identity context of the issuer. If `ownerRoleId` and `ownerRoleName` are both specified, `ownerRoleId` will take precedence. This field is **required** if the enrollment pattern, certificate template, or system-wide setting requires it. |
220220
| scopes | (Optional) Required if using ambient credentials with Azure AKS. If using ambient credentials, these scopes will be put on the access token generated by the ambient credentials' token provider, if applicable. |
221221
| audience | (Optional) If using ambient credentials, this audience will be put on the access token generated by the ambient credentials' token provider, if applicable. Google's ambient credential token provider generates an OIDC ID Token. If this value is not provided, it will default to `command`. |
222+
| healthCheckIntervalSeconds | (Optional) Defines the health check interval, in seconds, for a healthy issuer. If ommitted, defaults to 60 seconds. If set to 0, it will disable the health check. If there is a failure when running the health check, it will retry in 10 seconds with an exponential backoff strategy. Value must not be negative. |
222223
223224
> If a different combination of hostname/certificate authority/certificate template is required, a new Issuer or ClusterIssuer resource must be created. Each resource instantiation represents a single configuration.
224225
@@ -250,6 +251,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
250251
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
251252
# scopes: "openid email https://example.com/.default" # Uncomment if required
252253
# audience: "https://your-command-url.com" # Uncomment if desired
254+
# healthCheckIntervalSeconds: 60 # Uncomment if desired. Setting to 0 disables health check.
253255
EOF
254256
255257
kubectl -n default apply -f issuer.yaml
@@ -280,6 +282,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
280282
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
281283
# scopes: "openid email https://example.com/.default" # Uncomment if required
282284
# audience: "https://your-command-url.com" # Uncomment if desired
285+
# healthCheckIntervalSeconds: 60 # Uncomment if desired. Setting to 0 disables health check.
283286
EOF
284287
285288
kubectl apply -f clusterissuer.yaml

e2e/.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ export CERTIFICATE_AUTHORITY_LOGICAL_NAME="Sub-CA"
77

88
export OAUTH_TOKEN_URL="https://example.com/oauth2/token"
99
export OAUTH_CLIENT_ID="changeme"
10-
export OAUTH_CLIENT_SECRET='changeme'
10+
export OAUTH_CLIENT_SECRET='changeme'
11+
export OAUTH_SCOPES='optional' # remove if not needed
12+
export OAUTH_AUDIENCE='optional' # remove if not needed

0 commit comments

Comments
 (0)