mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
address comments
This commit is contained in:
parent
f55d87ab61
commit
127c2f1e74
@ -140,7 +140,7 @@ func (o *FilenameOptions) validate() []error {
|
|||||||
errs = append(errs, fmt.Errorf("only one of -f or -k can be specified"))
|
errs = append(errs, fmt.Errorf("only one of -f or -k can be specified"))
|
||||||
}
|
}
|
||||||
if len(o.Kustomize) > 0 && o.Recursive {
|
if len(o.Kustomize) > 0 && o.Recursive {
|
||||||
errs = append(errs, fmt.Errorf("-R is not allowed to work with -k"))
|
errs = append(errs, fmt.Errorf("the -k flag can't be used with -f or -R"))
|
||||||
}
|
}
|
||||||
return errs
|
return errs
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ func TestFilenameOptionsValidate(t *testing.T) {
|
|||||||
kustomize: "dir",
|
kustomize: "dir",
|
||||||
recursive: true,
|
recursive: true,
|
||||||
errExp: true,
|
errExp: true,
|
||||||
msgExp: "-R is not allowed to work with -k",
|
msgExp: "the -k flag can't be used with -f or -R",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filenames: []string{"file"},
|
filenames: []string{"file"},
|
||||||
@ -673,6 +673,11 @@ func TestKustomizeDirectoryBuilder(t *testing.T) {
|
|||||||
expectErr: false,
|
expectErr: false,
|
||||||
expectedNames: []string{"test-the-map", "test-the-deployment", "test-the-service"},
|
expectedNames: []string{"test-the-map", "test-the-deployment", "test-the-service"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
directory: filepath.Join(dir, "kustomization.yaml"),
|
||||||
|
expectErr: true,
|
||||||
|
errMsg: "must be a directory to be a root",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
directory: "../../../artifacts/kustomization/should-not-load.yaml",
|
directory: "../../../artifacts/kustomization/should-not-load.yaml",
|
||||||
expectErr: true,
|
expectErr: true,
|
||||||
|
@ -229,7 +229,7 @@ __EOF__
|
|||||||
kube::test::get_object_assert 'deployment test-the-deployment' "{{${id_field}}}" 'test-the-deployment'
|
kube::test::get_object_assert 'deployment test-the-deployment' "{{${id_field}}}" 'test-the-deployment'
|
||||||
kube::test::get_object_assert 'service test-the-service' "{{${id_field}}}" 'test-the-service'
|
kube::test::get_object_assert 'service test-the-service' "{{${id_field}}}" 'test-the-service'
|
||||||
# cleanup
|
# cleanup
|
||||||
kubectl delete configmap/test-the-map deployment/test-the-deployment service/test-the-service
|
kubectl delete -k hack/testdata/kustomize
|
||||||
|
|
||||||
## kubectl apply --kustomize somedir
|
## kubectl apply --kustomize somedir
|
||||||
kubectl apply --kustomize hack/testdata/kustomize
|
kubectl apply --kustomize hack/testdata/kustomize
|
||||||
@ -237,7 +237,7 @@ __EOF__
|
|||||||
kube::test::get_object_assert 'deployment test-the-deployment' "{{${id_field}}}" 'test-the-deployment'
|
kube::test::get_object_assert 'deployment test-the-deployment' "{{${id_field}}}" 'test-the-deployment'
|
||||||
kube::test::get_object_assert 'service test-the-service' "{{${id_field}}}" 'test-the-service'
|
kube::test::get_object_assert 'service test-the-service' "{{${id_field}}}" 'test-the-service'
|
||||||
# cleanup
|
# cleanup
|
||||||
kubectl delete -k hack/testdata/kustomize
|
kubectl delete --kustomize hack/testdata/kustomize
|
||||||
|
|
||||||
set +o nounset
|
set +o nounset
|
||||||
set +o errexit
|
set +o errexit
|
||||||
|
Loading…
Reference in New Issue
Block a user