Skip to content

Commit

Permalink
don't migrate storage version if CRD has one storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kauana dos Santos committed Oct 11, 2023
1 parent ca8c009 commit dfe2a4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apiextensions/storageversion/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func (m *Migrator) Migrate(ctx context.Context, gr schema.GroupResource) error {
return fmt.Errorf("unable to fetch crd %s - %w", gr, err)
}

// don't migrate storage version if CRD has a single storage in its status
if len(crd.Status.StoredVersions) == 1 {
return nil
}

version := storageVersion(crd)

if version == "" {
Expand Down

0 comments on commit dfe2a4a

Please sign in to comment.