Code Monkey home page Code Monkey logo

Comments (3)

rawlingsj avatar rawlingsj commented on May 28, 2024

After a bit of digging I found we can use a really crude workaround. If we set the username name to the same format that oc login uses we can set the current-context back to minishift during gofabric8 start after we've logged in. oc login -u admin -p admin updates the minikube username config with the token which means we can reuse the minishift context.

This is not a good approach though as minishift would still use the incorrect context if run without fabric8.

Is there anyone from the openshift team working on minishift that can help advise if there's a way to keep the current minishift context when logging in?

from minishift.

rawlingsj avatar rawlingsj commented on May 28, 2024

FWIW this was the idea that I had to reuse the username format that oc login uses rawlingsj@d2c89e5

from minishift.

coolbrg avatar coolbrg commented on May 28, 2024

@rawlingsj I am not able to reproduce this issue with latest minishift release

$ minishift version
Minishift version: 1.0.0-beta.2

$ minishift start --vm-driver virtualbox
Starting local OpenShift cluster using 'virtualbox' hypervisor...
Downloading ISO
Provisioning OpenShift via '/home/budhram/.minishift/cache/oc/v1.3.1/oc [cluster up --use-existing-config --host-config-dir /var/lib/minishift/openshift.local.config --host-data-dir /var/lib/minishift/hostdata]'
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.3.1 image ... 
   Pulling image openshift/origin:v1.3.1
   Pulled 0/3 layers, 3% complete
   Pulled 0/3 layers, 27% complete
   Pulled 0/3 layers, 49% complete
   Pulled 1/3 layers, 64% complete
   Pulled 1/3 layers, 83% complete
   Pulled 2/3 layers, 87% complete
   Pulled 3/3 layers, 100% complete
   Extracting
   Image pull complete
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... OK
-- Checking type of volume mount ... 
   Using Docker shared volumes for OpenShift volumes
-- Creating host directories ... OK
-- Finding server IP ... 
   Using 192.168.99.100 as the server IP
-- Starting OpenShift container ... 
   Creating initial OpenShift configuration
   Starting OpenShift using container 'origin'
   Waiting for API server to start listening
   OpenShift server started
-- Installing registry ... OK
-- Installing router ... OK
-- Importing image streams ... OK
-- Importing templates ... OK
-- Login to server ... OK
-- Creating initial project "myproject" ... OK
-- Server Information ... 
   OpenShift server started.
   The server is accessible via web console at:
       https://192.168.99.100:8443

   You are logged in as:
       User:     developer
       Password: developer

   To login as administrator:
       oc login -u system:admin

$ kubectl config current-context
myproject/192-168-99-100:8443/developer

$ export PATH=$PATH:~/.minishift/cache/oc/v1.3.1

$ oc login -u system:admin                      
Logged into "https://192.168.99.100:8443" as "system:admin" using existing credentials.

You have access to the following projects and can switch between them with 'oc project <projectname>':

    default
    kube-system
  * myproject
    openshift
    openshift-infra

Using project "myproject".

$ kubectl config current-context                
myproject/192-168-99-100:8443/system:admin

I am closing this issue at the moment but feel free to reopen it if you still experiencing it.

from minishift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.