Skip to content

References for intermediate ca creation#40

Closed
tschlaepfer wants to merge 8 commits intoupbound:mainfrom
tschlaepfer:references-for-intermediate-ca-creation
Closed

References for intermediate ca creation#40
tschlaepfer wants to merge 8 commits intoupbound:mainfrom
tschlaepfer:references-for-intermediate-ca-creation

Conversation

@tschlaepfer
Copy link

Description of your changes

This change introduces a new reference parameter for the SecretBackendRootSignIntermediate and SecretBackendIntermediateSetSigned objects which enables the creation of a CA certificate chain using the HashiCorp Vault provider.

For the SecretBackendRootSignIntermediate object, the new parameter allows to reference a SecretBackendIntermediateCertRequest object, from which the "csr" parameter is fetched.

For the SecretBackendIntermediateSetSigned object, the new parameter allows to reference a SecretBackendIntermediateSetSigned object, from which the "certificate" parameter is fetched.

The MR also includes an example of creating a CA chain using the new reference parameters.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review. -> But failed with golangci-lint error: panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

How has this code been tested

I ran the provider locally against my k8s cluster, where I deployed the ca-chain.yaml example provided in the MR. The code works as expected, I've attached two screenshots from the SecretBackendRootSignIntermediate & SecretBackendIntermediateSetSigned objects using the new csrRef and certificateRef parameters.

Screenshot 2024-07-09 at 08 56 07

Screenshot 2024-07-09 at 08 55 46

…ermediate ca certificate to a pki backend

Signed-off-by: Tobias Schlaepfer <tobias.schlaepfer@4data.ch>
Signed-off-by: Tobias Schlaepfer <tobias.schlaepfer@4data.ch>
@jeanduplessis
Copy link
Contributor

@tschlaepfer apologies for the delay in getting to this. If you're still interested in pushing this PR forward, would you mind rebasing this PR to resolve conflicts and validate it now that we've released v2.0.0 of the provider.

@tschlaepfer
Copy link
Author

@jeanduplessis Yes I'm happy to move this PR forward. However, I would need #50 to be merged first as I run into the same issue in my setup.

@sergenyalcin
Copy link
Member

@tschlaepfer #50 merged just now.

@tschlaepfer
Copy link
Author

@jeanduplessis, @sergenyalcin I have updated my branch with the latest code changes and have locally tested the provider. I can confirm that #50 fixes the authentication issue and my code is also working as expected with the latest changes.

Please review the changes and let me know if there are any issues with my code.

Screenshot 2025-01-10 at 17 22 21 Screenshot 2025-01-10 at 17 23 05

@jeanduplessis
Copy link
Contributor

@tschlaepfer would you mind having a look at the conflicts. Yo might need to rebase your branch on the latest in main and run make generate again.

@Upbound-CLA
Copy link

Upbound-CLA commented Jan 17, 2025

CLA assistant check
All committers have signed the CLA.

tschlaepfer and others added 4 commits January 17, 2025 08:22
@tschlaepfer
Copy link
Author

@jeanduplessis Any chance this gets merged into the provider any time soon?

@jeanduplessis
Copy link
Contributor

jeanduplessis commented Mar 13, 2025

@tschlaepfer it looks like you might need to run make revieweable and push any changes up to pass the lint and check-diff checks.

Signed-off-by: Tobias Schlaepfer <tobias.schlaepfer@iothentix.ch>
@tschlaepfer
Copy link
Author

@jeanduplessis Thanks for the quick reply, I have updated the branch with the changes from make reviewable

@jeanduplessis
Copy link
Contributor

@tschlaepfer I checked out your branch locally and ran make reviewable and I see the same diff as reported in the check-diff action. These changes must be part of your PR as well.

Did you by any chance edit these generated files manually in your branch?

CleanShot 2025-03-14 at 11 06 29@2x

@tschlaepfer
Copy link
Author

@jeanduplessis No I have not manually updated these files: I did run make generate as well as make reviewable but if I look at the file changes of my PR, these changes are included.

@jeanduplessis
Copy link
Contributor

@sergenyalcin @turkenf any idea what could be happening here?

@turkenf
Copy link
Contributor

turkenf commented Mar 14, 2025

@tschlaepfer, problems like this can usually be caused by incompatibilities between the project and the local environment. First, please check your go version.

@tschlaepfer
Copy link
Author

@jeanduplessis @turkenf I checked my environment, I have GOTOOLCHAIN set to go1.23.6 and on my host I also use go@1.23 (installed with brew). I'm not a Go expert please let me know if there is any other place I should check.

Is it possible that the tests are using the wrong Go version? If I look at the output of the pipeline I see Go 1.21 used, but the Makefile specifies 1.23 as required.
Screenshot 2025-03-14 at 13 03 31

@turkenf
Copy link
Contributor

turkenf commented Mar 14, 2025

Is it possible that the tests are using the wrong Go version? If I look at the output of the pipeline I see Go 1.21 used, but the Makefile specifies 1.23 as required.

I don't think the problem stems from that, if it was, the diff wouldn't have been visible in Jean's local env.
I looked at the commits and it seems like diffs appeared while resolving conflicts. My advice to you is to save your changes, reset your branch to main, add your changes again and run make generate.

@tschlaepfer
Copy link
Author

Replaced by #73

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants