Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func newPlugins() (*plugins, error) {
func (p *plugins) print() {
if len(p.local) == 0 && len(p.ops) == 0 {
debug("No plugins installed")
fmt.Println("No plugins installed. Use 'ops -plugin' to add new ones.")
fmt.Println("No plugins installed. Use ops -plugin <repo_url> to install one.")
return
}

Expand Down
12 changes: 12 additions & 0 deletions prepare.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is exactly the purpose of this change?

Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ func autoCLIUpdate() error {

func checkOperatorVersion(opsRootConfig map[string]interface{}) error {
trace("checkOperatorVersion")
// --- NEW: Check for active operator installation ---
// Execute "ops debug operator:version" to see if an operator is currently deployed.
debugCmd := exec.Command(os.Getenv("OPS_CMD"), "debug", "operator:version")
output, err := debugCmd.Output()
if err != nil || strings.TrimSpace(string(output)) == "" {
// No operator installed or command failed, so suppress the update suggestion.
debug("No active operator installation detected or command failed:", err, "output:", strings.TrimSpace(string(output)))
return fmt.Errorf("no active operator installation detected") // Return an error to prevent printing the update message
}
debug("Active operator version detected:", strings.TrimSpace(string(output)))
// --- END NEW ---

images := opsRootConfig["images"].(map[string]interface{})
operator := images["operator"].(string)
opVer := strings.Split(operator, ":")[1]
Expand Down