mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
Merge pull request #5407 from cappyzawa/refactor-deprecated-ssa-func
refactor: Use `normalize.UnstructuredList` instead of `ssa.SetNativeKindsDefaults`
This commit is contained in:
commit
7626cd0c86
3 changed files with 6 additions and 3 deletions
|
|
@ -27,6 +27,7 @@ import (
|
|||
|
||||
"github.com/fluxcd/flux2/v2/internal/build"
|
||||
"github.com/fluxcd/pkg/ssa"
|
||||
"github.com/fluxcd/pkg/ssa/normalize"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
|
|
@ -151,7 +152,7 @@ func createObjectFromFile(objectFile string, templateValues map[string]string, t
|
|||
t.Fatalf("Error decoding yaml file '%s': %v", objectFile, err)
|
||||
}
|
||||
|
||||
if err := ssa.SetNativeKindsDefaults(clientObjects); err != nil {
|
||||
if err := normalize.UnstructuredList(clientObjects); err != nil {
|
||||
t.Fatalf("Error setting native kinds defaults for '%s': %v", objectFile, err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import (
|
|||
"github.com/fluxcd/cli-utils/pkg/object"
|
||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
|
||||
"github.com/fluxcd/pkg/ssa"
|
||||
"github.com/fluxcd/pkg/ssa/normalize"
|
||||
ssautil "github.com/fluxcd/pkg/ssa/utils"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/pkg/printers"
|
||||
|
|
@ -80,7 +81,7 @@ func (b *Builder) diff() (string, bool, error) {
|
|||
return "", createdOrDrifted, err
|
||||
}
|
||||
|
||||
err = ssa.SetNativeKindsDefaults(objects)
|
||||
err = normalize.UnstructuredList(objects)
|
||||
if err != nil {
|
||||
return "", createdOrDrifted, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import (
|
|||
"github.com/fluxcd/cli-utils/pkg/kstatus/polling"
|
||||
runclient "github.com/fluxcd/pkg/runtime/client"
|
||||
"github.com/fluxcd/pkg/ssa"
|
||||
"github.com/fluxcd/pkg/ssa/normalize"
|
||||
ssautil "github.com/fluxcd/pkg/ssa/utils"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/pkg/manifestgen/kustomization"
|
||||
|
|
@ -50,7 +51,7 @@ func Apply(ctx context.Context, rcg genericclioptions.RESTClientGetter, opts *ru
|
|||
return "", fmt.Errorf("no Kubernetes objects found at: %s", manifestPath)
|
||||
}
|
||||
|
||||
if err := ssa.SetNativeKindsDefaults(objs); err != nil {
|
||||
if err := normalize.UnstructuredList(objs); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue