Fix getting-started guide: Use full paths for YAML files and correct kubeconfig references #1451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the Network Isolation Testing section in
examples/getting-started.mdand thekubectl-allow-network-traffic/kubectl-deny-network-trafficplugin wrappers so that:-kflag works as advertisedChanges
Getting Started Guide (
examples/getting-started.md)YAML file paths: Changed from relative filenames (requiring
cdinto subdirectories) to full relative paths from repository root:examples/multitenancy/hello-world/hello-world-service-composition.yamlexamples/multitenancy/hello-world/hs1.yamlexamples/multitenancy/hello-world/hs2.yamlexamples/multitenancy/hello-world/hs1-no-replicas.yamlexamples/multitenancy/hello-world/hs2-no-replicas.yamlKubeconfig filename: Changed from
provider.conftokubeplus-saas-provider.json(the actual file created byprovider-kubeconfig.pyin the root directory).CRD wait step: Added a wait loop between ResourceComposition creation and instance creation to ensure the HelloWorldService CRD is registered, preventing "resource mapping not found" errors.
Network traffic commands: Updated to include
-k kubeplus-saas-provider.jsonflag (now works correctly with the wrapper fix below).Plugin Wrappers (
plugins/kubectl-allow-network-traffic,plugins/kubectl-deny-network-traffic)Fixed
-kflag parsing: The wrappers now reorder arguments so that-k(when present) comes before the subcommand, matching whatargparseexpects.Current behavior (on master):
kubectl allow-network-traffic hs1 hs2 -k file→ wrapper passesallow hs1 hs2 -k file→ argparse failsFixed behavior (this PR):
kubectl allow-network-traffic hs1 hs2 -k file→ wrapper reorders to-k file allow hs1 hs2→ argparse parses correctlyThis makes the documented CLI shape (
kubectl allow network traffic <ns1> <ns2> [-k <kubeconfig>]) work as intended.Testing
Verified end-to-end on Minikube with Cilium CNI:
minikube start --cni=cilium)kubectl allow-network-traffic hs1 hs2 -k kubeplus-saas-provider.jsonkubectl deny-network-traffic hs1 hs2 -k kubeplus-saas-provider.jsonAll commands work correctly from the repository root without requiring directory changes.