Skip to content

Commit

Permalink
support use of kapp resource against not-yet-deployed k8s cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
cppforlife committed May 22, 2020
1 parent 3455941 commit 1d323f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kapp/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ func (r Resource) Read(d *schema.ResourceData, meta interface{}) error {
d.SetId(r.id(d))

r.clearDiff(d)
defer r.clearDiff(d)

// Updates revision to indicate change
_, _, err := (&Kapp{d, meta.(schemamisc.Context).Kubeconfig, logger}).Diff()
if err != nil {
r.logger.Error("Ignoring diffing error: %s", err)
// TODO ignore diffing error since it might
// be diffed against invalid old configuration
// (eg Ownership error with previously set configuration).
Expand Down Expand Up @@ -98,7 +98,7 @@ func (r Resource) CustomizeDiff(diff *schema.ResourceDiff, meta interface{}) err

_, _, err := (&Kapp{SettableDiff{diff}, meta.(schemamisc.Context).Kubeconfig, logger}).Diff()
if err != nil {
return fmt.Errorf("Customizing diff %s: %s", r.id(diff), err)
r.logger.Error("Ignoring diffing error: %s", err)
}

return nil
Expand Down

0 comments on commit 1d323f1

Please sign in to comment.