Skip to content
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

kctrl: Add secret flag for package repo add/update #1612

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

devanshuVmware
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

  1. Add a package repository with secret:
    Given I have a custom package repository,
    And it is hosted on authenticated registry,
    When I add a package repository
    Then I should be able to specify a secret for registry
    kctrl package repository add -r sample-repo --namespace ns --url projects.repo.com/example:1.0.0 --secret repo-secret
    And I execute:
    kubectl get pkgr sample-repo -oyaml
    And I see:
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
metadata: 
  name: sample-repo
  namespace: ns
spec: 
  fetch: 
    imgpkgBundle: 
      image: projects.repo.com/example:1.0.0
      - secretRef: 
          name: repo-secret
  1. Update a package repository with secret:
    Given I have a package repository created,
    When I update the secret for repository
    kctrl package repository update sample-repo --secret repo-secret-2
    And I run
    kubectl get pkgr sample-repo -oyaml
    Then I see:
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
metadata: 
  name: sample-repo
  namespace: ns
spec: 
  fetch: 
    imgpkgBundle: 
      image: projects.repo.com/example:1.0.0
      - secretRef:   
          name: repo-secret-2

Does this PR introduce a user-facing change?

Update upstream kctrl CLI to refer to a secret while adding or updating package repository

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


Signed-off-by: Devanshu <devanshu.d@broadcom.com>
@praveenrewar praveenrewar changed the title Add secret flag for PackageRepository CRD in cli kctrl: Add secret flag for package repo add/update Aug 23, 2024
Signed-off-by: Devanshu <devanshu.d@broadcom.com>
also added a shorthand  for secretref flag

Signed-off-by: Devanshu <devanshu.d@broadcom.com>
@rohitagg2020
Copy link
Contributor

LGTM

Signed-off-by: Devanshu <devanshu.d@broadcom.com>
Signed-off-by: Devanshu <devanshu.d@broadcom.com>
@praveenrewar praveenrewar merged commit 8a9b3f7 into carvel-dev:develop Aug 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants