Code Monkey home page Code Monkey logo

Comments (6)

phm07 avatar phm07 commented on August 25, 2024

Thanks for your suggestion! It looks like a useful addition to me, I'll work on an implementation.

from cli.

phm07 avatar phm07 commented on August 25, 2024

I added the feature in #716

Can you please confirm that it works for you with

  • go install github.com/hetznercloud/cli/cmd/hcloud@reset-password-output-options
  • or go run github.com/hetznercloud/cli/cmd/hcloud@reset-password-output-options server reset-password <server> -o=yaml

from cli.

edgecode avatar edgecode commented on August 25, 2024

I added the feature in #716

Wow, that was fast :-)
Thanks for your work!

Can you please confirm that it works for you with

I will.
However, I am not as fast as you are ;-)
And pretty busy atm.
I guess I can test the modified hcloud tool in the next few days, aiming at 2024-03-24.

Thanks again, phm07!
best,
edgecode

from cli.

edgecode avatar edgecode commented on August 25, 2024

Tried to test, but failed due to my non-existant GO skills:
Unfortunalety I cannot dive into this atm.
@phm07 maybe you could give me a quick hint to set up GO correctly.

I am on a Ubuntu 22.04 machine.
It has GO 1.18 installed in Debian/Ubuntu's standard locations, e.g. /usr/{lib,share,bin}/go-1.18

When I run go install as a regular user, it downloads hclould code in ./go and I get:

/home/edge$ go install github.com/hetznercloud/cli/cmd/hcloud@reset-password-output-options
go/pkg/mod/github.com/hetznercloud/[email protected]/internal/cmd/iso/list.go:5:2: package slices is not in GOROOT (/usr/lib/go-1.18/src/slices)

I tried export GOROOT='/usr/lib/go-1.18:/home/edge/go' which did not help.
Reading the error message closer, I guess my GO installation is missing the slices package.
I will retry this evening and see how I can install that package.

from cli.

edgecode avatar edgecode commented on August 25, 2024

I was able to get things working with go 1.22 :-)

Either I did not get the env vars or go.mod concept of go.
Or the package "slices" is not part of go's standard lib in version 1.18.
For the record: I installed the Canonical official snap package on my Ubuntu 22.04 machine which has many go version on board and defaults to go 1.22.

But back to business:
The modified hcloud cli works :-)
I do get YAML or JSON output when I reset a server's password.
And server reset-password --help lists the output options.

@phm07 Thanks again for your fast implementation of this small, but useful hcloud enhancment.

from cli.

apricote avatar apricote commented on August 25, 2024

Yea, slices was only added in Go 1.21, and that is the lowest version we currently support.

Great that it works for you!

I will re-open the issue until the PR is merged, @phm07 will be back next week to take care of that.

from cli.

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.