Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3051 Remove b2d iso support completely #3052

Merged
merged 1 commit into from Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Expand Up @@ -40,7 +40,6 @@ TEST_WITH_SPECIFIED_SHELL ?=

# Linker flags
VERSION_VARIABLES := -X $(REPOPATH)/pkg/version.minishiftVersion=$(MINISHIFT_VERSION) \
-X $(REPOPATH)/pkg/version.b2dIsoVersion=$(B2D_ISO_VERSION) \
-X $(REPOPATH)/pkg/version.centOsIsoVersion=$(CENTOS_ISO_VERSION) \
-X $(REPOPATH)/pkg/version.openshiftVersion=$(OPENSHIFT_VERSION) \
-X $(REPOPATH)/pkg/version.commitSha=$(COMMIT_SHA)
Expand Down
6 changes: 2 additions & 4 deletions cmd/minishift/cmd/start.go
Expand Up @@ -667,9 +667,7 @@ func determineIsoUrl(iso string) string {
isoNotSpecified := ""

switch strings.ToLower(iso) {
case minishiftConstants.B2dIsoAlias, isoNotSpecified:
iso = constants.DefaultB2dIsoUrl
case minishiftConstants.CentOsIsoAlias:
case minishiftConstants.CentOsIsoAlias, isoNotSpecified:
iso = constants.DefaultCentOsIsoUrl
default:
if !(govalidator.IsURL(iso) || strings.HasPrefix(iso, "file:")) {
Expand All @@ -696,7 +694,7 @@ func initStartFlags() *flag.FlagSet {
startFlagSet.String(configCmd.RemoteIPAddress.Name, "", "IP address of the remote machine to provision OpenShift on")
startFlagSet.String(configCmd.RemoteSSHUser.Name, "", "The username of the remote machine to provision OpenShift on")
startFlagSet.String(configCmd.SSHKeyToConnectRemote.Name, "", "SSH private key location on the host to connect remote machine")
startFlagSet.String(configCmd.ISOUrl.Name, minishiftConstants.CentOsIsoAlias, "Location of the minishift ISO. Can be a URL, file URI or one of the following short names: [centos b2d].")
startFlagSet.String(configCmd.ISOUrl.Name, minishiftConstants.CentOsIsoAlias, "Location of the minishift ISO. Can be a URL, file URI or one of the following short names: [centos].")
startFlagSet.String(configCmd.TimeZone.Name, constants.DefaultTimeZone, "TimeZone for Minishift VM")

startFlagSet.AddFlag(dockerEnvFlag)
Expand Down
3 changes: 0 additions & 3 deletions cmd/minishift/cmd/start_test.go
Expand Up @@ -221,9 +221,6 @@ func TestDetermineIsoUrl(t *testing.T) {
in string
out string
}{
{"", constants.DefaultB2dIsoUrl},
{"b2d", constants.DefaultB2dIsoUrl},
{"B2D", constants.DefaultB2dIsoUrl},
{"centos", constants.DefaultCentOsIsoUrl},
{"CentOs", constants.DefaultCentOsIsoUrl},
{"http://my.custom.url/myiso.iso", "http://my.custom.url/myiso.iso"},
Expand Down
1 change: 0 additions & 1 deletion pkg/minikube/constants/constants.go
Expand Up @@ -50,7 +50,6 @@ var (
GlobalConfigFile = filepath.Join(Minipath, "config", "global.json")
AllInstanceConfigPath = filepath.Join(Minipath, "config", "allinstances.json")

DefaultB2dIsoUrl = "https://github.com/minishift/minishift-b2d-iso/releases/download/" + version.GetB2dIsoVersion() + "/" + "minishift-b2d.iso"
DefaultCentOsIsoUrl = "https://github.com/minishift/minishift-centos-iso/releases/download/" + version.GetCentOsIsoVersion() + "/" + "minishift-centos7.iso"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/minishift/config/validations_test.go
Expand Up @@ -124,7 +124,7 @@ func TestValidURL(t *testing.T) {
},
{
value: "b2d",
shouldErr: false,
shouldErr: true,
},
{
value: "random",
Expand Down
3 changes: 1 addition & 2 deletions pkg/minishift/constants/constants.go
Expand Up @@ -24,7 +24,6 @@ import (
)

const (
B2dIsoAlias = "b2d"
CentOsIsoAlias = "centos"
OpenshiftContainerName = "origin"
OpenshiftApiContainerLabel = "io.kubernetes.container.name=apiserver"
Expand All @@ -44,7 +43,7 @@ const (
)

var (
ValidIsoAliases = []string{B2dIsoAlias, CentOsIsoAlias}
ValidIsoAliases = []string{CentOsIsoAlias}
ValidComponents = []string{"automation-service-broker", "service-catalog", "template-service-broker"}
)

Expand Down
2 changes: 0 additions & 2 deletions pkg/minishift/util/iso_path.go
Expand Up @@ -30,8 +30,6 @@ func GetIsoPath(isoURL string) string {
uri, _ := url.Parse(isoURL)

switch true {
case strings.Contains(filepath.Base(isoURL), minishiftConstants.B2dIsoAlias):
return filepath.Join(minishiftConstants.B2dIsoAlias, getIsoVersion(uri.Path))
case strings.Contains(filepath.Base(isoURL), minishiftConstants.CentOsIsoAlias):
return filepath.Join(minishiftConstants.CentOsIsoAlias, getIsoVersion(uri.Path))
default:
Expand Down
4 changes: 0 additions & 4 deletions pkg/minishift/util/iso_path_test.go
Expand Up @@ -28,8 +28,6 @@ func TestGetIsoPath(t *testing.T) {
provided string
expected string
}{
{"https://github.com/minishift/minishift-b2d-iso/releases/download/v1.1.0/minishift-b2d.iso", filepath.Join("b2d", "v1.1.0")},
{"https://github.com/minishift/minishift-b2d-iso/releases/download/v1.2.0/minishift-b2d.iso", filepath.Join("b2d", "v1.2.0")},
{"https://github.com/minishift/minishift-centos-iso/releases/download/v1.1.0/minishift-centos7.iso", filepath.Join("centos", "v1.1.0")},
{"https://github.com/minishift/minishift-centos-iso/releases/download/v1.3.0/minishift-centos7.iso", filepath.Join("centos", "v1.3.0")},
{"https://foo/v1.2.0/minishift-foo.iso", "unnamed"},
Expand All @@ -47,8 +45,6 @@ func Test_getMinikubeIsoVersion(t *testing.T) {
expected string
}{
{"minishift-v0.22.iso", "v0.22."},
{"minishift-b2d.iso", ""},
{"minishift-b2d-iso/releases/download/v1.2.0/minishift-b2d.iso", "v1.2.0"},
{"minishift-centos-iso/releases/download/v1.1.0/minishift-centos7.iso", "v1.1.0"},
}

Expand Down
7 changes: 0 additions & 7 deletions pkg/version/version.go
Expand Up @@ -32,9 +32,6 @@ var (
// The default version of OpenShift
openshiftVersion = "0.0.0-unset"

// The default version of the B2D ISO version
b2dIsoVersion = "0.0.0-unset"

// The default version of the CentOS ISO version
centOsIsoVersion = "0.0.0-unset"

Expand All @@ -54,10 +51,6 @@ func GetOpenShiftVersion() string {
return openshiftVersion
}

func GetB2dIsoVersion() string {
return b2dIsoVersion
}

func GetCentOsIsoVersion() string {
return centOsIsoVersion
}
Expand Down
1 change: 0 additions & 1 deletion test/integration/features/cmd-config.feature
Expand Up @@ -174,7 +174,6 @@ user defined options which changes default behaviour of Minishift.
| property | value | expected |
| iso-url | https://github.com/minishift/minishift-b2d-iso/releases/download/v1.1.0/minishift-b2d.iso | https://github.com/minishift/minishift-b2d-iso/releases/download/v1.1.0/minishift-b2d.iso |
| iso-url | http://github.com/minishift/minishift-centos-iso/releases/download/v1.1.0/minishift-centos7.iso | http://github.com/minishift/minishift-centos-iso/releases/download/v1.1.0/minishift-centos7.iso |
| iso-url | b2d | b2d |
| iso-url | centos | centos |

@quick
Expand Down
10 changes: 2 additions & 8 deletions test/integration/testsuite/prepare.go
Expand Up @@ -68,9 +68,6 @@ func HandleISOVersion() {
GodogTags += "~cdk-only"
isoUrl := os.Getenv("MINISHIFT_ISO_URL")
switch isoUrl {
case "b2d":
fmt.Println("Test run using Boot2Docker iso image.")
isoName = "b2d"
case "", "centos":
fmt.Println("Test run using CentOS iso image.")
isoName = "centos"
Expand All @@ -83,14 +80,11 @@ func HandleISOVersion() {

func determineIsoFromFile(isoUrl string) string {
var isoName string
if matched, _ := regexp.MatchString(".*b2d\\.iso", isoUrl); matched {
fmt.Println("Boot2docker variant was assumed from the filename of ISO.")
isoName = "b2d"
} else if matched, _ := regexp.MatchString(".*centos7\\.iso", isoUrl); matched {
if matched, _ := regexp.MatchString(".*centos7\\.iso", isoUrl); matched {
fmt.Println("CentOS variant was assumed from the filename of ISO.")
isoName = "centos"
} else {
fmt.Println("Can't assume ISO variant from its filename. Will use CentOS. To avoid this situation please name your ISO to end with 'b2d.iso' or 'centos7.iso'.")
fmt.Println("Can't assume ISO variant from its filename. Will use CentOS. To avoid this situation please name your ISO to end with 'centos7.iso'.")
isoName = "centos"
}
return isoName
Expand Down
2 changes: 0 additions & 2 deletions test/integration/testsuite/testsuite.go
Expand Up @@ -773,8 +773,6 @@ func proxyLogShouldContainContent(expected *gherkin.DocString) error {
func catDockerConfigFile() error {
var err error
switch isoName {
case "b2d":
err = ExecutingMinishiftCommandSucceedsOrFails("ssh -- cat /var/lib/boot2docker/profile", "succeeds")
case "centos", "rhel":
err = ExecutingMinishiftCommandSucceedsOrFails("ssh -- cat /etc/systemd/system/docker.service.d/10-machine.conf", "succeeds")
default:
Expand Down