Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
Signed-off-by: Max Shaposhnyk <[email protected]>
  • Loading branch information
mshaposhnik committed May 20, 2024
1 parent 230bdcc commit 5aee388
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions controllers/imagerepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (r *ImageRepositoryReconciler) ProvisionImageRepositoryAccess(ctx context.C
}

secretName := getSecretName(imageRepository, isPullOnly)
if err := r.EnsureSecret(ctx, imageRepository, secretName, isPullOnly, robotAccount, quayImageURL); err != nil {
if err := r.EnsureSecret(ctx, imageRepository, secretName, robotAccount, quayImageURL, isPullOnly); err != nil {
return nil, err
}

Expand Down Expand Up @@ -451,7 +451,7 @@ func (r *ImageRepositoryReconciler) RegenerateImageRepositoryAccessToken(ctx con
if isPullOnly {
secretName = imageRepository.Status.Credentials.PullSecretName
}
if err := r.EnsureSecret(ctx, imageRepository, secretName, isPullOnly, robotAccount, quayImageURL); err != nil {
if err := r.EnsureSecret(ctx, imageRepository, secretName, robotAccount, quayImageURL, isPullOnly); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -535,7 +535,7 @@ func (r *ImageRepositoryReconciler) ChangeImageRepositoryVisibility(ctx context.
return err
}

func (r *ImageRepositoryReconciler) EnsureSecret(ctx context.Context, imageRepository *imagerepositoryv1alpha1.ImageRepository, secretName string, isPull bool, robotAccount *quay.RobotAccount, imageURL string) error {
func (r *ImageRepositoryReconciler) EnsureSecret(ctx context.Context, imageRepository *imagerepositoryv1alpha1.ImageRepository, secretName string, robotAccount *quay.RobotAccount, imageURL string, isPull bool) error {
log := ctrllog.FromContext(ctx).WithValues("RemoteSecretName", secretName)

secret := &corev1.Secret{}
Expand Down
1 change: 0 additions & 1 deletion controllers/imagerepository_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ var _ = Describe("Image repository controller", func() {
regenerateToken := true
imageRepository.Spec.Credentials = &imagerepositoryv1alpha1.ImageCredentials{RegenerateToken: &regenerateToken}
Expect(k8sClient.Update(ctx, imageRepository)).To(Succeed())
//defer deleteSecret(uploadSecretKey)

Eventually(func() bool { return isRegenerateRobotAccountTokenInvoked }, timeout, interval).Should(BeTrue())
Eventually(func() bool {
Expand Down

0 comments on commit 5aee388

Please sign in to comment.