FIX kubectl should only redeploy updated manifests
@@ -53,13 +53,13 @@ func (c *CLI) Apply(ctx context.Context, out io.Writer, manifests ManifestList)
// Only redeploy modified or new manifests
// TODO(dgageot): should we delete a manifest that was deployed and is not anymore?
updated := c.previousApply.Diff(manifests)
- logrus.Debugln(len(manifests), "manifests to deploy.", len(manifests), "are updated or new")
+ logrus.Debugln(len(manifests), "manifests to deploy.", len(updated), "are updated or new")
c.previousApply = manifests
if len(updated) == 0 {
return nil, nil
}
- if err := c.Run(ctx, manifests.Reader(), out, "apply", c.Flags.Apply, "-f", "-"); err != nil {
+ if err := c.Run(ctx, updated.Reader(), out, "apply", c.Flags.Apply, "-f", "-"); err != nil {
return nil, errors.Wrap(err, "kubectl apply")
}
