Skip to content

Commit

Permalink
Remove Temporary Upgrade Code (#3055)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmaly committed Apr 25, 2022
1 parent 8f0ea93 commit 8de8d13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
8 changes: 0 additions & 8 deletions porch/apiserver/pkg/registry/porch/background.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ func (b *background) runOnce(ctx context.Context) error {
for i := range repositories.Items {
repo := &repositories.Items[i]

if repo.Spec.Content == "PackageRevision" {
// Upgrade to "Package"
repo.Spec.Content = configapi.RepositoryContentPackage
if err := b.coreClient.Update(ctx, repo); err != nil {
klog.Errorf("Failed to upgrade Repo content PackageRevision --> Package: %v", err)
}
}

if err := b.cacheRepository(ctx, repo); err != nil {
klog.Errorf("Failed to cache repository: %v", err)
}
Expand Down
9 changes: 1 addition & 8 deletions porch/repository/pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,7 @@ func (c *Cache) OpenRepository(ctx context.Context, repositorySpec *configapi.Re
}

func isPackageContent(content configapi.RepositoryContent) bool {
switch content {
case "PackageRevision":
return true // TODO: remove this once migration to "Package" is complete.
case configapi.RepositoryContentPackage:
return true
default:
return false
}
return content == configapi.RepositoryContentPackage
}

func (c *Cache) CloseRepository(repositorySpec *configapi.Repository) error {
Expand Down

0 comments on commit 8de8d13

Please sign in to comment.