Skip to content

feat(argocd): add image pull secrets via oms beta install argocd-repo-secret#439

Open
Jcing95 wants to merge 3 commits into
mainfrom
add-install-ago-secrets
Open

feat(argocd): add image pull secrets via oms beta install argocd-repo-secret#439
Jcing95 wants to merge 3 commits into
mainfrom
add-install-ago-secrets

Conversation

@Jcing95
Copy link
Copy Markdown
Contributor

@Jcing95 Jcing95 commented May 22, 2026

Add command to add ImagePullSecrets for given Repo to oms

@Jcing95 Jcing95 self-assigned this May 22, 2026
Signed-off-by: Jcing95 <23337729+Jcing95@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/installer helper to render/apply it.
  • Adds a new Cobra subcommand under oms beta install to 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")
}
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.

2 participants