feat(argocd): add image pull secrets via oms beta install argocd-repo-secret#439
Open
Jcing95 wants to merge 3 commits into
Open
feat(argocd): add image pull secrets via oms beta install argocd-repo-secret#439Jcing95 wants to merge 3 commits into
Jcing95 wants to merge 3 commits into
Conversation
Signed-off-by: Jcing95 <23337729+Jcing95@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new oms beta install argocd-repo-secret command to create/update ArgoCD repository secrets (Helm OCI or Git), backed by a rendered Kubernetes Secret manifest and applied via the existing Kubernetes apply helpers.
Changes:
- Introduces a generic ArgoCD repo Secret template and an
internal/installerhelper to render/apply it. - Adds a new Cobra subcommand under
oms beta installto collect flags + resolve password and apply the secret. - Adds Ginkgo tests and user-facing docs for the new command.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/installer/manifests/argocd/repo-secret.yaml.tpl | New generic ArgoCD repository Secret YAML template (parameterized). |
| internal/installer/argocd_repo_secret.go | New installer that renders the template and applies the Secret to the cluster. |
| internal/installer/argocd_repo_secret_test.go | Tests for creating/updating the repo Secret via a fake Kubernetes client. |
| docs/oms_beta_install.md | Adds the new subcommand to the beta install docs index. |
| docs/oms_beta_install_argocd-repo-secret.md | New documentation page for the command usage/options/examples. |
| cli/cmd/beta_install.go | Wires the new subcommand into oms beta install. |
| cli/cmd/argocd_repo_secret.go | New Cobra command implementation and password resolution logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| url: ${REPO_URL} | ||
| name: ${REPO_DISPLAY_NAME} | ||
| username: ${USERNAME} | ||
| password: ${PASSWORD} |
Comment on lines
+108
to
+109
| If not set, it will be prompted interactively (hidden input). | ||
| You can also pipe the password via stdin: echo "token" | oms beta install argocd-repo-secret ...`), |
| The password is read from the OMS_REPO_PASSWORD environment variable. | ||
| If not set, it will be prompted interactively (hidden input). | ||
| You can also pipe the password via stdin: echo "token" | oms beta install argocd-repo-secret ...`), | ||
| Example: formatExamples("install argocd-repo-secret", []packageio.Example{ |
Comment on lines
+22
to
+25
| $ oms install argocd-repo-secret --name ghcr-codesphere-helm-repo --url ghcr.io/codesphere-cloud/charts --repo-name ghcr-codesphere --type helm --username CodesphereBot --enable-oci | ||
|
|
||
| # Create a git repo credentials secret (set OMS_REPO_PASSWORD env var beforehand) | ||
| $ oms install argocd-repo-secret --name my-git-repo --url https://github.com/my-org --repo-name my-org --type git --username bot --secret-type repo-creds |
Comment on lines
+54
to
+63
| secret, err := fakeClient.CoreV1().Secrets("argocd").Get(ctx, "ghcr-codesphere-helm-repo", metav1.GetOptions{}) | ||
| Expect(err).ToNot(HaveOccurred()) | ||
| Expect(secret.Labels).To(HaveKeyWithValue("argocd.argoproj.io/secret-type", "repository")) | ||
| Expect(secret.StringData["type"]).To(Equal("helm")) | ||
| Expect(secret.StringData["url"]).To(Equal("ghcr.io/codesphere-cloud/charts")) | ||
| Expect(secret.StringData["name"]).To(Equal("ghcr-codesphere")) | ||
| Expect(secret.StringData["username"]).To(Equal("CodesphereBot")) | ||
| Expect(secret.StringData["password"]).To(Equal("super-secret-token")) | ||
| Expect(secret.StringData["enableOCI"]).To(Equal("true")) | ||
| }) |
Comment on lines
+16
to
+26
| // ArgoCDRepoSecretConfig holds the parameters for creating an ArgoCD repository secret. | ||
| type ArgoCDRepoSecretConfig struct { | ||
| Name string // metadata.name of the Secret | ||
| URL string // repository URL (e.g. ghcr.io/codesphere-cloud/charts) | ||
| RepoName string // display name for ArgoCD (stringData.name) | ||
| Type string // repo type: "helm" or "git" | ||
| Username string // auth username | ||
| Password string // auth password/token | ||
| EnableOCI bool // whether to set enableOCI: "true" | ||
| SecretType string // argocd.argoproj.io/secret-type label value (default: "repository") | ||
| } |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add command to add ImagePullSecrets for given Repo to oms