Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Remove CLI logic for setting AutoUpgrade if implied
Browse files Browse the repository at this point in the history
This logic has instead been moved to the AppInstanceStatus as a field,
ObservedAutoUpgrade. This field is set to true if AutoUpgrade was either
explicitly set or implied by other options (the image or interval).

Signed-off-by: tylerslaton <mtslaton1@gmail.com>
  • Loading branch information
tylerslaton committed Jul 13, 2023
1 parent 30063c3 commit 200a3e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions pkg/cli/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package cli
import (
"io"

"github.com/acorn-io/runtime/pkg/autoupgrade"
cli "github.com/acorn-io/runtime/pkg/cli/builder"
"github.com/acorn-io/runtime/pkg/dev"
"github.com/acorn-io/runtime/pkg/imagesource"
"github.com/acorn-io/z"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -66,11 +64,6 @@ func (s *Dev) Run(cmd *cobra.Command, args []string) error {
return err
}

// Ensure opts.AutoUpgrade is set if is implied by opts.AutoUpgradeInterval or imageSource.Image's pattern.
if opts.AutoUpgrade == nil || !*opts.AutoUpgrade {
opts.AutoUpgrade = z.P(autoupgrade.ImpliedAutoUpgrade(opts.AutoUpgradeInterval, imageSource.Image))
}

return dev.Dev(cmd.Context(), c, &dev.Options{
ImageSource: imageSource,
Run: opts,
Expand Down
6 changes: 0 additions & 6 deletions pkg/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/acorn-io/runtime/pkg/imagesource"
"github.com/acorn-io/runtime/pkg/rulerequest"
"github.com/acorn-io/runtime/pkg/wait"
"github.com/acorn-io/z"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -243,11 +242,6 @@ func (s *Run) Run(cmd *cobra.Command, args []string) (err error) {
return err
}

// Ensure opts.AutoUpgrade is set if is implied by opts.AutoUpgradeInterval or imageSource.Image's pattern.
if opts.AutoUpgrade == nil || !*opts.AutoUpgrade {
opts.AutoUpgrade = z.P(autoupgrade.ImpliedAutoUpgrade(opts.AutoUpgradeInterval, imageSource.Image))
}

// Force install prompt if needed
_, err = c.Info(cmd.Context())
if err != nil {
Expand Down

0 comments on commit 200a3e8

Please sign in to comment.