goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.53k stars 470 forks source link

Remove --generator as it has been deprecated #768

Closed gaganyaan2 closed 2 years ago

gaganyaan2 commented 2 years ago

kubectl --generator has been deprecated

How to reproduce the error

[root@home ~]# kgoss edit -i nignx
[INFO]: Parsing command line
[INFO]: going to execute (may be blank): -- 
[INFO]: Preparing files to copy into container
[INFO]: Creating Kubernetes pod/container to test
++ /usr/local/bin/kubectl run kgoss-tester-998 --image-pull-policy=Always --generator=run-pod/v1 --restart=Never --labels=app=kgoss-test '--output=jsonpath={.metadata.name}' --image= --
error: unknown flag: --generator
See 'kubectl run --help' for usage.
+ id=
+ ret=1
+ cleanup
+ set +ex

Aso after removing --generator from kgoss it does not copy the goss.yaml back to local directory

[root@home ~]# kgoss edit -i nginx
[INFO]: Parsing command line
[INFO]: using image: nginx
[INFO]: going to execute (may be blank): -- 
[INFO]: Preparing files to copy into container
[INFO]: Creating Kubernetes pod/container to test
++ /usr/local/bin/kubectl run kgoss-tester-17296 --image-pull-policy=Always --restart=Never --labels=app=kgoss-test '--output=jsonpath={.metadata.name}' --image=nginx --
+ id=kgoss-tester-17296
+ set +x
[INFO]: Waiting for container to be ready
pod/kgoss-tester-17296 condition met
[INFO]: Copying goss files into pod/container
[INFO]: Marking copied files as executable
[INFO]: Using pod/container: kgoss-tester-17296
[INFO]: When prompt appears you can run `goss add` to add resources
# goss a port 80
Adding Port to './goss.yaml':

tcp:80:
  listening: true
  ip:
  - 0.0.0.0

# 
Copying goss.yaml and goss_wait.yaml files back to local dir
[INFO]: Copied 'goss.yaml' from pod/container to '.'
tar: Removing leading `/' from member names
error: open .: is a directory
[INFO]: Deleting pod/container

I tried hard-coding GOSS_FILES_PATH value to /root but it did not worked

Checklist

Description of change

aelsabbahy commented 2 years ago

@joshgav would love your feedback on this as you were the original implementer.

joshgav commented 2 years ago

LGTM to remove the --generator flag, it was indeed deprecated a while ago.

@koolwithk I'm not sure what's causing the error when copying files back to the local workstation, if it's still happening perhaps open another issue to dig into that.

aelsabbahy commented 2 years ago

Thank you both, much appreciated!