-
Notifications
You must be signed in to change notification settings - Fork 0
[firestartr-bootstrap] Several fixes for new errors found
#403
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
Changes from all commits
ef23d43
67744fa
58c70e7
e14733b
9026bad
38ae8ad
f990208
3b65651
268ed86
0d03fbe
d7d50ef
722ba6f
e3e7d13
ead6c54
3eeb94b
85b64b5
fca7b11
9dd0df2
930bc25
ddbe00a
3c635b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,8 +63,8 @@ func (m *FirestartrBootstrap) AddArgoCDSecrets( | |
| patchedDir, err := safelyPatchYamlConfig( | ||
| ctx, | ||
| argoCDRepo.Directory("/repo"), | ||
| "kubernetes-sys-services/firestartr-pro/argo-configuration-secrets/values.yaml", | ||
| m.Bootstrap.Org, | ||
| fmt.Sprintf("kubernetes-sys-services/firestartr-%s/argo-configuration-secrets/values.yaml", m.Bootstrap.Env), | ||
| m.GhOrgLowerCase, | ||
| clientAccess, | ||
|
Comment on lines
63
to
68
|
||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ExternalSecret | ||
| metadata: | ||
| name: operator-secrets | ||
| spec: | ||
| data: | ||
| - remoteRef: | ||
| conversionStrategy: Default | ||
| decodingStrategy: None | ||
| key: "/firestartr/{{ $.Bootstrap.Customer }}/fs-{{ $.Bootstrap.Customer }}/pem" | ||
| metadataPolicy: None | ||
| secretKey: fs-pem | ||
| - remoteRef: | ||
| conversionStrategy: Default | ||
| decodingStrategy: None | ||
| key: "/firestartr/{{ $.Bootstrap.Customer }}/fs-{{ $.Bootstrap.Customer }}/app-id" | ||
| metadataPolicy: None | ||
| secretKey: fs-appid | ||
| - remoteRef: | ||
| conversionStrategy: Default | ||
| decodingStrategy: None | ||
| key: "/firestartr/{{ $.Bootstrap.Customer }}/fs-{{ $.Bootstrap.Customer }}/{{ $.GhOrgLowerCase }}/app-installation-id" | ||
| metadataPolicy: None | ||
| secretKey: fs-installationid | ||
| - remoteRef: | ||
| conversionStrategy: Default | ||
| decodingStrategy: None | ||
| key: "/firestartr/{{ $.Bootstrap.Customer }}/prefapp-bot-pat" | ||
| metadataPolicy: None | ||
| secretKey: prefapp-bot-pat | ||
juanjosevazquezgil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| refreshInterval: 24h0m0s | ||
| secretStoreRef: | ||
| kind: SecretStore | ||
| name: aws | ||
| target: | ||
| creationPolicy: Owner | ||
| deletionPolicy: Delete | ||
| name: operator-secrets | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -441,6 +441,39 @@ func (m *FirestartrBootstrap) WorkflowRun( | |
| return nil | ||
| } | ||
|
|
||
| func (m *FirestartrBootstrap) CheckIfDefaultGroupExists( | ||
| ctx context.Context, | ||
| ghToken *dagger.Secret, | ||
| ) error { | ||
| ctr, err := m.GhContainer(ctx, ghToken) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| _, err = ctr. | ||
| WithEnvVariable("BUST_CACHE", time.Now().String()). | ||
| WithExec([]string{ | ||
| "gh", "api", fmt.Sprintf("/orgs/%s/teams/%s", m.GhOrg, m.Bootstrap.DefaultGroup), | ||
| }). | ||
|
Comment on lines
+455
to
+457
|
||
| Sync(ctx) | ||
|
|
||
| switch err := err.(type) { | ||
| case nil: | ||
| return nil | ||
| case *dagger.ExecError: | ||
| errMsg := extractErrorMessage( | ||
| err, | ||
| fmt.Sprintf( | ||
| "Failed to check if %s group exists in the organization", | ||
| m.Bootstrap.DefaultGroup, | ||
| ), | ||
| ) | ||
| return errors.New(errMsg) | ||
| default: | ||
| return err | ||
| } | ||
| } | ||
|
|
||
| func (m *FirestartrBootstrap) CheckIfOrgAllGroupExists( | ||
| ctx context.Context, | ||
| ghToken *dagger.Secret, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.