You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/pkg/kctrl/cmd/package/installed/create_or_update.go
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -767,11 +767,16 @@ func (o *CreateOrUpdateOptions) preparePackageInstallForUpdate(pkgInstall *kcpkg
767
767
returnnil, fmt.Errorf("Failed to update package '%s' as no existing package reference/version was found in the package install", o.Name)
768
768
}
769
769
770
-
// If o.PackageName is provided by the user (via --package flag), verify that the package name in PackageInstall matches it.
771
-
// This will prevent the users from accidentally overwriting an installed package with another package content due to choosing a pre-existing name for the package isntall.
770
+
// If o.PackageName provided by the user (via --package flag) is not the same as the package name in PackageInstall
771
+
// Prompt user to confirm
772
772
// Otherwise if o.PackageName is not provided, fill it from the installed package spec
returnnil, fmt.Errorf("Installed package '%s' is already associated with package '%s'", o.Name, updatedPkgInstall.Spec.PackageRef.RefName)
774
+
o.ui.PrintLinef("Changing Package reference for installation '%s' from Package '%s' to Package '%s'", o.Name, updatedPkgInstall.Spec.PackageRef.RefName, o.packageName)
0 commit comments