Skip to content

Do not update subjectName/CA on existing certificate #36717

Description

@ksykulev

During gitops flows, if the user changes the subjectName or the certificate authority on an existing certificate, we should delete the old certificate, and insert a new ones.


💥  Actual behavior

Currently the old certificate just gets an updated subjectName:

> select * from certificate_templates;
*************************** 1. row ***************************
                      id: 6
                 team_id: 13
certificate_authority_id: 1
                    name: wifi-certificate
            subject_name: /CN=$FLEET_VAR_HOST_END_USER_IDP_USERNAME/OU=$FLEET_VAR_HOST_UUID/ST=$FLEET_VAR_HOST_HARDWARE_SERIAL
              created_at: 2025-12-04 22:27:29
              updated_at: 2025-12-04 22:27:29
1 row in set (0.01 sec)

change name and run gitops

> select * from certificate_templates;
*************************** 1. row ***************************
                      id: 6
                 team_id: 13
certificate_authority_id: 1
                    name: wifi-certificate
            subject_name: /CN=$FLEET_VAR_HOST_END_USER_IDP_USERNAME/OU=$FLEET_VAR_HOST_UUID/ST=$FLEET_VAR_HOST_HARDWARE_SERIAL/moresubjectstuff
              created_at: 2025-12-04 22:27:29
              updated_at: 2025-12-04 22:27:52
1 row in set (0.00 sec)

This is the same problem with certificate authorities.

🛠️ To fix

Delete old certificate_template and create a new one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

#g-orchestrationOrchestration product groupbugSomething isn't working as documented~sub-taskA technical sub-task that is part of a story. (Not QA'd. Not estimated.)

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions