-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: make provider compatible with Argo CD 2.12 #472
Conversation
The test fails with a weird error. I assume code-changes are required to get this working. Will dig into it. |
9e47057
to
c038320
Compare
c038320
to
fe4dfa5
Compare
90146db
to
a54d8a2
Compare
Finally the Now we have another error regarding this attribute check. Reading the repository we just created reveals all Did Argo CD 2.12 change the behaviour what is returned when the connection state is not successful? (in that case we could remove the attribute check). Also this comment might be related. @blakepettersson do you have an idea why Argo CD doesn't return these attributes on a created repository in 2.12? |
@the-technat I suspect the issue may be that within resourceArgoCDRepositoryRead you'd need to pass in the appproject pertaining to the repository, like this r, err := si.RepositoryClient.Get(ctx, &repository.RepoQuery{
Repo: d.Id(),
ForceRefresh: true,
AppProject: project,
}) (although IIRC this is only required if more than one repository is using the same repo url 🤔) |
3fd290f
to
5bf502f
Compare
I did some more investigations and think I have nailed the problem to something concrete here. ReproduceIn the provider repo: Obtain a session token using: export ARGOCD_TOKEN=$(curl -sSL -k \
-X POST \
-H "Content-type: application/json" \
https://127.0.0.1:8080/api/v1/session \
-d $'{"username":"admin","password":"acceptancetesting"}' \
| jq '.token' \
| tr -d '"') Connect a repository using this command: curl -k -H "Content-type: application/json" \
-H "Authorization: Bearer $ARGOCD_TOKEN" \
https://127.0.0.1:8080/api/v1/repositories \
-d @repo.json {
"githubAppEnterpriseBaseUrl": "https://ghe.example.com/api/v3",
"githubAppID": 123456,
"githubAppInstallationID": 987654321,
"githubAppPrivateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAzy5BqPJL78Igv0M9131OfQbCOUCJXYZsIs3Lx+24ITN2WPU5\nSYLH/kZs3z5LJ11IAySC8AHGJBKfcWbgAL7brqZEjfZafWjoC44tH4/iXj5g2GY6\nGtuaQUC4oVx5JHQMVDp3GCL/mk9XVARf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JLpxgsCTJGPCjs\nSjht1wDgAwZ604TzuLk7qQKBgEgtNqvtWZYLYEdsFuaDf9lZLWoMJPxGv6DaXRXE\nMx6bmc1smpjW2H/gnySa9pJwjnpm29vLrW47/oaV34crLhOvIUQsOmYIG+gUKz2c\n4zCa5HYGKus/f43que7oS3UBFz0aerHoHoTQ2RQscFf2ny8e7hHMjrrZ4+31K965\nwfo5AoGAPm6SVmM3DAOiP0hntJk5tFj1VonePFM6qUycPUKyg1CxlOSlA4HcPbhb\n3uCXoSZa+cLUEZ7eO7I41sQlndXr4CRCdd68bW3ZCyYJuHxDHlA/yzgc3xWKb9Jz\nxSpPFKrgWsBd1llTHK0zCB53unPBQB7DJW3XL5/z8o5pOyDhf1A=\n-----END RSA PRIVATE KEY-----\n",
"project": "default",
"repo": "https://private-git-repository.argocd.svc.cluster.local/project-1.git",
"type": "git"
} Note: the dummy-data for this repo are taken from the failed acceptance test. Then get the same repository using this command: curl -k -H "Content-type: application/json" \
-H "Authorization: Bearer $ARGOCD_TOKEN" \
https://127.0.0.1:8080/api/v1/repositories/https%3A%2F%2Fprivate-git-repository.argocd.svc.cluster.local%2Fproject-1.git Reponse from 2.12.7: {
"repo": "https://private-git-repository.argocd.svc.cluster.local/project-1.git",
"connectionState": {
"status": "Failed",
"message": "Unable to connect to repository: rpc error: code = Unknown desc = error testing repository connectivity: could not refresh installation id 987654321's token: could not get access_tokens from GitHub API for installation ID 987654321: dial tcp: lookup ghe.example.com on 10.96.0.10:53: no such host",
"attemptedAt": "2024-11-17T10:55:07Z"
},
"type": "git",
"project": "default"
} Response from 2.11.12: {
"repo": "https://private-git-repository.argocd.svc.cluster.local/project-1.git",
"connectionState": {
"status": "Failed",
"message": "Unable to connect to repository: rpc error: code = Unknown desc = error testing repository connectivity: could not refresh installation id 987654321's token: could not get access_tokens from GitHub API for installation ID 987654321: dial tcp: lookup ghe.example.com on 10.96.0.10:53: no such host",
"attemptedAt": "2024-11-17T10:59:23Z"
},
"type": "git",
"githubAppID": 123456,
"githubAppInstallationID": 987654321,
"githubAppEnterpriseBaseUrl": "https://ghe.example.com/api/v3",
"project": "default"
} AnalysisAs one can see 2.11.12 returns the Reading the release notes that changed between 2.11 and 2.12 the following change seems related: cluster-secret-scoping-changes but hasn't been verified so far. Other things I tried so far:
This leaves me with the question how to proceed with our tests in the provider:
|
49f811a
to
8195c52
Compare
@the-technat try out 2.12.8 |
7d596a4
to
e15ec86
Compare
e15ec86
to
8e13e9a
Compare
Signed-off-by: Nathanael Liechti <technat@technat.ch>
8e13e9a
to
aea6545
Compare
@blakepettersson with v2.12.8 the tests finally pass! |
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: Nathanael Liechti <technat@technat.ch>
Adds support for Argo CD 2.12 to the provider.
Changes: