Comments (5)
I feel uncomfortable hving the config file be auto-generated and then used on the next run. Suppose I run hydrophone --dry-run
once, the flag gets remembered and on the next invocation it's automatically dry-run. After the first customized invocation of hydrophone, all subsequent runs of hydrophone --help
would show potentially wrong default values.
IMHO the --config
should be an explicit flag and additional flags would override what's loaded from the config (i.e. flags have higher precedence than the config file, if a config file is even given). The format and possible flags of the config file should be documented in the readme. There could also be an additional --save-config
that, if --config
is given, will write/create it with the values used for that hydrophone run.
from hydrophone.
I believe this is because of the way cobra creates the config on intiail run. We ran into this once before and I thought we were able to get around it.
@rakshitgondwal can you take a peek?
/assign @rakshitgondwal
from hydrophone.
Sure @rjsadow, will have a look later as I am a little short on bandwidth.
from hydrophone.
Tell me how we should change it and I can also take a stab at it. :-)
from hydrophone.
its because we are reading previous config file and if it already exists we do not overwrite it. see https://github.com/kubernetes-sigs/hydrophone/blob/main/cmd/root.go#L191-L199
if there is no need to read previous config file we can instead overwrite it every time.
err := viper.WriteConfig()
if err != nil {
log.Fatal("Error:", err)
}
tried above code and works fine and sets the correct path
reeta@Reetas-MacBook-Pro hydrophone % mkdir ex1
reeta@Reetas-MacBook-Pro hydrophone % ../bin/hydrophone
zsh: no such file or directory: ../bin/hydrophone
reeta@Reetas-MacBook-Pro hydrophone % cd ex1
reeta@Reetas-MacBook-Pro ex1 % ../bin/hydrophone
12:00:48 INF API endpoint: https://127.0.0.1:62613
12:00:48 INF Server version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-19T15:42:59Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/arm64"}
12:00:48 INF Using namespace: conformance
12:00:48 INF Using conformance image: registry.k8s.io/conformance:v1.24.0
12:00:48 INF Using busybox image: registry.k8s.io/e2e-test-images/busybox:1.36.1-1
12:00:48 INF Test framework will start 1 thread(s) and use verbosity level 4.
12:00:48 INF Downloading e2e.log to /Users/reeta/git/hydrophone/ex1/e2e.log...
12:00:48 INF Downloading junit_01.xml to /Users/reeta/git/hydrophone/ex1/junit_01.xml...
12:00:48 ERR Failed to download results: download failed: command terminated with exit code 1 (stderr: cat: can't open '/tmp/results/junit_01.xml': No such file or directory
).
reeta@Reetas-MacBook-Pro ex1 % cd ..
reeta@Reetas-MacBook-Pro hydrophone % mkdir ex2
reeta@Reetas-MacBook-Pro hydrophone % cd ex2
reeta@Reetas-MacBook-Pro ex2 % ../bin/hydrophone
12:01:00 INF API endpoint: https://127.0.0.1:62613
12:01:00 INF Server version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-19T15:42:59Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/arm64"}
12:01:00 INF Using namespace: conformance
12:01:00 INF Using conformance image: registry.k8s.io/conformance:v1.24.0
12:01:00 INF Using busybox image: registry.k8s.io/e2e-test-images/busybox:1.36.1-1
12:01:00 INF Test framework will start 1 thread(s) and use verbosity level 4.
12:01:00 INF Downloading e2e.log to /Users/reeta/git/hydrophone/ex2/e2e.log...
12:01:00 INF Downloading junit_01.xml to /Users/reeta/git/hydrophone/ex2/junit_01.xml...
12:01:00 ERR Failed to download results: download failed: command terminated with exit code 1 (stderr: cat: can't open '/tmp/results/junit_01.xml': No such file or directory
).
reeta@Reetas-MacBook-Pro ex2 %
from hydrophone.
Related Issues (20)
- Simplify Testing setup with Makefile HOT 4
- `#hydrophone` should be added to the README HOT 9
- Remove `cfg` and `config` from `PrintListImages()` HOT 3
- Fix different timezones in logs HOT 13
- Show some progress info for the tests HOT 3
- Redundant error check in client.PrintE2ELogs() function HOT 4
- Add a brew repo HOT 12
- hydrophone --cleanup is broken HOT 3
- Broken links in README HOT 5
- multiple typo and grammatical mistake in air-gapped.md HOT 2
- Improve logging for resource creation HOT 6
- `--parallel` flag not working?
- Use --verbosity to toggle between spinner and verbose Ginkgo output
- Ability to run Windows Operational Readiness tests from hydrophone HOT 2
- Create an ADOPTERS.md to track who is using hydrophone HOT 1
- Incorrect description for --test-repo flag in hydrophone help output HOT 3
- Build and provide a container image containing hydrophone for use in CI/CD systems
- Automatic detection of CI environments to disable the spinner HOT 2
- Add flag to allow re-using of existing namespace
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hydrophone.