Skip to content

Commit

Permalink
Merge pull request #38 from matskiv/fix-PreserveUnknownFields
Browse files Browse the repository at this point in the history
fix: improve handling of old host CRDs
  • Loading branch information
FabianKramm authored Dec 2, 2022
2 parents ef7f91e + fcc491a commit 30018e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions translate/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package translate
import (
"context"
"fmt"
"math"
"time"

"github.com/pkg/errors"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextensionsv1clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"math"
"time"

"github.com/loft-sh/vcluster-sdk/applier"
"github.com/loft-sh/vcluster-sdk/log"
Expand Down Expand Up @@ -52,6 +53,7 @@ func EnsureCRDFromPhysicalCluster(ctx context.Context, pConfig *rest.Config, vCo
crdDefinition.ResourceVersion = ""
crdDefinition.ManagedFields = nil
crdDefinition.OwnerReferences = nil
crdDefinition.Spec.PreserveUnknownFields = false
crdDefinition.Status = apiextensionsv1.CustomResourceDefinitionStatus{}
vClient, err := apiextensionsv1clientset.NewForConfig(vConfig)
if err != nil {
Expand Down

0 comments on commit 30018e3

Please sign in to comment.