-
Notifications
You must be signed in to change notification settings - Fork 7k
feat(health): add PushSecret health status and force-sync action #14375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bfcbdbb
feat(health): add `PushSecret` health status
agaudreault b3c29fd
add status healthy
agaudreault 2082cb6
Push action
agaudreault 9fb250a
Merge branch 'master' into pushsecret-health
agaudreault 6619e4d
fix test
agaudreault 7ad4a1c
Merge branch 'pushsecret-health' of github.com:agaudreault-jive/argo-…
agaudreault b1438d1
Merge branch 'master' into pushsecret-health
agaudreault 454b106
Merge branch 'master' into pushsecret-health
agaudreault 34062d3
Merge branch 'master' into pushsecret-health
agaudreault File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
resource_customizations/external-secrets.io/PushSecret/actions/action_test.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| actionTests: | ||
| - action: push | ||
| inputPath: testdata/push-secret.yaml | ||
| expectedOutputPath: testdata/push-secret-updated.yaml |
3 changes: 3 additions & 0 deletions
3
resource_customizations/external-secrets.io/PushSecret/actions/discovery.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| actions = {} | ||
| actions["push"] = {["disabled"] = false} | ||
| return actions | ||
6 changes: 6 additions & 0 deletions
6
resource_customizations/external-secrets.io/PushSecret/actions/push/action.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| local os = require("os") | ||
| if obj.metadata.annotations == nil then | ||
| obj.metadata.annotations = {} | ||
| end | ||
| obj.metadata.annotations["force-sync"] = os.date("!%Y-%m-%dT%XZ") | ||
| return obj |
41 changes: 41 additions & 0 deletions
41
...e_customizations/external-secrets.io/PushSecret/actions/testdata/push-secret-updated.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| apiVersion: external-secrets.io/v1alpha1 | ||
| kind: PushSecret | ||
| metadata: | ||
| annotations: | ||
| force-sync: '0001-01-01T00:00:00Z' | ||
| creationTimestamp: '2023-07-05T20:49:16Z' | ||
| generation: 1 | ||
| name: test-healthy | ||
| namespace: external-secret | ||
| resourceVersion: '777692391' | ||
| uid: 88cb613a-07b0-4fb2-8fdb-d5a5a9c2c917 | ||
| spec: | ||
| data: | ||
| - match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test | ||
| deletionPolicy: None | ||
| refreshInterval: 5m | ||
| secretStoreRefs: | ||
| - kind: ClusterSecretStore | ||
| name: my-store | ||
| selector: | ||
| secret: | ||
| name: existing-secret | ||
| status: | ||
| conditions: | ||
| - lastTransitionTime: '2023-07-05T20:49:16Z' | ||
| message: PushSecret synced successfully | ||
| reason: Synced | ||
| status: 'True' | ||
| type: Ready | ||
| syncedPushSecrets: | ||
| ClusterSecretStore/my-store: | ||
| remote/path/test: | ||
| match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test |
39 changes: 39 additions & 0 deletions
39
resource_customizations/external-secrets.io/PushSecret/actions/testdata/push-secret.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| apiVersion: external-secrets.io/v1alpha1 | ||
| kind: PushSecret | ||
| metadata: | ||
| creationTimestamp: '2023-07-05T20:49:16Z' | ||
| generation: 1 | ||
| name: test-healthy | ||
| namespace: external-secret | ||
| resourceVersion: '777692391' | ||
| uid: 88cb613a-07b0-4fb2-8fdb-d5a5a9c2c917 | ||
| spec: | ||
| data: | ||
| - match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test | ||
| deletionPolicy: None | ||
| refreshInterval: 5m | ||
| secretStoreRefs: | ||
| - kind: ClusterSecretStore | ||
| name: my-store | ||
| selector: | ||
| secret: | ||
| name: existing-secret | ||
| status: | ||
| conditions: | ||
| - lastTransitionTime: '2023-07-05T20:49:16Z' | ||
| message: PushSecret synced successfully | ||
| reason: Synced | ||
| status: 'True' | ||
| type: Ready | ||
| syncedPushSecrets: | ||
| ClusterSecretStore/my-store: | ||
| remote/path/test: | ||
| match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test |
20 changes: 20 additions & 0 deletions
20
resource_customizations/external-secrets.io/PushSecret/health.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| hs = {} | ||
| if obj.status ~= nil then | ||
| if obj.status.conditions ~= nil then | ||
| for i, condition in ipairs(obj.status.conditions) do | ||
| if condition.type == "Ready" and condition.status == "False" then | ||
| hs.status = "Degraded" | ||
| hs.message = condition.message | ||
| return hs | ||
| end | ||
| if condition.type == "Ready" and condition.status == "True" then | ||
| hs.status = "Healthy" | ||
| hs.message = condition.message | ||
| return hs | ||
| end | ||
| end | ||
| end | ||
| end | ||
| hs.status = "Progressing" | ||
| hs.message = "Waiting for PushSecret" | ||
| return hs |
13 changes: 13 additions & 0 deletions
13
resource_customizations/external-secrets.io/PushSecret/health_test.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| tests: | ||
| - healthStatus: | ||
| status: Progressing | ||
| message: Waiting for PushSecret | ||
| inputPath: testdata/progressing.yaml | ||
| - healthStatus: | ||
| status: Degraded | ||
| message: 'set secret failed: could not write remote ref test to target secretstore my-store: Error making API request.' | ||
| inputPath: testdata/degraded.yaml | ||
| - healthStatus: | ||
| status: Healthy | ||
| message: 'PushSecret synced successfully' | ||
| inputPath: testdata/healthy.yaml |
33 changes: 33 additions & 0 deletions
33
resource_customizations/external-secrets.io/PushSecret/testdata/degraded.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| apiVersion: external-secrets.io/v1alpha1 | ||
| kind: PushSecret | ||
| metadata: | ||
| creationTimestamp: '2023-07-05T20:49:16Z' | ||
| generation: 1 | ||
| name: test-degraded | ||
| namespace: external-secret | ||
| resourceVersion: '777692391' | ||
| uid: 88cb613a-07b0-4fb2-8fdb-d5a5a9c2c917 | ||
| spec: | ||
| data: | ||
| - match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test | ||
| deletionPolicy: None | ||
| refreshInterval: 5m | ||
| secretStoreRefs: | ||
| - kind: ClusterSecretStore | ||
| name: my-store | ||
| selector: | ||
| secret: | ||
| name: existing-secret | ||
| status: | ||
| conditions: | ||
| - lastTransitionTime: '2023-07-05T20:49:16Z' | ||
| message: 'set secret failed: could not write remote ref test to target secretstore my-store: Error making API request.' | ||
| reason: Errored | ||
| status: 'False' | ||
| type: Ready | ||
| syncedPushSecrets: | ||
| ClusterSecretStore/my-store: {} |
39 changes: 39 additions & 0 deletions
39
resource_customizations/external-secrets.io/PushSecret/testdata/healthy.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| apiVersion: external-secrets.io/v1alpha1 | ||
| kind: PushSecret | ||
| metadata: | ||
| creationTimestamp: '2023-07-05T20:49:16Z' | ||
| generation: 1 | ||
| name: test-healthy | ||
| namespace: external-secret | ||
| resourceVersion: '777692391' | ||
| uid: 88cb613a-07b0-4fb2-8fdb-d5a5a9c2c917 | ||
| spec: | ||
| data: | ||
| - match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test | ||
| deletionPolicy: None | ||
| refreshInterval: 5m | ||
| secretStoreRefs: | ||
| - kind: ClusterSecretStore | ||
| name: my-store | ||
| selector: | ||
| secret: | ||
| name: existing-secret | ||
| status: | ||
| conditions: | ||
| - lastTransitionTime: '2023-07-05T20:49:16Z' | ||
| message: PushSecret synced successfully | ||
| reason: Synced | ||
| status: 'True' | ||
| type: Ready | ||
| syncedPushSecrets: | ||
| ClusterSecretStore/my-store: | ||
| remote/path/test: | ||
| match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test |
24 changes: 24 additions & 0 deletions
24
resource_customizations/external-secrets.io/PushSecret/testdata/progressing.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| apiVersion: external-secrets.io/v1alpha1 | ||
| kind: PushSecret | ||
| metadata: | ||
| creationTimestamp: '2023-07-05T20:49:16Z' | ||
| generation: 1 | ||
| name: test-progressing | ||
| namespace: external-secret | ||
| resourceVersion: '777692391' | ||
| uid: 88cb613a-07b0-4fb2-8fdb-d5a5a9c2c917 | ||
| spec: | ||
| data: | ||
| - match: | ||
| remoteRef: | ||
| property: test | ||
| remoteKey: remote/path | ||
| secretKey: test | ||
| deletionPolicy: None | ||
| refreshInterval: 5m | ||
| secretStoreRefs: | ||
| - kind: ClusterSecretStore | ||
| name: my-store | ||
| selector: | ||
| secret: | ||
| name: existing-secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.