mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-23 01:45:53 +00:00
Merge 0600f70b84 into fa7cd5f847
This commit is contained in:
commit
7b27a5c2ac
2 changed files with 16 additions and 3 deletions
|
|
@ -689,7 +689,9 @@ func maskSopsData(res *resource.Resource) error {
|
|||
// assume that both data and stringdata are encrypted
|
||||
if bytes.Contains(asYaml, []byte("sops:")) && bytes.Contains(asYaml, []byte("mac: ENC[")) {
|
||||
// delete the sops object
|
||||
res.PipeE(yaml.FieldClearer{Name: "sops"})
|
||||
if err := res.PipeE(yaml.FieldClearer{Name: "sops"}); err != nil {
|
||||
return fmt.Errorf("failed to delete the sops object: %w", err)
|
||||
}
|
||||
|
||||
secretType, err := res.GetFieldValue(typeField)
|
||||
// If the intended type is Opaque, then it can be omitted from the manifest, since it's the default
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import (
|
|||
|
||||
"github.com/fluxcd/cli-utils/pkg/kstatus/polling"
|
||||
"github.com/fluxcd/cli-utils/pkg/object"
|
||||
"github.com/fluxcd/flux2/v2/pkg/log"
|
||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
|
||||
"github.com/fluxcd/pkg/ssa"
|
||||
"github.com/fluxcd/pkg/ssa/normalize"
|
||||
|
|
@ -47,6 +48,8 @@ import (
|
|||
"github.com/fluxcd/flux2/v2/pkg/printers"
|
||||
)
|
||||
|
||||
var logger log.Logger
|
||||
|
||||
func (b *Builder) Manager() (*ssa.ResourceManager, error) {
|
||||
statusPoller := polling.NewStatusPoller(b.client, b.restMapper, polling.Options{})
|
||||
owner := ssa.Owner{
|
||||
|
|
@ -141,14 +144,22 @@ func (b *Builder) diff() (string, bool, error) {
|
|||
err = diff(liveFile, mergedFile, &output)
|
||||
if err != nil {
|
||||
cleanupDir(tmpDir)
|
||||
if err := cleanupDir(tmpDir); err != nil {
|
||||
logger.Warningf("failed to clean up directory %s: %s", tmpDir, err)
|
||||
}
|
||||
return "", createdOrDrifted, err
|
||||
}
|
||||
|
||||
cleanupDir(tmpDir)
|
||||
if err := cleanupDir(tmpDir); err != nil {
|
||||
logger.Warningf("failed to clean up directory %s: %s", tmpDir, err)
|
||||
}
|
||||
createdOrDrifted = true
|
||||
}
|
||||
|
||||
addObjectsToInventory(newInventory, change)
|
||||
if err := addObjectsToInventory(newInventory, change); err != nil {
|
||||
err = fmt.Errorf("failed to add %s to inventory: %w", change, err)
|
||||
return "", createdOrDrifted, err
|
||||
}
|
||||
|
||||
if b.recursive && isKustomization(obj) && change.Action != ssa.CreatedAction {
|
||||
k, err := toKustomization(obj)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue