Giter VIP home page Giter VIP logo

Comments (3)

etopeter avatar etopeter commented on May 27, 2024 1

This issue should be fixed by the latest fix. @2rs2ts Would you be able to verify this fix against master branch?

You can copy kubectl-view-utilization from master branch (chmod +x kubectl-view-utilization) and execute in current derectory ./kubectl-view-utilization instead using command kubectl view-utilization

Effectively in order to test your for loop command would looks like this
for ctx in $(kubectx) ; do ./kubectl-view-utilization --context $ctx -h ; done

from kubectl-view-utilization.

etopeter avatar etopeter commented on May 27, 2024

Thank you for reporting this bug. Looks like there is error when checking if context exists function.
https://github.com/etopeter/kubectl-view-utilization/blob/master/kubectl-view-utilization#L146

test_kubectl_context() {
    local output

    # Check if context exists in kubeconfig
    output=$(kubectl config get-contexts ${VIEW_UTILIZATION_CONTEXT} --no-headers | awk '{print $1;}')

    if [ "${output}" == "${VIEW_UTILIZATION_CONTEXT}" ]; then
        context="--context=${VIEW_UTILIZATION_CONTEXT}"
    else
        echo "Context error"
        exit 1
    fi
}

Fix for that should be simple.

from kubectl-view-utilization.

2rs2ts avatar 2rs2ts commented on May 27, 2024

I can confirm your fix works. Thanks for the quick patch!

from kubectl-view-utilization.

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.