From 9fdbac09c9e32bff0a4fda0bf4bfd3f8fcc57a6c Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Sat, 27 Jul 2019 15:20:16 -0700 Subject: [PATCH 01/30] Adding Jose Donizetti to the official maintainers --- MAINTAINERS | 1 + OWNERS | 1 + 2 files changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 82d4387262..8e3e837731 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2,3 +2,4 @@ Thomas Stromberg (@tstromberg) Anders F Björklund (@afbjorklund) Sharif Elgamal (@sharifelgamal) Medya Ghazizadeh (@medyagh) +Jose Donizetti (@josedonizetti) \ No newline at end of file diff --git a/OWNERS b/OWNERS index ed9ba81e09..52d291dc92 100644 --- a/OWNERS +++ b/OWNERS @@ -6,6 +6,7 @@ reviewers: - sharifelgamal - RA489 - medyagh + - josedonizetti approvers: - tstromberg - afbjorklund From 4722fa8d2ae077ac181cfbcaedce57727feadc6d Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 13 Aug 2019 21:59:29 -0700 Subject: [PATCH 02/30] delete deprecated MAINTAINERS file --- MAINTAINERS | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 MAINTAINERS diff --git a/MAINTAINERS b/MAINTAINERS deleted file mode 100644 index 8e3e837731..0000000000 --- a/MAINTAINERS +++ /dev/null @@ -1,5 +0,0 @@ -Thomas Stromberg (@tstromberg) -Anders F Björklund (@afbjorklund) -Sharif Elgamal (@sharifelgamal) -Medya Ghazizadeh (@medyagh) -Jose Donizetti (@josedonizetti) \ No newline at end of file From 7d8b4f7569515dd9a90a4d2b1c84cf29b8cfa069 Mon Sep 17 00:00:00 2001 From: Pranav Jituri Date: Sun, 18 Aug 2019 02:58:04 +0530 Subject: [PATCH 03/30] Added uninstallation procedures for minikube --- installers/windows/minikube.nsi | 384 +++++++++--------- .../docs/Reference/uninstalling_minikube.md | 72 ++++ 2 files changed, 264 insertions(+), 192 deletions(-) create mode 100644 site/content/en/docs/Reference/uninstalling_minikube.md diff --git a/installers/windows/minikube.nsi b/installers/windows/minikube.nsi index 58b894cb50..199120d610 100644 --- a/installers/windows/minikube.nsi +++ b/installers/windows/minikube.nsi @@ -1,192 +1,192 @@ -# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and -# adds uninstall information to the registry for Add/Remove Programs - -# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - -# You'll have to create these yourself) and run makensis on it - -# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they -# show up in a few places. -# All the other settings can be tweaked by editing the !defines at the top of this script -# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed -!define APPNAME "Minikube" -!define COMPANYNAME "Kubernetes" -!define DESCRIPTION "A Local Kubernetes Development Environment" -# These three must be integers -!define VERSIONMAJOR --VERSION_MAJOR-- -!define VERSIONMINOR --VERSION_MINOR-- -!define VERSIONBUILD --VERSION_BUILD-- -# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" -# It is possible to use "mailto:" links in here to open the email client -!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link -!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link -!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link -# This is the size (in kB) of all the files copied into "Program Files" -!define INSTALLSIZE --INSTALL_SIZE-- - -RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) - -InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" -!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" -BrandingText " " - -# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) -# This will be in the installer/uninstaller's title bar -Name "${COMPANYNAME} - ${APPNAME}" -Icon "logo.ico" -OutFile "minikube-installer.exe" - -!include "LogicLib.nsh" -!include "MUI2.nsh" ; Modern UI - -!define MUI_ICON "logo.ico" -!define MUI_UNICON "logo.ico" -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" -!define MUI_HEADERIMAGE_BITMAP "logo.bmp" -!define MUI_FINISHPAGE_NOAUTOCLOSE -!define MUI_UNFINISHPAGE_NOAUTOCLOSE - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_WELCOME -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!insertmacro MUI_UNPAGE_FINISH - -; Set languages (first is default language) -;!insertmacro MUI_LANGUAGE "English" -!define MUI_LANGDLL_ALLLANGUAGES -;Languages - - !insertmacro MUI_LANGUAGE "English" - !insertmacro MUI_LANGUAGE "French" - !insertmacro MUI_LANGUAGE "TradChinese" - !insertmacro MUI_LANGUAGE "Spanish" - !insertmacro MUI_LANGUAGE "Hungarian" - !insertmacro MUI_LANGUAGE "Russian" - !insertmacro MUI_LANGUAGE "German" - !insertmacro MUI_LANGUAGE "Dutch" - !insertmacro MUI_LANGUAGE "SimpChinese" - !insertmacro MUI_LANGUAGE "Italian" - !insertmacro MUI_LANGUAGE "Danish" - !insertmacro MUI_LANGUAGE "Polish" - !insertmacro MUI_LANGUAGE "Czech" - !insertmacro MUI_LANGUAGE "Slovenian" - !insertmacro MUI_LANGUAGE "Slovak" - !insertmacro MUI_LANGUAGE "Swedish" - !insertmacro MUI_LANGUAGE "Norwegian" - !insertmacro MUI_LANGUAGE "PortugueseBR" - !insertmacro MUI_LANGUAGE "Ukrainian" - !insertmacro MUI_LANGUAGE "Turkish" - !insertmacro MUI_LANGUAGE "Catalan" - !insertmacro MUI_LANGUAGE "Arabic" - !insertmacro MUI_LANGUAGE "Lithuanian" - !insertmacro MUI_LANGUAGE "Finnish" - !insertmacro MUI_LANGUAGE "Greek" - !insertmacro MUI_LANGUAGE "Korean" - !insertmacro MUI_LANGUAGE "Hebrew" - !insertmacro MUI_LANGUAGE "Portuguese" - !insertmacro MUI_LANGUAGE "Farsi" - !insertmacro MUI_LANGUAGE "Bulgarian" - !insertmacro MUI_LANGUAGE "Indonesian" - !insertmacro MUI_LANGUAGE "Japanese" - !insertmacro MUI_LANGUAGE "Croatian" - !insertmacro MUI_LANGUAGE "Serbian" - !insertmacro MUI_LANGUAGE "Thai" - !insertmacro MUI_LANGUAGE "NorwegianNynorsk" - !insertmacro MUI_LANGUAGE "Belarusian" - !insertmacro MUI_LANGUAGE "Albanian" - !insertmacro MUI_LANGUAGE "Malay" - !insertmacro MUI_LANGUAGE "Galician" - !insertmacro MUI_LANGUAGE "Basque" - !insertmacro MUI_LANGUAGE "Luxembourgish" - !insertmacro MUI_LANGUAGE "Afrikaans" - !insertmacro MUI_LANGUAGE "Uzbek" - !insertmacro MUI_LANGUAGE "Macedonian" - !insertmacro MUI_LANGUAGE "Latvian" - !insertmacro MUI_LANGUAGE "Bosnian" - !insertmacro MUI_LANGUAGE "Mongolian" - !insertmacro MUI_LANGUAGE "Estonian" - -!insertmacro MUI_RESERVEFILE_LANGDLL - -Function .onInit - - !insertmacro MUI_LANGDLL_DISPLAY - -FunctionEnd - -Section "Install" - # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) - SetOutPath $INSTDIR - # Files added here should be removed by the uninstaller (see section "uninstall") - File "minikube.exe" - File "logo.ico" - File "update_path.ps1" - # Add any other files for the install directory (license files, app data, etc) here - - # Uninstaller - See function un.onInit and section "uninstall" for configuration - WriteUninstaller "$INSTDIR\uninstall.exe" - - # Start Menu - CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" - CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" - - # Registry information for add/remove programs - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" - WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" - WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} - - # There is no option for modifying or repairing the install - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 - - # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size - WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} - - # Add installed executable to PATH - # Cannot uset EnvVarUpdate since the path can be too long - # this is explicitly warned in the documentation page - # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' - -SectionEnd - -Section "Uninstall" - - # Remove Start Menu launcher - Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" - # Try to remove the Start Menu folder - this will only happen if it is empty - RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" - - # Remove uninstalled executable from PATH - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; appends to the system path - - # Remove files - Delete /REBOOTOK $INSTDIR\minikube.exe - Delete /REBOOTOK $INSTDIR\logo.ico - Delete /REBOOTOK $INSTDIR\update_path.ps1 - - # Always delete uninstaller as the last action - Delete /REBOOTOK $INSTDIR\uninstall.exe - - # Try to remove the install directory - this will only happen if it is empty - RmDir /REBOOTOK $INSTDIR - - # Remove uninstaller information from the registry - DeleteRegKey HKLM "${UNINSTALLDIR}" - -SectionEnd +# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and +# adds uninstall information to the registry for Add/Remove Programs + +# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - +# You'll have to create these yourself) and run makensis on it + +# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they +# show up in a few places. +# All the other settings can be tweaked by editing the !defines at the top of this script +# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed +!define APPNAME "Minikube" +!define COMPANYNAME "Kubernetes" +!define DESCRIPTION "A Local Kubernetes Development Environment" +# These three must be integers +!define VERSIONMAJOR --VERSION_MAJOR-- +!define VERSIONMINOR --VERSION_MINOR-- +!define VERSIONBUILD --VERSION_BUILD-- +# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" +# It is possible to use "mailto:" links in here to open the email client +!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link +!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link +!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link +# This is the size (in kB) of all the files copied into "Program Files" +!define INSTALLSIZE --INSTALL_SIZE-- + +RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) + +InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" +!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" +BrandingText " " + +# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) +# This will be in the installer/uninstaller's title bar +Name "${COMPANYNAME} - ${APPNAME}" +Icon "logo.ico" +OutFile "minikube-installer.exe" + +!include "LogicLib.nsh" +!include "MUI2.nsh" ; Modern UI + +!define MUI_ICON "logo.ico" +!define MUI_UNICON "logo.ico" +!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" +!define MUI_HEADERIMAGE_BITMAP "logo.bmp" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_UNFINISHPAGE_NOAUTOCLOSE + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +; Set languages (first is default language) +;!insertmacro MUI_LANGUAGE "English" +!define MUI_LANGDLL_ALLLANGUAGES +;Languages + + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "Hungarian" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Polish" + !insertmacro MUI_LANGUAGE "Czech" + !insertmacro MUI_LANGUAGE "Slovenian" + !insertmacro MUI_LANGUAGE "Slovak" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !insertmacro MUI_LANGUAGE "Ukrainian" + !insertmacro MUI_LANGUAGE "Turkish" + !insertmacro MUI_LANGUAGE "Catalan" + !insertmacro MUI_LANGUAGE "Arabic" + !insertmacro MUI_LANGUAGE "Lithuanian" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Hebrew" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "Farsi" + !insertmacro MUI_LANGUAGE "Bulgarian" + !insertmacro MUI_LANGUAGE "Indonesian" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Croatian" + !insertmacro MUI_LANGUAGE "Serbian" + !insertmacro MUI_LANGUAGE "Thai" + !insertmacro MUI_LANGUAGE "NorwegianNynorsk" + !insertmacro MUI_LANGUAGE "Belarusian" + !insertmacro MUI_LANGUAGE "Albanian" + !insertmacro MUI_LANGUAGE "Malay" + !insertmacro MUI_LANGUAGE "Galician" + !insertmacro MUI_LANGUAGE "Basque" + !insertmacro MUI_LANGUAGE "Luxembourgish" + !insertmacro MUI_LANGUAGE "Afrikaans" + !insertmacro MUI_LANGUAGE "Uzbek" + !insertmacro MUI_LANGUAGE "Macedonian" + !insertmacro MUI_LANGUAGE "Latvian" + !insertmacro MUI_LANGUAGE "Bosnian" + !insertmacro MUI_LANGUAGE "Mongolian" + !insertmacro MUI_LANGUAGE "Estonian" + +!insertmacro MUI_RESERVEFILE_LANGDLL + +Function .onInit + + !insertmacro MUI_LANGDLL_DISPLAY + +FunctionEnd + +Section "Install" + # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) + SetOutPath $INSTDIR + # Files added here should be removed by the uninstaller (see section "uninstall") + File "minikube.exe" + File "logo.ico" + File "update_path.ps1" + # Add any other files for the install directory (license files, app data, etc) here + + # Uninstaller - See function un.onInit and section "uninstall" for configuration + WriteUninstaller "$INSTDIR\uninstall.exe" + + # Start Menu + CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" + CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" + + # Registry information for add/remove programs + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" + WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" + WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} + + # There is no option for modifying or repairing the install + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 + + # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size + WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} + + # Add installed executable to PATH + # Cannot uset EnvVarUpdate since the path can be too long + # this is explicitly warned in the documentation page + # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' + +SectionEnd + +Section "Uninstall" + + # Remove Start Menu launcher + Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" + # Try to remove the Start Menu folder - this will only happen if it is empty + RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" + + # Remove uninstalled executable from PATH + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; Removes minikube from System Path + + # Remove files + Delete /REBOOTOK $INSTDIR\minikube.exe + Delete /REBOOTOK $INSTDIR\logo.ico + Delete /REBOOTOK $INSTDIR\update_path.ps1 + + # Always delete uninstaller as the last action + Delete /REBOOTOK $INSTDIR\uninstall.exe + + # Try to remove the install directory - this will only happen if it is empty + RmDir /REBOOTOK $INSTDIR + + # Remove uninstaller information from the registry + DeleteRegKey HKLM "${UNINSTALLDIR}" + +SectionEnd diff --git a/site/content/en/docs/Reference/uninstalling_minikube.md b/site/content/en/docs/Reference/uninstalling_minikube.md new file mode 100644 index 0000000000..7971e5ec98 --- /dev/null +++ b/site/content/en/docs/Reference/uninstalling_minikube.md @@ -0,0 +1,72 @@ +--- +title: "Uninstall minikube" +linkTitle: "Uninstall minikube" +weight: 6 +date: 2019-08-18 +description: > + Reference on uninstalling minikube from your system completely. +--- + +# Uninstall minikube on Windows +Following are the ways you can install minikube on Windows. Depending on how you installed minikube, please follow the guide appropriately. + +## Chocolatey +If you have installed minikube using Chocolatey package manager, follow the below steps to completely uninstall minikube from your system - +- Open a command prompt with Administrator privileges. +- We need to delete the cluster which was created by minikube - `minikube delete` +- Run, `choco uninstall minikube` to remove the minikube package from your system. +- Now, navigate to your User Folder - `C:\Users\YOUR_USER_NAME` (You can also find the path by expanding the environment variable `%USERPROFILE%`) +- In this folder, delete the `.minikube` folder. + +## Windows Installer +If you have downloaded and installed minikube using the Windows Installer provided in our Releases, kindly follow the below steps - +- Open a command prompt with Administrator privileges. +- We need to delete the cluster which was created by minikube - `minikube delete` +- Now, open the Run dialog box (**Win+R**), type in `appwiz.cpl` and hit **Enter** key. +- In there, find an entry for the Minikube installer, right click on it & click on **Uninstall**. +- Follow the onscreen prompts to uninstall minikube from your system. +- Now, navigate to your User Folder - `C:\Users\YOUR_USER_NAME` (You can also find the path by expanding the environment variable `%USERPROFILE%`) +- In this folder, delete the `.minikube` folder. + +## Binary/Direct +If you have downloaded just the binary and are using it to run minikube, please follow the below steps - +- Open a command prompt with Administrator privileges. +- We need to delete the cluster which was created by minikube - `minikube delete` +- Delete the minikube binary. +- Now, navigate to your User Folder - `C:\Users\YOUR_USER_NAME` (You can also find the path by expanding the environment variable `%USERPROFILE%`) +- In this folder, delete the `.minikube` folder. + + +# Uninstall minikube on Linux +## Binary/Direct +If you have installed minikube using the direct download method, follow the below steps to uninstall minikube completely from your system - +- In the shell, type in `minikube delete` to delete the minikube cluster. +- Remove the binary using `rm /usr/local/bin/minikube` +- Remove the directory containing the minikube configuration `rm -rf ~/.minikube` + +## Debian/Ubuntu (Deb) +If you have installed minikube using the (deb) file, follow the below instructions - +- In the shell, type in `minikube delete` to delete the minikube cluster. +- Uninstall the minikube package completely - `sudo dpkg -P minikube` +- Remove the minikube configuration directory - `rm -rf ~/.minikube` + +## Fedora/Red Hat (RPM) +If you have installed minikube using RPM, follow the below steps - +- In the shell, type in `minikube delete` to delete the minikube cluster. +- Uninstall the minikube package - `sudo rpm -e minikube` +- Remove the minikube configuration directory - `rm -rf ~/.minikube` + + +# Uninstall minikube on MacOS +## Binary/Direct +If you have installed minikube using the direct download method, follow the below steps to uninstall minikube completely from your system - +- In the shell, type in `minikube delete` to delete the minikube cluster. +- Remove the binary using `rm /usr/local/bin/minikube` +- Remove the directory containing the minikube configuration `rm -rf ~/.minikube` + + +## Brew +If you have installed minikube using the direct download method, follow the below steps to uninstall minikube completely from your system - +- In the shell, type in `minikube delete` to delete the minikube cluster. +- Uninstall the minikube package using `brew uninstall minikube` +- Remove the directory containing the minikube configuration `rm -rf ~/.minikube` From add7956bd1ab2bcf653e3902f511a46f5a77894e Mon Sep 17 00:00:00 2001 From: Pranav Jituri Date: Sun, 18 Aug 2019 03:02:23 +0530 Subject: [PATCH 04/30] Fix the encoding to LF --- installers/windows/minikube.nsi | 384 ++++++++++++++++---------------- 1 file changed, 192 insertions(+), 192 deletions(-) diff --git a/installers/windows/minikube.nsi b/installers/windows/minikube.nsi index 199120d610..03fe6d5220 100644 --- a/installers/windows/minikube.nsi +++ b/installers/windows/minikube.nsi @@ -1,192 +1,192 @@ -# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and -# adds uninstall information to the registry for Add/Remove Programs - -# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - -# You'll have to create these yourself) and run makensis on it - -# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they -# show up in a few places. -# All the other settings can be tweaked by editing the !defines at the top of this script -# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed -!define APPNAME "Minikube" -!define COMPANYNAME "Kubernetes" -!define DESCRIPTION "A Local Kubernetes Development Environment" -# These three must be integers -!define VERSIONMAJOR --VERSION_MAJOR-- -!define VERSIONMINOR --VERSION_MINOR-- -!define VERSIONBUILD --VERSION_BUILD-- -# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" -# It is possible to use "mailto:" links in here to open the email client -!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link -!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link -!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link -# This is the size (in kB) of all the files copied into "Program Files" -!define INSTALLSIZE --INSTALL_SIZE-- - -RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) - -InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" -!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" -BrandingText " " - -# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) -# This will be in the installer/uninstaller's title bar -Name "${COMPANYNAME} - ${APPNAME}" -Icon "logo.ico" -OutFile "minikube-installer.exe" - -!include "LogicLib.nsh" -!include "MUI2.nsh" ; Modern UI - -!define MUI_ICON "logo.ico" -!define MUI_UNICON "logo.ico" -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" -!define MUI_HEADERIMAGE_BITMAP "logo.bmp" -!define MUI_FINISHPAGE_NOAUTOCLOSE -!define MUI_UNFINISHPAGE_NOAUTOCLOSE - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_WELCOME -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!insertmacro MUI_UNPAGE_FINISH - -; Set languages (first is default language) -;!insertmacro MUI_LANGUAGE "English" -!define MUI_LANGDLL_ALLLANGUAGES -;Languages - - !insertmacro MUI_LANGUAGE "English" - !insertmacro MUI_LANGUAGE "French" - !insertmacro MUI_LANGUAGE "TradChinese" - !insertmacro MUI_LANGUAGE "Spanish" - !insertmacro MUI_LANGUAGE "Hungarian" - !insertmacro MUI_LANGUAGE "Russian" - !insertmacro MUI_LANGUAGE "German" - !insertmacro MUI_LANGUAGE "Dutch" - !insertmacro MUI_LANGUAGE "SimpChinese" - !insertmacro MUI_LANGUAGE "Italian" - !insertmacro MUI_LANGUAGE "Danish" - !insertmacro MUI_LANGUAGE "Polish" - !insertmacro MUI_LANGUAGE "Czech" - !insertmacro MUI_LANGUAGE "Slovenian" - !insertmacro MUI_LANGUAGE "Slovak" - !insertmacro MUI_LANGUAGE "Swedish" - !insertmacro MUI_LANGUAGE "Norwegian" - !insertmacro MUI_LANGUAGE "PortugueseBR" - !insertmacro MUI_LANGUAGE "Ukrainian" - !insertmacro MUI_LANGUAGE "Turkish" - !insertmacro MUI_LANGUAGE "Catalan" - !insertmacro MUI_LANGUAGE "Arabic" - !insertmacro MUI_LANGUAGE "Lithuanian" - !insertmacro MUI_LANGUAGE "Finnish" - !insertmacro MUI_LANGUAGE "Greek" - !insertmacro MUI_LANGUAGE "Korean" - !insertmacro MUI_LANGUAGE "Hebrew" - !insertmacro MUI_LANGUAGE "Portuguese" - !insertmacro MUI_LANGUAGE "Farsi" - !insertmacro MUI_LANGUAGE "Bulgarian" - !insertmacro MUI_LANGUAGE "Indonesian" - !insertmacro MUI_LANGUAGE "Japanese" - !insertmacro MUI_LANGUAGE "Croatian" - !insertmacro MUI_LANGUAGE "Serbian" - !insertmacro MUI_LANGUAGE "Thai" - !insertmacro MUI_LANGUAGE "NorwegianNynorsk" - !insertmacro MUI_LANGUAGE "Belarusian" - !insertmacro MUI_LANGUAGE "Albanian" - !insertmacro MUI_LANGUAGE "Malay" - !insertmacro MUI_LANGUAGE "Galician" - !insertmacro MUI_LANGUAGE "Basque" - !insertmacro MUI_LANGUAGE "Luxembourgish" - !insertmacro MUI_LANGUAGE "Afrikaans" - !insertmacro MUI_LANGUAGE "Uzbek" - !insertmacro MUI_LANGUAGE "Macedonian" - !insertmacro MUI_LANGUAGE "Latvian" - !insertmacro MUI_LANGUAGE "Bosnian" - !insertmacro MUI_LANGUAGE "Mongolian" - !insertmacro MUI_LANGUAGE "Estonian" - -!insertmacro MUI_RESERVEFILE_LANGDLL - -Function .onInit - - !insertmacro MUI_LANGDLL_DISPLAY - -FunctionEnd - -Section "Install" - # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) - SetOutPath $INSTDIR - # Files added here should be removed by the uninstaller (see section "uninstall") - File "minikube.exe" - File "logo.ico" - File "update_path.ps1" - # Add any other files for the install directory (license files, app data, etc) here - - # Uninstaller - See function un.onInit and section "uninstall" for configuration - WriteUninstaller "$INSTDIR\uninstall.exe" - - # Start Menu - CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" - CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" - - # Registry information for add/remove programs - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" - WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" - WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" - WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} - WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} - - # There is no option for modifying or repairing the install - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 - WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 - - # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size - WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} - - # Add installed executable to PATH - # Cannot uset EnvVarUpdate since the path can be too long - # this is explicitly warned in the documentation page - # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' - -SectionEnd - -Section "Uninstall" - - # Remove Start Menu launcher - Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" - # Try to remove the Start Menu folder - this will only happen if it is empty - RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" - - # Remove uninstalled executable from PATH - nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; Removes minikube from System Path - - # Remove files - Delete /REBOOTOK $INSTDIR\minikube.exe - Delete /REBOOTOK $INSTDIR\logo.ico - Delete /REBOOTOK $INSTDIR\update_path.ps1 - - # Always delete uninstaller as the last action - Delete /REBOOTOK $INSTDIR\uninstall.exe - - # Try to remove the install directory - this will only happen if it is empty - RmDir /REBOOTOK $INSTDIR - - # Remove uninstaller information from the registry - DeleteRegKey HKLM "${UNINSTALLDIR}" - -SectionEnd +# This installs two files, minikube.exe and logo.ico, creates a start menu shortcut, builds an uninstaller, and +# adds uninstall information to the registry for Add/Remove Programs + +# To get started, put this script into a folder with the two files (minikube.exe, logo.ico, and LICENSE.txt - +# You'll have to create these yourself) and run makensis on it + +# If you change the names "minikube.exe", "logo.ico", or "LICENSE.txt" you should do a search and replace - they +# show up in a few places. +# All the other settings can be tweaked by editing the !defines at the top of this script +# Unicode true # This command is not available in 2.46 which is on apt-get. Debating how to proceed +!define APPNAME "Minikube" +!define COMPANYNAME "Kubernetes" +!define DESCRIPTION "A Local Kubernetes Development Environment" +# These three must be integers +!define VERSIONMAJOR --VERSION_MAJOR-- +!define VERSIONMINOR --VERSION_MINOR-- +!define VERSIONBUILD --VERSION_BUILD-- +# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" +# It is possible to use "mailto:" links in here to open the email client +!define HELPURL "https://github.com/kubernetes/minikube" # "Support Information" link +!define UPDATEURL "https://github.com/kubernetes/minikube/releases" # "Product Updates" link +!define ABOUTURL "https://github.com/kubernetes/minikube" # "Publisher" link +# This is the size (in kB) of all the files copied into "Program Files" +!define INSTALLSIZE --INSTALL_SIZE-- + +RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) + +InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}" +!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" +BrandingText " " + +# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) +# This will be in the installer/uninstaller's title bar +Name "${COMPANYNAME} - ${APPNAME}" +Icon "logo.ico" +OutFile "minikube-installer.exe" + +!include "LogicLib.nsh" +!include "MUI2.nsh" ; Modern UI + +!define MUI_ICON "logo.ico" +!define MUI_UNICON "logo.ico" +!define MUI_WELCOMEFINISHPAGE_BITMAP "logo.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "logo.bmp" +!define MUI_HEADERIMAGE_BITMAP "logo.bmp" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_UNFINISHPAGE_NOAUTOCLOSE + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +; Set languages (first is default language) +;!insertmacro MUI_LANGUAGE "English" +!define MUI_LANGDLL_ALLLANGUAGES +;Languages + + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "Hungarian" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Polish" + !insertmacro MUI_LANGUAGE "Czech" + !insertmacro MUI_LANGUAGE "Slovenian" + !insertmacro MUI_LANGUAGE "Slovak" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !insertmacro MUI_LANGUAGE "Ukrainian" + !insertmacro MUI_LANGUAGE "Turkish" + !insertmacro MUI_LANGUAGE "Catalan" + !insertmacro MUI_LANGUAGE "Arabic" + !insertmacro MUI_LANGUAGE "Lithuanian" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Hebrew" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "Farsi" + !insertmacro MUI_LANGUAGE "Bulgarian" + !insertmacro MUI_LANGUAGE "Indonesian" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Croatian" + !insertmacro MUI_LANGUAGE "Serbian" + !insertmacro MUI_LANGUAGE "Thai" + !insertmacro MUI_LANGUAGE "NorwegianNynorsk" + !insertmacro MUI_LANGUAGE "Belarusian" + !insertmacro MUI_LANGUAGE "Albanian" + !insertmacro MUI_LANGUAGE "Malay" + !insertmacro MUI_LANGUAGE "Galician" + !insertmacro MUI_LANGUAGE "Basque" + !insertmacro MUI_LANGUAGE "Luxembourgish" + !insertmacro MUI_LANGUAGE "Afrikaans" + !insertmacro MUI_LANGUAGE "Uzbek" + !insertmacro MUI_LANGUAGE "Macedonian" + !insertmacro MUI_LANGUAGE "Latvian" + !insertmacro MUI_LANGUAGE "Bosnian" + !insertmacro MUI_LANGUAGE "Mongolian" + !insertmacro MUI_LANGUAGE "Estonian" + +!insertmacro MUI_RESERVEFILE_LANGDLL + +Function .onInit + + !insertmacro MUI_LANGDLL_DISPLAY + +FunctionEnd + +Section "Install" + # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) + SetOutPath $INSTDIR + # Files added here should be removed by the uninstaller (see section "uninstall") + File "minikube.exe" + File "logo.ico" + File "update_path.ps1" + # Add any other files for the install directory (license files, app data, etc) here + + # Uninstaller - See function un.onInit and section "uninstall" for configuration + WriteUninstaller "$INSTDIR\uninstall.exe" + + # Start Menu + CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" + CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\minikube.exe" "" "$INSTDIR\logo.ico" + + # Registry information for add/remove programs + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}" + WriteRegStr HKLM "${UNINSTALLDIR}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" + WriteRegStr HKLM "${UNINSTALLDIR}" "InstallLocation" "$\"$INSTDIR$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "Publisher" "$\"${COMPANYNAME}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "HelpLink" "$\"${HELPURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "URLInfoAbout" "$\"${ABOUTURL}$\"" + WriteRegStr HKLM "${UNINSTALLDIR}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\"" + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMajor" ${VERSIONMAJOR} + WriteRegDWORD HKLM "${UNINSTALLDIR}" "VersionMinor" ${VERSIONMINOR} + + # There is no option for modifying or repairing the install + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoModify" 1 + WriteRegDWORD HKLM "${UNINSTALLDIR}" "NoRepair" 1 + + # Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size + WriteRegDWORD HKLM "${UNINSTALLDIR}" "EstimatedSize" ${INSTALLSIZE} + + # Add installed executable to PATH + # Cannot uset EnvVarUpdate since the path can be too long + # this is explicitly warned in the documentation page + # http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Add -Path "$INSTDIR"' + +SectionEnd + +Section "Uninstall" + + # Remove Start Menu launcher + Delete /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" + # Try to remove the Start Menu folder - this will only happen if it is empty + RmDir /REBOOTOK "$SMPROGRAMS\${COMPANYNAME}" + + # Remove uninstalled executable from PATH + nsExec::ExecToLog 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "$INSTDIR\update_path.ps1" -Remove -Path "$INSTDIR"' ; Removes minikube from System Path + + # Remove files + Delete /REBOOTOK $INSTDIR\minikube.exe + Delete /REBOOTOK $INSTDIR\logo.ico + Delete /REBOOTOK $INSTDIR\update_path.ps1 + + # Always delete uninstaller as the last action + Delete /REBOOTOK $INSTDIR\uninstall.exe + + # Try to remove the install directory - this will only happen if it is empty + RmDir /REBOOTOK $INSTDIR + + # Remove uninstaller information from the registry + DeleteRegKey HKLM "${UNINSTALLDIR}" + +SectionEnd From 5fdbfa3dfd4e6e14e2bf3de53d429b74d942e8c2 Mon Sep 17 00:00:00 2001 From: Olivier Lemasle Date: Tue, 27 Aug 2019 15:37:12 +0200 Subject: [PATCH 05/30] Fix doc typo --- site/content/en/docs/Reference/Drivers/none.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/en/docs/Reference/Drivers/none.md b/site/content/en/docs/Reference/Drivers/none.md index f9591bca67..fab769fb54 100644 --- a/site/content/en/docs/Reference/Drivers/none.md +++ b/site/content/en/docs/Reference/Drivers/none.md @@ -56,7 +56,7 @@ As Kubernetes has full access to both your filesystem as well as your docker ima * Many `minikube` commands are not supported, such as: `dashboard`, `mount`, `ssh` * minikube with the `none` driver has a confusing permissions model, as some commands need to be run as root ("start"), and others by a regular user ("dashboard") * CoreDNS detects resolver loop, goes into CrashLoopBackOff - [#3511](https://github.com/kubernetes/minikube/issues/3511) -* Some versions of Linux have a version of docker that is newer then what Kubernetes expects. To overwrite this, run minikube with the following parameters: `sudo -E minikube start --vm-driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification` +* Some versions of Linux have a version of docker that is newer than what Kubernetes expects. To overwrite this, run minikube with the following parameters: `sudo -E minikube start --vm-driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification` * [Full list of open 'none' driver issues](https://github.com/kubernetes/minikube/labels/co%2Fnone-driver) From de74ee1eb4a5f557d568439d2c3ebcafaad524f7 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 27 Aug 2019 09:42:16 -0700 Subject: [PATCH 06/30] Announce environmental overrides up front --- cmd/minikube/cmd/start.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 0265b33579..ff58b7c04d 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -253,6 +253,7 @@ func runStart(cmd *cobra.Command, args []string) { prefix = fmt.Sprintf("[%s] ", viper.GetString(cfg.MachineProfile)) } out.T(out.Happy, "{{.prefix}}minikube {{.version}} on {{.platform}}", out.V{"prefix": prefix, "version": version.GetVersion(), "platform": platform()}) + displayEnviron(os.Environ()) // if --registry-mirror specified when run minikube start, // take arg precedence over MINIKUBE_REGISTRY_MIRROR @@ -331,7 +332,18 @@ func runStart(cmd *cobra.Command, args []string) { } } showKubectlConnectInfo(kubeconfig) +} +// displayEnviron makes the user aware of environment variables that will affect how minikube operates +func displayEnviron(env []string) { + for _, kv := range env { + bits := strings.SplitN(kv, "=", 2) + k := bits[0] + v := bits[1] + if strings.HasPrefix(k, "MINIKUBE_") || k == constants.KubeconfigEnvVar { + out.T(out.Option, "{{.key}}={{.value}}", out.V{"key": k, "value": v}) + } + } } func setupKubeconfig(h *host.Host, c *cfg.Config) (*kubeconfig.Settings, error) { @@ -354,6 +366,7 @@ func setupKubeconfig(h *host.Host, c *cfg.Config) (*kubeconfig.Settings, error) KeepContext: viper.GetBool(keepContext), EmbedCerts: viper.GetBool(embedCerts), } + kcs.SetPath(kubeconfig.PathFromEnv()) if err := kubeconfig.Update(kcs); err != nil { return kcs, err From 540d6944bac693287e5fabe2b80d9305e93c760e Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Tue, 27 Aug 2019 10:37:13 -0700 Subject: [PATCH 07/30] GPU documentation fixes --- site/content/en/docs/Tutorials/nvidia_gpu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/content/en/docs/Tutorials/nvidia_gpu.md b/site/content/en/docs/Tutorials/nvidia_gpu.md index 64626c3ce9..5d2e2c9ae5 100644 --- a/site/content/en/docs/Tutorials/nvidia_gpu.md +++ b/site/content/en/docs/Tutorials/nvidia_gpu.md @@ -15,10 +15,10 @@ description: > ## Using the KVM2 driver -When using NVIDIA GPUs with the kvm2 vm-driver. We passthrough spare GPUs on the +When using NVIDIA GPUs with the kvm2 vm-driver, we passthrough spare GPUs on the host to the minikube VM. Doing so has a few prerequisites: -- You must install the [kvm2 driver](drivers.md#kvm2-driver). If you already had +- You must install the [kvm2 driver](/docs/start/linux/#hypervisor-setup). If you already had this installed make sure that you fetch the latest `docker-machine-driver-kvm2` binary that has GPU support. @@ -44,7 +44,7 @@ host to the minikube VM. Doing so has a few prerequisites: - Once you reboot the system after doing the above, you should be ready to use GPUs with kvm2. Run the following command to start minikube: ```shell - minikube start --vm-driver kvm2 --gpu + minikube start --vm-driver kvm2 --kvm-gpu ``` This command will check if all the above conditions are satisfied and From 7a158a364293948b6ed969710081d04bb86a09ba Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 27 Aug 2019 20:22:22 -0700 Subject: [PATCH 08/30] Version bump to v1.4.0-beta.0 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 844cb71a76..3540810dc8 100755 --- a/Makefile +++ b/Makefile @@ -14,10 +14,10 @@ # Bump these on release - and please check ISO_VERSION for correctness. VERSION_MAJOR ?= 1 -VERSION_MINOR ?= 3 -VERSION_BUILD ?= 1 +VERSION_MINOR ?= 4 +VERSION_BUILD ?= 0-beta.0 # Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions -ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).0 +ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).${VERSION_BUILD} VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD) DEB_VERSION ?= $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD) From ee9c4a52dbd537d439e1e26b8e146f84580a090a Mon Sep 17 00:00:00 2001 From: Alok Kumar Date: Wed, 28 Aug 2019 09:00:14 +0530 Subject: [PATCH 09/30] Removing undocumented MINIKUBE_WANTREPORTERRORPROMPT Fixes #5037 --- site/content/en/docs/Tutorials/continuous_integration.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/site/content/en/docs/Tutorials/continuous_integration.md b/site/content/en/docs/Tutorials/continuous_integration.md index 53ce4e46de..aa904e7667 100644 --- a/site/content/en/docs/Tutorials/continuous_integration.md +++ b/site/content/en/docs/Tutorials/continuous_integration.md @@ -30,7 +30,6 @@ curl -Lo kubectl \ && sudo install kubectl /usr/local/bin/ export MINIKUBE_WANTUPDATENOTIFICATION=false -export MINIKUBE_WANTREPORTERRORPROMPT=false export MINIKUBE_HOME=$HOME export CHANGE_MINIKUBE_NONE_USER=true export KUBECONFIG=$HOME/.kube/config @@ -40,4 +39,3 @@ touch $KUBECONFIG sudo -E minikube start --vm-driver=none ``` - From a213c4922893c8a225cd733602e421076dc8c3d7 Mon Sep 17 00:00:00 2001 From: chentanjun <2799194073@qq.com> Date: Wed, 28 Aug 2019 11:37:40 +0800 Subject: [PATCH 10/30] fix-up md word mistake --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c3d1a26d0..25a82bae13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -529,7 +529,7 @@ Huge thank you for this release towards our contributors: * Updating e2e tests instructions [#3509](https://github.com/kubernetes/minikube/pull/3509) * Defer dashboard deployment until "minikube dashboard" is executed [#3485](https://github.com/kubernetes/minikube/pull/3485) * Change minikube-hostpath storage class addon from Reconcile to EnsureExists [#3497](https://github.com/kubernetes/minikube/pull/3497) -* Tell user given driver has been ignored if exising VM is different [#3374](https://github.com/kubernetes/minikube/pull/3374) +* Tell user given driver has been ignored if existing VM is different [#3374](https://github.com/kubernetes/minikube/pull/3374) Thank you to all to everyone who contributed to this massive release: @@ -719,7 +719,7 @@ Huge Thank You for this release to our contributors: ## Version 0.28.1 - 7/16/2018 * vboxsf Host Mounting fixed (Linux Kernel version downgraded to 4.15 from 4.16) [#2986](https://github.com/kubernetes/minikube/pull/2986) -* cri-tools udpated to 1.11.1 [#2986](https://github.com/kubernetes/minikube/pull/2986) +* cri-tools updated to 1.11.1 [#2986](https://github.com/kubernetes/minikube/pull/2986) * Feature Gates support added to kubeadm bootstrapper [#2951](https://github.com/kubernetes/minikube/pull/2951) * Kubernetes 1.11 build support added [#2943](https://github.com/kubernetes/minikube/pull/2943) * GPU support for kvm2 driver added [#2936](https://github.com/kubernetes/minikube/pull/2936) From 2c533cf5f7ab8612995f2ff607d84ca8636376cd Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 27 Aug 2019 20:50:29 -0700 Subject: [PATCH 11/30] Update driver install URL, adjust upgrade text --- cmd/minikube/cmd/start.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index bd82235e4c..4f5d6f8828 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -970,18 +970,14 @@ func saveConfig(clusterCfg *cfg.Config) error { } func validateDriverVersion(vmDriver string) { - var ( - driverExecutable string - driverDocumentation string - ) + var driverExecutable string + driverDocumentation := fmt.Sprintf("%s%s#driver-installation", constants.DriverDocumentation, vmDriver) switch vmDriver { case constants.DriverKvm2: driverExecutable = fmt.Sprintf("docker-machine-driver-%s", constants.DriverKvm2) - driverDocumentation = fmt.Sprintf("%s#%s", constants.DriverDocumentation, "kvm2-upgrade") case constants.DriverHyperkit: driverExecutable = fmt.Sprintf("docker-machine-driver-%s", constants.DriverHyperkit) - driverDocumentation = fmt.Sprintf("%s#%s", constants.DriverDocumentation, "hyperkit-upgrade") default: // driver doesn't support version return } @@ -1002,7 +998,7 @@ func validateDriverVersion(vmDriver string) { if len(v) == 0 && !viper.GetBool(force) { exit.WithCodeT( exit.Failure, - "Please upgrade the '{{.driver_executable}}'. {{.documentation_url}}", + "The installed version of '{{.driver_executable}}' is obsolete. Upgrade: {{.documentation_url}}", out.V{"driver_executable": driverExecutable, "documentation_url": driverDocumentation}, ) } @@ -1021,8 +1017,8 @@ func validateDriverVersion(vmDriver string) { if vmDriverVersion.LT(minikubeVersion) { out.WarningT( - "There's a new version for '{{.driver_executable}}'. Please consider upgrading. {{.documentation_url}}", - out.V{"driver_executable": driverExecutable, "documentation_url": driverDocumentation}, + "The installed version of '{{.driver_executable}}' ({{.driver_version}}) is no longer current. Upgrade: {{.documentation_url}}", + out.V{"driver_executable": driverExecutable, "driver_version": vmDriverVersion, "documentation_url": driverDocumentation}, ) } } From 001c4fc7b0cfb50a8a88d79dd11d11e2924fc75f Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 11:42:14 -0700 Subject: [PATCH 12/30] Use path.Join instead of filepath.Join to avoid generating bad paths in Windows --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 16 +++++++++------- pkg/minikube/command/command_runner.go | 4 ++-- pkg/minikube/command/exec_runner.go | 3 ++- pkg/minikube/command/ssh_runner.go | 3 +-- pkg/minikube/machine/cache_images.go | 2 +- test/integration/util/minikube_runner.go | 3 ++- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index be805f4c4f..532cd1ab4a 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -19,10 +19,12 @@ package kubeadm import ( "bytes" "crypto/tls" + + // WARNING: Do not use filepath here unless you want bizarre paths to be used in Windows "fmt" "net" "net/http" - "path/filepath" + "path" "runtime" "strings" "time" @@ -95,7 +97,7 @@ var PodsByLayer = []pod{ } // yamlConfigPath is the path to the kubeadm configuration -var yamlConfigPath = filepath.Join(constants.GuestEphemeralDir, "kubeadm.yaml") +var yamlConfigPath = path.Join(constants.GuestEphemeralDir, "kubeadm.yaml") // SkipAdditionalPreflights are additional preflights we skip depending on the runtime in use. var SkipAdditionalPreflights = map[string][]string{} @@ -200,7 +202,7 @@ func createFlagsFromExtraArgs(extraOptions config.ExtraOptionSlice) string { // etcdDataDir is where etcd data is stored. func etcdDataDir() string { - return filepath.Join(constants.GuestPersistentDir, "etcd") + return path.Join(constants.GuestPersistentDir, "etcd") } // createCompatSymlinks creates compatibility symlinks to transition running services to new directory structures @@ -538,7 +540,7 @@ func NewKubeletConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, }{ ExtraOptions: convertToFlags(extraOpts), ContainerRuntime: k8s.ContainerRuntime, - KubeletPath: filepath.Join(binRoot(k8s.KubernetesVersion), "kubelet"), + KubeletPath: path.Join(binRoot(k8s.KubernetesVersion), "kubelet"), } if err := kubeletSystemdTemplate.Execute(&b, opts); err != nil { return nil, err @@ -700,7 +702,7 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, er // NewKubeletService returns a generated systemd unit file for the kubelet func NewKubeletService(cfg config.KubernetesConfig) ([]byte, error) { var b bytes.Buffer - opts := struct{ KubeletPath string }{KubeletPath: filepath.Join(binRoot(cfg.KubernetesVersion), "kubelet")} + opts := struct{ KubeletPath string }{KubeletPath: path.Join(binRoot(cfg.KubernetesVersion), "kubelet")} if err := kubeletServiceTemplate.Execute(&b, opts); err != nil { return nil, errors.Wrap(err, "template execute") } @@ -725,7 +727,7 @@ func configFiles(cfg config.KubernetesConfig, kubeadm []byte, kubelet []byte, ku // binDir returns the persistent path binaries are stored in func binRoot(version string) string { - return filepath.Join(constants.GuestPersistentDir, "binaries", version) + return path.Join(constants.GuestPersistentDir, "binaries", version) } // invokeKubeadm returns the invocation command for Kubeadm @@ -744,7 +746,7 @@ func transferBinaries(cfg config.KubernetesConfig, c command.Runner) error { return errors.Wrapf(err, "downloading %s", name) } - dst := filepath.Join(binRoot(cfg.KubernetesVersion), name) + dst := path.Join(binRoot(cfg.KubernetesVersion), name) if err := machine.CopyBinary(c, src, dst); err != nil { return errors.Wrapf(err, "copybinary %s -> %s", src, dst) } diff --git a/pkg/minikube/command/command_runner.go b/pkg/minikube/command/command_runner.go index 7350fa6c06..57f250b0ca 100644 --- a/pkg/minikube/command/command_runner.go +++ b/pkg/minikube/command/command_runner.go @@ -19,7 +19,7 @@ package command import ( "fmt" "io" - "path/filepath" + "path" "k8s.io/minikube/pkg/minikube/assets" ) @@ -54,5 +54,5 @@ type Runner interface { } func getDeleteFileCommand(f assets.CopyableFile) string { - return fmt.Sprintf("sudo rm %s", filepath.Join(f.GetTargetDir(), f.GetTargetName())) + return fmt.Sprintf("sudo rm %s", path.Join(f.GetTargetDir(), f.GetTargetName())) } diff --git a/pkg/minikube/command/exec_runner.go b/pkg/minikube/command/exec_runner.go index fa14019077..84891597e7 100644 --- a/pkg/minikube/command/exec_runner.go +++ b/pkg/minikube/command/exec_runner.go @@ -21,6 +21,7 @@ import ( "io" "os" "os/exec" + "path" "path/filepath" "strconv" @@ -76,7 +77,7 @@ func (*ExecRunner) Copy(f assets.CopyableFile) error { if err := os.MkdirAll(f.GetTargetDir(), os.ModePerm); err != nil { return errors.Wrapf(err, "error making dirs for %s", f.GetTargetDir()) } - targetPath := filepath.Join(f.GetTargetDir(), f.GetTargetName()) + targetPath := path.Join(f.GetTargetDir(), f.GetTargetName()) if _, err := os.Stat(targetPath); err == nil { if err := os.Remove(targetPath); err != nil { return errors.Wrapf(err, "error removing file %s", targetPath) diff --git a/pkg/minikube/command/ssh_runner.go b/pkg/minikube/command/ssh_runner.go index 77f580418e..08d6370740 100644 --- a/pkg/minikube/command/ssh_runner.go +++ b/pkg/minikube/command/ssh_runner.go @@ -21,7 +21,6 @@ import ( "fmt" "io" "path" - "path/filepath" "sync" "github.com/golang/glog" @@ -167,7 +166,7 @@ func (s *SSHRunner) Copy(f assets.CopyableFile) error { // StdinPipe is closed. But let's use errgroup to make it explicit. var g errgroup.Group var copied int64 - dst := filepath.Join(path.Join(f.GetTargetDir(), f.GetTargetName())) + dst := path.Join(path.Join(f.GetTargetDir(), f.GetTargetName())) glog.Infof("Transferring %d bytes to %s", f.GetLength(), dst) g.Go(func() error { diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index c37b9db0ee..de1bae1a77 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -44,7 +44,7 @@ import ( ) // loadRoot is where images should be loaded from within the guest VM -var loadRoot = filepath.Join(constants.GuestPersistentDir, "images") +var loadRoot = path.Join(constants.GuestPersistentDir, "images") var getWindowsVolumeName = getWindowsVolumeNameCmd diff --git a/test/integration/util/minikube_runner.go b/test/integration/util/minikube_runner.go index 0513e28e0c..11576653c4 100644 --- a/test/integration/util/minikube_runner.go +++ b/test/integration/util/minikube_runner.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "os/exec" + "path" "path/filepath" "regexp" "strings" @@ -50,7 +51,7 @@ type MinikubeRunner struct { // Remove removes a file func (m *MinikubeRunner) Remove(f assets.CopyableFile) error { - _, err := m.SSH(fmt.Sprintf("rm -rf %s", filepath.Join(f.GetTargetDir(), f.GetTargetName()))) + _, err := m.SSH(fmt.Sprintf("rm -rf %s", path.Join(f.GetTargetDir(), f.GetTargetName()))) return err } From f4db16ff6e1a758a22764c17c8376a97480770c3 Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 13:03:59 -0700 Subject: [PATCH 13/30] Fix confusing log message which used the wrong filepath.Join --- pkg/minikube/assets/vm_assets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/assets/vm_assets.go b/pkg/minikube/assets/vm_assets.go index f73a86bf3d..e91863f110 100644 --- a/pkg/minikube/assets/vm_assets.go +++ b/pkg/minikube/assets/vm_assets.go @@ -80,7 +80,7 @@ func NewMemoryAssetTarget(d []byte, targetPath, permissions string) *MemoryAsset // NewFileAsset creates a new FileAsset func NewFileAsset(src, targetDir, targetName, permissions string) (*FileAsset, error) { - glog.Infof("NewFileAsset: %s -> %s", src, filepath.Join(targetDir, targetName)) + glog.Infof("NewFileAsset: %s -> %s", src, path.Join(targetDir, targetName)) f, err := os.Open(src) if err != nil { return nil, errors.Wrapf(err, "Error opening file asset: %s", src) From b08de8e0f5ae651cbdcade2ca2cbe798296a9b18 Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 13:13:52 -0700 Subject: [PATCH 14/30] More filepath -> path --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 3 ++- pkg/minikube/machine/cache_binaries.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 532cd1ab4a..11f420ea48 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -20,10 +20,11 @@ import ( "bytes" "crypto/tls" - // WARNING: Do not use filepath here unless you want bizarre paths to be used in Windows "fmt" "net" "net/http" + + // WARNING: Do not use path/filepath in this package unless you want bizarre Windows paths "path" "runtime" "strings" diff --git a/pkg/minikube/machine/cache_binaries.go b/pkg/minikube/machine/cache_binaries.go index 8dd2c03ff4..a3d1e87ed7 100644 --- a/pkg/minikube/machine/cache_binaries.go +++ b/pkg/minikube/machine/cache_binaries.go @@ -20,7 +20,6 @@ import ( "crypto" "os" "path" - "path/filepath" "runtime" "github.com/golang/glog" @@ -93,7 +92,7 @@ func CacheBinary(binary, version, osName, archName string) (string, error) { // CopyBinary copies a locally cached binary to the guest VM func CopyBinary(cr command.Runner, src string, dest string) error { - f, err := assets.NewFileAsset(src, filepath.Dir(dest), filepath.Base(dest), "0755") + f, err := assets.NewFileAsset(src, path.Dir(dest), path.Base(dest), "0755") if err != nil { return errors.Wrap(err, "new file asset") } From 50f132be0af2d8e934d9ca8c04f1b994ab11585f Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 13:16:12 -0700 Subject: [PATCH 15/30] Remove path/filepath call --- pkg/minikube/assets/vm_assets.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/minikube/assets/vm_assets.go b/pkg/minikube/assets/vm_assets.go index e91863f110..fb79c81829 100644 --- a/pkg/minikube/assets/vm_assets.go +++ b/pkg/minikube/assets/vm_assets.go @@ -23,7 +23,6 @@ import ( "io" "os" "path" - "path/filepath" "github.com/golang/glog" "github.com/pkg/errors" From 3b198d19d6345a2d0cf216f86810526ed296818c Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 13:47:26 -0700 Subject: [PATCH 16/30] More logging to debug path issues --- pkg/minikube/machine/cache_images.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index de1bae1a77..e7ba15d12a 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -25,6 +25,7 @@ import ( "runtime" "strings" "sync" + "time" "github.com/golang/glog" "github.com/google/go-containerregistry/pkg/authn" @@ -77,6 +78,7 @@ func CacheImages(images []string, cacheDir string) error { if err := CacheImage(image, dst); err != nil { return errors.Wrapf(err, "caching image %s", dst) } + glog.Infof("CacheImage %s -> %s succeeded", image, dst) return nil }) } @@ -143,7 +145,9 @@ func CacheAndLoadImages(images []string) error { func sanitizeCacheDir(image string) string { if runtime.GOOS == "windows" && hasWindowsDriveLetter(image) { // not sanitize Windows drive letter. - return image[:2] + strings.Replace(image[2:], ":", "_", -1) + s := image[:2] + strings.Replace(image[2:], ":", "_", -1) + glog.Infof("windows sanitize: %s -> %s", image, s) + return s } return strings.Replace(image, ":", "_", -1) } @@ -286,8 +290,14 @@ func getDstPath(dst string) (string, error) { // CacheImage caches an image func CacheImage(image, dst string) error { - glog.Infof("Attempting to cache image: %s at %s\n", image, dst) + start := time.Now() + glog.Infof("CacheImage: %s -> %s", image, dst) + defer func() { + glog.Infof("CacheImage: %s -> %s completed in %s", image, dst, time.Since(start)) + }() + if _, err := os.Stat(dst); err == nil { + glog.Infof("%s exists", dst) return nil } @@ -331,6 +341,7 @@ func CacheImage(image, dst string) error { if err != nil { return err } + glog.Infof("%s exists", dst) return nil } From 79d7f8a7372bca99c5c30c0e2db606889358ed9e Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 14:17:03 -0700 Subject: [PATCH 17/30] Log caching errors --- pkg/minikube/machine/cache_images.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index e7ba15d12a..26917132ed 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -76,6 +76,7 @@ func CacheImages(images []string, cacheDir string) error { dst := filepath.Join(cacheDir, image) dst = sanitizeCacheDir(dst) if err := CacheImage(image, dst); err != nil { + glog.Errorf("CacheImage %s -> %s failed: %v", image, dst, err) return errors.Wrapf(err, "caching image %s", dst) } glog.Infof("CacheImage %s -> %s succeeded", image, dst) From 73d7526800b6f1bc66a31dc905ea216f5c5176c9 Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 14:46:24 -0700 Subject: [PATCH 18/30] Add retrieveImage logging --- pkg/minikube/machine/cache_images.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index 26917132ed..0569244ce7 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -347,10 +347,20 @@ func CacheImage(image, dst string) error { } func retrieveImage(ref name.Reference) (v1.Image, error) { + glog.Infof("retrieving image: %+v", ref) img, err := daemon.Image(ref) if err == nil { glog.Infof("found %s locally; caching", ref.Name()) return img, err } - return remote.Image(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain)) + glog.Infof("daemon image for %+v: %v", img, err) + img, err = remote.Image(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain)) + if img, err != nil { + glog.Warningf("failed authn download for %+v (trying anon): %+v", ref, err) + img, err = remote.Image(ref) + if err != nil { + glog.Warningf("failed anon download for %+v: %+v", ref, err) + } + } + return img, err } From cbbba12b6a00ea221bb104ad7b00645afc33750c Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 28 Aug 2019 14:56:48 -0700 Subject: [PATCH 19/30] Fix comparison --- pkg/minikube/machine/cache_images.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/minikube/machine/cache_images.go b/pkg/minikube/machine/cache_images.go index 0569244ce7..397460ff93 100644 --- a/pkg/minikube/machine/cache_images.go +++ b/pkg/minikube/machine/cache_images.go @@ -355,12 +355,13 @@ func retrieveImage(ref name.Reference) (v1.Image, error) { } glog.Infof("daemon image for %+v: %v", img, err) img, err = remote.Image(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain)) - if img, err != nil { - glog.Warningf("failed authn download for %+v (trying anon): %+v", ref, err) - img, err = remote.Image(ref) - if err != nil { - glog.Warningf("failed anon download for %+v: %+v", ref, err) - } + if err == nil { + return img, err + } + glog.Warningf("failed authn download for %+v (trying anon): %+v", ref, err) + img, err = remote.Image(ref) + if err != nil { + glog.Warningf("failed anon download for %+v: %+v", ref, err) } return img, err } From ef912eaec38fad87769b7b019bea127e9de9158a Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Thu, 29 Aug 2019 22:07:23 +1000 Subject: [PATCH 20/30] Improve test coverage for proxy package --- pkg/minikube/proxy/proxy.go | 5 ++ pkg/minikube/proxy/proxy_test.go | 111 +++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/pkg/minikube/proxy/proxy.go b/pkg/minikube/proxy/proxy.go index 9d911b5649..ce67b4920a 100644 --- a/pkg/minikube/proxy/proxy.go +++ b/pkg/minikube/proxy/proxy.go @@ -57,6 +57,11 @@ func isInBlock(ip string, block string) (bool, error) { // ExcludeIP will exclude the ip from the http(s)_proxy func ExcludeIP(ip string) error { + if netIp := net.ParseIP(ip); netIp == nil { + if _, _, err := net.ParseCIDR(ip); err != nil { + return fmt.Errorf("ExcludeIP(%v) requires IP as a parameter or CIDR", ip) + } + } return updateEnv(ip, "NO_PROXY") } diff --git a/pkg/minikube/proxy/proxy_test.go b/pkg/minikube/proxy/proxy_test.go index 25dccce10d..508e82515f 100644 --- a/pkg/minikube/proxy/proxy_test.go +++ b/pkg/minikube/proxy/proxy_test.go @@ -18,8 +18,11 @@ package proxy import ( "fmt" + "net/http" "os" "testing" + + "k8s.io/client-go/rest" ) func TestIsValidEnv(t *testing.T) { @@ -55,6 +58,7 @@ func TestIsInBlock(t *testing.T) { {"192.168.0.2", "192.168.0.1/32", false, false}, {"192.168.0.1", "192.168.0.1/18", true, false}, {"abcd", "192.168.0.1/18", false, true}, + {"192.168.0.1", "foo", false, true}, } for _, tc := range testCases { t.Run(fmt.Sprintf("%s in %s", tc.ip, tc.block), func(t *testing.T) { @@ -124,6 +128,7 @@ func TestCheckEnv(t *testing.T) { {"192.168.0.13", "NO_PROXY", true, "192.168.0.13/22"}, {"192.168.0.13", "NO_PROXY", true, "10.10.0.13,192.168.0.13"}, {"192.168.0.13", "NO_PROXY", false, "10.10.0.13/22"}, + {"10.10.10.4", "NO_PROXY", true, "172.168.0.0/30,10.10.10.0/24"}, } for _, tc := range testCases { t.Run(fmt.Sprintf("%s in %s", tc.ip, tc.envName), func(t *testing.T) { @@ -149,3 +154,109 @@ func TestCheckEnv(t *testing.T) { } } + +func TestIsIPExcluded(t *testing.T) { + var testCases = []struct { + ip, env string + excluded bool + }{ + {"1.2.3.4", "7.7.7.7", false}, + {"1.2.3.4", "1.2.3.4", true}, + {"1.2.3.4", "", false}, + {"foo", "", false}, + {"foo", "bar", false}, + {"foo", "1.2.3.4", false}, + } + for _, tc := range testCases { + t.Run(fmt.Sprintf("exclude %s NO_PROXY(%v)", tc.ip, tc.env), func(t *testing.T) { + originalEnv := os.Getenv("NO_PROXY") + defer func() { // revert to pre-test env var + err := os.Setenv("NO_PROXY", originalEnv) + if err != nil { + t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) + } + }() + if err := os.Setenv("NO_PROXY", tc.env); err != nil { + t.Errorf("Error during setting env: %v", err) + } + if excluded := IsIPExcluded(tc.ip); excluded != tc.excluded { + t.Fatalf("IsIPExcluded(%v) should return %v. NO_PROXY=%v", tc.ip, tc.excluded, tc.env) + } + }) + } +} + +func TestExcludeIP(t *testing.T) { + var testCases = []struct { + ip, env string + wantAErr bool + }{ + {"1.2.3.4", "", false}, + {"", "", true}, + {"7.7.7.7", "7.7.7.7", false}, + {"7.7.7.7", "1.2.3.4", false}, + {"foo", "", true}, + {"foo", "1.2.3.4", true}, + } + for _, tc := range testCases { + t.Run(fmt.Sprintf("exclude %s NO_PROXY(%s)", tc.ip, tc.env), func(t *testing.T) { + originalEnv := os.Getenv("NO_PROXY") + defer func() { // revert to pre-test env var + err := os.Setenv("NO_PROXY", originalEnv) + if err != nil { + t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) + } + }() + if err := os.Setenv("NO_PROXY", tc.env); err != nil { + t.Errorf("Error during setting env: %v", err) + } + err := ExcludeIP(tc.ip) + if err != nil && !tc.wantAErr { + t.Errorf("ExcludeIP(%v) returned unexpected error %v", tc.ip, err) + } + if err == nil && tc.wantAErr { + t.Errorf("ExcludeIP(%v) should return error but error is %v", tc.ip, err) + } + }) + } +} + +func TestUpdateTransport(t *testing.T) { + t.Run("new", func(t *testing.T) { + rc := rest.Config{} + c := UpdateTransport(&rc) + tr := &http.Transport{} + tr.RegisterProtocol("file", http.NewFileTransport(http.Dir("/tmp"))) + rt := c.WrapTransport(tr) + if _, ok := rt.(http.RoundTripper); !ok { + t.Fatalf("Cannot cast rt(%v) to http.RoundTripper", rt) + } + }) + t.Run("existing", func(t *testing.T) { + // rest config initialized with WrapTransport function + rc := rest.Config{WrapTransport: func(http.RoundTripper) http.RoundTripper { + rt := &http.Transport{} + rt.RegisterProtocol("file", http.NewFileTransport(http.Dir("/tmp"))) + return rt + }} + + transport := &http.Transport{} + transport.RegisterProtocol("file", http.NewFileTransport(http.Dir("/"))) + + c := UpdateTransport(&rc) + rt := c.WrapTransport(nil) + + if rt == rc.WrapTransport(transport) { + t.Fatalf("Excpected to reuse existing RoundTripper(%v) but found %v", rt, transport) + } + + }) + t.Run("nil", func(t *testing.T) { + rc := rest.Config{} + c := UpdateTransport(&rc) + rt := c.WrapTransport(nil) + if rt != nil { + t.Fatalf("Expected RoundTripper nil for invocation WrapTransport(nil)") + } + }) +} From a08e295d9f159478fa0706b71e6a0ad66adda101 Mon Sep 17 00:00:00 2001 From: AllenZMC Date: Thu, 29 Aug 2019 21:51:38 +0800 Subject: [PATCH 21/30] cleanup: fix mis-spelling in kapi.go --- pkg/kapi/kapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index c4564e18d2..1aa96301be 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -142,7 +142,7 @@ func WaitForRCToStabilize(c kubernetes.Interface, ns, name string, timeout time. return err } -// WaitForDeploymentToStabilize waits till the Deployment has a matching generation/replica count between spec and status. used by integrationt tests +// WaitForDeploymentToStabilize waits till the Deployment has a matching generation/replica count between spec and status. used by integration tests func WaitForDeploymentToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error { options := meta.ListOptions{FieldSelector: fields.Set{ "metadata.name": name, From d4ac66eac515d5849610596035eaf5993b6435f6 Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Thu, 29 Aug 2019 23:57:20 +1000 Subject: [PATCH 22/30] fix variable name --- pkg/minikube/proxy/proxy.go | 4 ++-- pkg/minikube/proxy/proxy_test.go | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pkg/minikube/proxy/proxy.go b/pkg/minikube/proxy/proxy.go index ce67b4920a..bdcc530880 100644 --- a/pkg/minikube/proxy/proxy.go +++ b/pkg/minikube/proxy/proxy.go @@ -57,9 +57,9 @@ func isInBlock(ip string, block string) (bool, error) { // ExcludeIP will exclude the ip from the http(s)_proxy func ExcludeIP(ip string) error { - if netIp := net.ParseIP(ip); netIp == nil { + if netIP := net.ParseIP(ip); netIP == nil { if _, _, err := net.ParseCIDR(ip); err != nil { - return fmt.Errorf("ExcludeIP(%v) requires IP as a parameter or CIDR", ip) + return fmt.Errorf("ExcludeIP(%v) requires IP or CIDR as a parameter", ip) } } return updateEnv(ip, "NO_PROXY") diff --git a/pkg/minikube/proxy/proxy_test.go b/pkg/minikube/proxy/proxy_test.go index 508e82515f..ab56d93614 100644 --- a/pkg/minikube/proxy/proxy_test.go +++ b/pkg/minikube/proxy/proxy_test.go @@ -36,11 +36,9 @@ func TestIsValidEnv(t *testing.T) { } for _, tc := range testCases { t.Run(tc.env, func(t *testing.T) { - got := isValidEnv(tc.env) - if got != tc.want { + if got := isValidEnv(tc.env); got != tc.want { t.Errorf("isValidEnv(\"%v\") got %v; want %v", tc.env, got, tc.want) } - }) } @@ -140,16 +138,12 @@ func TestCheckEnv(t *testing.T) { } }() - // defer os.Setenv(tc.envName, originalEnv) - err := os.Setenv(tc.envName, tc.mockEnvValue) // setting up the test case - if err != nil { + if err := os.Setenv(tc.envName, tc.mockEnvValue); err != nil { t.Error("Error setting env var for taste case") } - got := checkEnv(tc.ip, tc.envName) - if got != tc.want { + if got := checkEnv(tc.ip, tc.envName); got != tc.want { t.Errorf("CheckEnv(%v,%v) got %v ; want is %v", tc.ip, tc.envName, got, tc.want) } - }) } From 8a022356682339b00c940f6d5523a51d2f25fb30 Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Fri, 30 Aug 2019 00:02:23 +1000 Subject: [PATCH 23/30] Improve subtests names --- pkg/minikube/proxy/proxy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/proxy/proxy_test.go b/pkg/minikube/proxy/proxy_test.go index ab56d93614..5e59d2355e 100644 --- a/pkg/minikube/proxy/proxy_test.go +++ b/pkg/minikube/proxy/proxy_test.go @@ -59,7 +59,7 @@ func TestIsInBlock(t *testing.T) { {"192.168.0.1", "foo", false, true}, } for _, tc := range testCases { - t.Run(fmt.Sprintf("%s in %s", tc.ip, tc.block), func(t *testing.T) { + t.Run(fmt.Sprintf("%s in %s Want: %t WantAErr: %t", tc.ip, tc.block, tc.want, tc.wanntAErr), func(t *testing.T) { got, err := isInBlock(tc.ip, tc.block) gotErr := false if err != nil { @@ -90,7 +90,7 @@ func TestUpdateEnv(t *testing.T) { {"192.168.0.13", "NPROXY", true}, } for _, tc := range testCases { - t.Run(fmt.Sprintf("%s in %s", tc.ip, tc.env), func(t *testing.T) { + t.Run(fmt.Sprintf("%s in %s WantAErr: %t", tc.ip, tc.env, tc.wantErr), func(t *testing.T) { origVal := os.Getenv(tc.env) gotErr := false err := updateEnv(tc.ip, tc.env) From 6dac0467c7f054611d7c9a6c18e25ace2c9782d5 Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Fri, 30 Aug 2019 00:07:13 +1000 Subject: [PATCH 24/30] improve function comment and move env var restoration to main test --- pkg/minikube/proxy/proxy.go | 2 +- pkg/minikube/proxy/proxy_test.go | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkg/minikube/proxy/proxy.go b/pkg/minikube/proxy/proxy.go index bdcc530880..97753431de 100644 --- a/pkg/minikube/proxy/proxy.go +++ b/pkg/minikube/proxy/proxy.go @@ -55,7 +55,7 @@ func isInBlock(ip string, block string) (bool, error) { return false, errors.Wrapf(err, "Error ip not in block") } -// ExcludeIP will exclude the ip from the http(s)_proxy +// ExcludeIP takes ip or CIDR as string and excludes the it from the http(s)_proxy func ExcludeIP(ip string) error { if netIP := net.ParseIP(ip); netIP == nil { if _, _, err := net.ParseCIDR(ip); err != nil { diff --git a/pkg/minikube/proxy/proxy_test.go b/pkg/minikube/proxy/proxy_test.go index 5e59d2355e..17f62e2a86 100644 --- a/pkg/minikube/proxy/proxy_test.go +++ b/pkg/minikube/proxy/proxy_test.go @@ -162,14 +162,14 @@ func TestIsIPExcluded(t *testing.T) { {"foo", "1.2.3.4", false}, } for _, tc := range testCases { + originalEnv := os.Getenv("NO_PROXY") + defer func() { // revert to pre-test env var + err := os.Setenv("NO_PROXY", originalEnv) + if err != nil { + t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) + } + }() t.Run(fmt.Sprintf("exclude %s NO_PROXY(%v)", tc.ip, tc.env), func(t *testing.T) { - originalEnv := os.Getenv("NO_PROXY") - defer func() { // revert to pre-test env var - err := os.Setenv("NO_PROXY", originalEnv) - if err != nil { - t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) - } - }() if err := os.Setenv("NO_PROXY", tc.env); err != nil { t.Errorf("Error during setting env: %v", err) } @@ -192,15 +192,15 @@ func TestExcludeIP(t *testing.T) { {"foo", "", true}, {"foo", "1.2.3.4", true}, } + originalEnv := os.Getenv("NO_PROXY") + defer func() { // revert to pre-test env var + err := os.Setenv("NO_PROXY", originalEnv) + if err != nil { + t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) + } + }() for _, tc := range testCases { t.Run(fmt.Sprintf("exclude %s NO_PROXY(%s)", tc.ip, tc.env), func(t *testing.T) { - originalEnv := os.Getenv("NO_PROXY") - defer func() { // revert to pre-test env var - err := os.Setenv("NO_PROXY", originalEnv) - if err != nil { - t.Fatalf("Error reverting env NO_PROXY to its original value (%s) var after test ", originalEnv) - } - }() if err := os.Setenv("NO_PROXY", tc.env); err != nil { t.Errorf("Error during setting env: %v", err) } From fa9ddcd7f1b18b96361126fd037a6901a0a84d74 Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Fri, 30 Aug 2019 07:54:32 +1000 Subject: [PATCH 25/30] typofix in comment --- pkg/minikube/proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/proxy/proxy.go b/pkg/minikube/proxy/proxy.go index 97753431de..a65d29098c 100644 --- a/pkg/minikube/proxy/proxy.go +++ b/pkg/minikube/proxy/proxy.go @@ -55,7 +55,7 @@ func isInBlock(ip string, block string) (bool, error) { return false, errors.Wrapf(err, "Error ip not in block") } -// ExcludeIP takes ip or CIDR as string and excludes the it from the http(s)_proxy +// ExcludeIP takes ip or CIDR as string and excludes it from the http(s)_proxy func ExcludeIP(ip string) error { if netIP := net.ParseIP(ip); netIP == nil { if _, _, err := net.ParseCIDR(ip); err != nil { From 8b17253d229af26d661efed55f5946ae4b9e0fbb Mon Sep 17 00:00:00 2001 From: bpopovschi Date: Mon, 2 Sep 2019 11:39:38 +0300 Subject: [PATCH 26/30] Moved warning to minikube start command and print it to stderr --- cmd/minikube/cmd/root.go | 9 --------- cmd/minikube/cmd/start.go | 22 +++++++++++++++------- pkg/minikube/notify/notify.go | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index f7f2e38aa6..f028873b91 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -37,7 +37,6 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/exit" - "k8s.io/minikube/pkg/minikube/notify" "k8s.io/minikube/pkg/minikube/translate" ) @@ -53,10 +52,6 @@ var dirs = [...]string{ constants.MakeMiniPath("logs"), } -var ( - enableUpdateNotification = true -) - var viperWhiteList = []string{ "v", "alsologtostderr", @@ -92,10 +87,6 @@ var RootCmd = &cobra.Command{ exit.WithError("logdir set failed", err) } } - - if enableUpdateNotification { - notify.MaybePrintUpdateTextFromGithub() - } }, } diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 4f5d6f8828..ed4ab3de10 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -30,6 +30,8 @@ import ( "strings" "time" + "k8s.io/minikube/pkg/minikube/notify" + "github.com/blang/semver" "github.com/docker/machine/libmachine" "github.com/docker/machine/libmachine/host" @@ -107,13 +109,14 @@ const ( ) var ( - registryMirror []string - dockerEnv []string - dockerOpt []string - insecureRegistry []string - apiServerNames []string - apiServerIPs []net.IP - extraOptions cfg.ExtraOptionSlice + registryMirror []string + dockerEnv []string + dockerOpt []string + insecureRegistry []string + apiServerNames []string + apiServerIPs []net.IP + extraOptions cfg.ExtraOptionSlice + enableUpdateNotification = true ) func init() { @@ -216,6 +219,11 @@ var startCmd = &cobra.Command{ Short: "Starts a local kubernetes cluster", Long: "Starts a local kubernetes cluster", Run: runStart, + PersistentPreRun: func(cmd *cobra.Command, args []string) { + if enableUpdateNotification { + notify.MaybePrintUpdateTextFromGithub() + } + }, } // platform generates a user-readable platform message diff --git a/pkg/minikube/notify/notify.go b/pkg/minikube/notify/notify.go index 55f09cdf9b..864f3f251b 100644 --- a/pkg/minikube/notify/notify.go +++ b/pkg/minikube/notify/notify.go @@ -67,7 +67,7 @@ func MaybePrintUpdateText(url string, lastUpdatePath string) { } url := "https://github.com/kubernetes/minikube/releases/tag/v" + latestVersion.String() out.ErrT(out.WarningType, `minikube {{.version}} is available! Download it: {{.url}}`, out.V{"version": latestVersion, "url": url}) - out.T(out.Tip, "To disable this notice, run: 'minikube config set WantUpdateNotification false'") + out.ErrT(out.Tip, "To disable this notice, run: 'minikube config set WantUpdateNotification false'") } } From c8f753c49df03752b0a1fba97e1e3ac94eee3e22 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Tue, 3 Sep 2019 12:16:23 -0400 Subject: [PATCH 27/30] Fix thrift ref --- go.mod | 1 + go.sum | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d1e8617070..4a13df9237 100644 --- a/go.mod +++ b/go.mod @@ -107,4 +107,5 @@ replace ( k8s.io/sample-apiserver => k8s.io/kubernetes/staging/src/k8s.io/sample-apiserver v0.0.0-20190623232353-8c3b7d7679cc k8s.io/sample-cli-plugin => k8s.io/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20190623232353-8c3b7d7679cc k8s.io/sample-controller => k8s.io/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20190623232353-8c3b7d7679cc + git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999 ) diff --git a/go.sum b/go.sum index a835ad1629..b2a41eeddc 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,7 @@ dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/Azure/azure-sdk-for-go v21.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= From c32cb098b0f7459bc226b55b5e644a3479ebad36 Mon Sep 17 00:00:00 2001 From: tstromberg Date: Tue, 3 Sep 2019 10:34:44 -0700 Subject: [PATCH 28/30] More logs: exited containers, controller manager, double line count --- cmd/minikube/cmd/logs.go | 2 +- pkg/minikube/logs/logs.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/minikube/cmd/logs.go b/cmd/minikube/cmd/logs.go index 0b9bb55b4a..85269cefdd 100644 --- a/cmd/minikube/cmd/logs.go +++ b/cmd/minikube/cmd/logs.go @@ -97,5 +97,5 @@ var logsCmd = &cobra.Command{ func init() { logsCmd.Flags().BoolVarP(&followLogs, "follow", "f", false, "Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.") logsCmd.Flags().BoolVar(&showProblems, "problems", false, "Show only log entries which point to known problems") - logsCmd.Flags().IntVarP(&numberOfLines, "length", "n", 30, "Number of lines back to go within the log") + logsCmd.Flags().IntVarP(&numberOfLines, "length", "n", 60, "Number of lines back to go within the log") } diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index 8897c4e0c2..69e9f023a3 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -36,7 +36,7 @@ import ( // rootCauseRe is a regular expression that matches known failure root causes var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate|kubelet.*no API client|kubelet.*No api server|STDIN.*127.0.0.1:8080`) -// ignoreRe is a regular expression that matches spurious errors to not surface +// ignoreCauseRe is a regular expression that matches spurious errors to not surface var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply") // importantPods are a list of pods to retrieve logs for, in addition to the bootstrapper logs. @@ -48,6 +48,7 @@ var importantPods = []string{ "kube-addon-manager", "kubernetes-dashboard", "storage-provisioner", + "kube-controller-manager", } // lookbackwardsCount is how far back to look in a log for problems. This should be large enough to @@ -161,7 +162,10 @@ func logCommands(r cruntime.Manager, bs bootstrapper.Bootstrapper, length int, f glog.Warningf("No container was found matching %q", pod) continue } - cmds[pod] = r.ContainerLogCmd(ids[0], length, follow) + for _, i := range ids { + key := fmt.Sprintf("%s [%s]", pod, i) + cmds[key] = r.ContainerLogCmd(i, length, follow) + } } cmds[r.Name()] = r.SystemLogCmd(length) // Works across container runtimes with good formatting From cbf443c467b3011f0cae197abf903006d4d231b1 Mon Sep 17 00:00:00 2001 From: tstromberg Date: Tue, 3 Sep 2019 10:38:29 -0700 Subject: [PATCH 29/30] Upgrade default to v1.16.0-beta1 for more test coverage --- pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go | 4 ++-- pkg/minikube/constants/constants.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go index d22f89cdb0..0c5152489e 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go @@ -84,7 +84,7 @@ Wants=containerd.service [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.15.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m +ExecStart=/var/lib/minikube/binaries/v1.16.0-beta.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m [Install] `, @@ -103,7 +103,7 @@ Wants=docker.socket [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.15.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-infra-container-image=docker-proxy-image.io/google_containers/pause:3.1 --pod-manifest-path=/etc/kubernetes/manifests +ExecStart=/var/lib/minikube/binaries/v1.16.0-beta.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-infra-container-image=docker-proxy-image.io/google_containers/pause:3.1 --pod-manifest-path=/etc/kubernetes/manifests [Install] `, diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index ca3a47d8a8..fac2abe2ff 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -178,7 +178,7 @@ var DefaultISOURL = fmt.Sprintf("https://storage.googleapis.com/%s/minikube-%s.i var DefaultISOSHAURL = DefaultISOURL + SHASuffix // DefaultKubernetesVersion is the default kubernetes version -var DefaultKubernetesVersion = "v1.15.2" +var DefaultKubernetesVersion = "v1.16.0-beta.1" // NewestKubernetesVersion is the newest Kubernetes version to test against var NewestKubernetesVersion = "v1.16.0-beta.1" From a440d2877766a1e3ae0dfe4c2a5142e05ec9d43e Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Tue, 3 Sep 2019 16:45:58 -0700 Subject: [PATCH 30/30] Get make builds working on Windows --- Makefile | 22 +++++++++++++------ go.mod | 2 +- .../en/docs/Contributing/building.en.md | 2 ++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 3540810dc8..21dc46017e 100755 --- a/Makefile +++ b/Makefile @@ -123,7 +123,7 @@ ifeq ($(IN_DOCKER),1) endif ifeq ($(GOOS),windows) - IS_EXE = ".exe" + IS_EXE = .exe endif @@ -142,7 +142,7 @@ out/minikube-%: pkg/minikube/assets/assets.go pkg/minikube/translate/translation ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@) else - GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube + GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$(subst $(IS_EXE), ,$*)))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube endif .PHONY: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe @@ -151,7 +151,7 @@ e2e-darwin-amd64: out/e2e-darwin-amd64 e2e-windows-amd64.exe: out/e2e-windows-amd64.exe out/e2e-%: out/minikube-% - GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go test -c k8s.io/minikube/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" -o $@ + GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$(subst $(IS_EXE), ,$*)))" go test -c k8s.io/minikube/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" -o $@ out/e2e-windows-amd64.exe: out/e2e-windows-amd64 cp $< $@ @@ -179,7 +179,7 @@ linux-menuconfig: $(MAKE) -C $(BUILD_DIR)/buildroot/output/build/linux-$(KERNEL_VERSION)/ savedefconfig cp $(BUILD_DIR)/buildroot/output/build/linux-$(KERNEL_VERSION)/defconfig deploy/iso/minikube-iso/board/coreos/minikube/linux_defconfig -out/minikube.iso: $(shell find deploy/iso/minikube-iso -type f) +out/minikube.iso: $(shell find "deploy/iso/minikube-iso" -type f) ifeq ($(IN_DOCKER),1) $(MAKE) minikube_iso else @@ -233,18 +233,26 @@ extract: go run cmd/extract/extract.go # Regenerates assets.go when template files have been updated -pkg/minikube/assets/assets.go: $(shell find deploy/addons -type f) +pkg/minikube/assets/assets.go: $(shell find "deploy/addons" -type f) ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@) +else ifeq ($(GOOS),windows) + which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/... + PATH="$(PATH);$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/... + -gofmt -s -w $@ else which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/... PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/... -gofmt -s -w $@ endif -pkg/minikube/translate/translations.go: $(shell find translations/ -type f) +pkg/minikube/translate/translations.go: $(shell find "translations/" -type f) ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@) +else ifeq ($(GOOS),windows) + which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/... + PATH="$(PATH);$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg translate translations/... + -gofmt -s -w $@ else which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/... PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg translate translations/... @@ -333,7 +341,7 @@ reportcard: mdlint: @$(MARKDOWNLINT) $(MINIKUBE_MARKDOWN_FILES) -out/docs/minikube.md: $(shell find cmd) $(shell find pkg/minikube/constants) pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go +out/docs/minikube.md: $(shell find "cmd") $(shell find "pkg/minikube/constants") pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go go run -ldflags="$(MINIKUBE_LDFLAGS)" -tags gendocs hack/help_text/gen_help_text.go out/minikube_$(DEB_VERSION).deb: out/minikube-linux-amd64 diff --git a/go.mod b/go.mod index 4a13df9237..83ce03416d 100644 --- a/go.mod +++ b/go.mod @@ -83,6 +83,7 @@ require ( ) replace ( + git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999 k8s.io/api => k8s.io/kubernetes/staging/src/k8s.io/api v0.0.0-20190623232353-8c3b7d7679cc k8s.io/apiextensions-apiserver => k8s.io/kubernetes/staging/src/k8s.io/apiextensions-apiserver v0.0.0-20190623232353-8c3b7d7679cc k8s.io/apimachinery => k8s.io/kubernetes/staging/src/k8s.io/apimachinery v0.0.0-20190623232353-8c3b7d7679cc @@ -107,5 +108,4 @@ replace ( k8s.io/sample-apiserver => k8s.io/kubernetes/staging/src/k8s.io/sample-apiserver v0.0.0-20190623232353-8c3b7d7679cc k8s.io/sample-cli-plugin => k8s.io/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20190623232353-8c3b7d7679cc k8s.io/sample-controller => k8s.io/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20190623232353-8c3b7d7679cc - git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999 ) diff --git a/site/content/en/docs/Contributing/building.en.md b/site/content/en/docs/Contributing/building.en.md index 1379135c0e..ff3f7bb1b9 100644 --- a/site/content/en/docs/Contributing/building.en.md +++ b/site/content/en/docs/Contributing/building.en.md @@ -30,6 +30,8 @@ cd minikube make ``` +Note: On Windows, this will only work in Git Bash or other terminals that support bash commands. + ## Compiling minikube using Docker To cross-compile to/from different operating systems: