Giter Site home page Giter Site logo

When I execute `okteto ctx` command with --insecure-skip-tls-verify flag, the `Insecure mode enabled` message is displayed twice about okteto HOT 5 CLOSED

ifbyol avatar ifbyol commented on May 27, 2024
When I execute `okteto ctx` command with --insecure-skip-tls-verify flag, the `Insecure mode enabled` message is displayed twice

from okteto.

Comments (5)

nitishfy avatar nitishfy commented on May 27, 2024

I'll solve this issue. Please assign this to me!

from okteto.

jLopezbarb avatar jLopezbarb commented on May 27, 2024

Assigned!! I don't know how trivial this one is, but let us know if you face any problem and we'll try to give you some tips

from okteto.

nitishfy avatar nitishfy commented on May 27, 2024

Assigned!! I don't know how trivial this one is, but let us know if you face any problem and we'll try to give you some tips

I'm late for this but I've done my research. Here's what I have found after debugging:

The function PersistentPreRun is being called twice, first for the root and then for the context command. Everytime it is called, it is always going to be executing the okteto.SetInsecureSkipTLSVerifyPolicy(ctxOptions.InsecureSkipTlsVerify) function.

if parent := cmd.Parent(); parent != nil {
	if parent.PersistentPreRun != nil {
	   parent.PersistentPreRun(parent, args)
	}
}

When the parent.PersistentPreRun() function is called recursively for the first time, it changes it's value to main.main() due to which we are facing the above issue. For every recursive call, the function okteto.SetInsecureSkipTLSVerifyPolicy(ctxOptions.InsecureSkipTlsVerify) is called.

I think one way we can solve this is by either calling the function before the If statement OR setting up a boolean flag/count pointer.

cc: @jLopezbarb

image

from okteto.

andreafalzetti avatar andreafalzetti commented on May 27, 2024

The change seems requiring some refactoring in order to make the change testable and avoid any workaround. I am removing the good first issue label because such change should be done and owned by the CLI team. Apologies agian @nitishfy and thanks for all your contributions πŸ™‡

from okteto.

github-actions avatar github-actions commented on May 27, 2024

This issue is stale because it has been open for 60 days with no activity. Comment on this issue or it will be closed in 7 days

from okteto.

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.