diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b7f983a7ff..0d56edbb23 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,6 +12,7 @@ permissions: jobs: generate-docs: + if: github.repository == 'kubernetes/minikube' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 diff --git a/pkg/minikube/detect/detect.go b/pkg/minikube/detect/detect.go index 23ebc31613..c5910efc59 100644 --- a/pkg/minikube/detect/detect.go +++ b/pkg/minikube/detect/detect.go @@ -17,7 +17,6 @@ limitations under the License. package detect import ( - "io" "net/http" "os" "os/exec" @@ -68,27 +67,6 @@ func IsOnGCE() bool { return resp.Header.Get("Metadata-Flavor") == "Google" } -// IsOnAmazonEC2 determines whether minikube is currently running on Amazon EC2 -// and, if yes, on which instance type. -func IsOnAmazonEC2() (bool, string) { - resp, err := http.Get("http://instance-data.ec2.internal/latest/meta-data/instance-type") - if err != nil { - return false, "" - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return true, "" - } - - instanceType, err := io.ReadAll(resp.Body) - if err != nil { - return true, "" - } - - return true, string(instanceType) -} - // IsCloudShell determines whether minikube is running inside CloudShell func IsCloudShell() bool { e := os.Getenv("CLOUD_SHELL") diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index b7d18b7f64..7b85db6b33 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -68,8 +68,6 @@ func TestAddons(t *testing.T) { args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth"}, StartArgs()...) if !NoneDriver() { // none driver does not support ingress args = append(args, "--addons=ingress", "--addons=ingress-dns") - } else if isOnAmazonEC2, instanceType := detect.IsOnAmazonEC2(); isOnAmazonEC2 && strings.HasPrefix(instanceType, "f1.") { - args = append(args, "--addons=inaccel") // inaccel supports only none driver } if !arm64Platform() { args = append(args, "--addons=helm-tiller") @@ -97,7 +95,6 @@ func TestAddons(t *testing.T) { {"HelmTiller", validateHelmTillerAddon}, {"Olm", validateOlmAddon}, {"CSI", validateCSIDriverAndSnapshots}, - {"InAccel", validateInAccelAddon}, } for _, tc := range tests { tc := tc @@ -711,40 +708,3 @@ func validateGCPAuthAddon(ctx context.Context, t *testing.T, profile string) { } } } - -// validateInAccelAddon tests the inaccel addon by trying a vadd -func validateInAccelAddon(ctx context.Context, t *testing.T, profile string) { - defer PostMortemLogs(t, profile) - - if !NoneDriver() { - t.Skipf("skipping: inaccel not supported") - } - - if isOnAmazonEC2, instanceType := detect.IsOnAmazonEC2(); !(isOnAmazonEC2 && strings.HasPrefix(instanceType, "f1.")) { - t.Skipf("skipping: not running on an Amazon EC2 f1 instance") - } - - // create sample pod - rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "create", "--filename", filepath.Join(*testdataDir, "inaccel.yaml"))) - if err != nil { - t.Fatalf("creating pod with %s failed: %v", rr.Command(), err) - } - - if _, err = Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "wait", "--for", "condition=ready", "--timeout", "-1s", "pod/inaccel-vadd")); err != nil { - t.Fatalf("failed waiting for inaccel-vadd pod: %v", err) - } - - rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "logs", "--follow", "pod/inaccel-vadd")) - if err != nil { - t.Fatalf("%q failed: %v", rr.Command(), err) - } - if !strings.Contains(rr.Stdout.String(), "Test PASSED") { - t.Fatalf("expected inaccel-vadd logs to include: %q but got: %s", "Test PASSED", rr.Output()) - } - - // delete pod - rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "delete", "pod/inaccel-vadd")) - if err != nil { - t.Fatalf("deleting pod with %s failed: %v", rr.Command(), err) - } -}