-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
5,892 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Copyright 2019 The Knative Authors | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
|
||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or im | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// +build e2e | ||
// +build !serving | ||
|
||
package e2e | ||
|
||
import ( | ||
"io/ioutil" | ||
"knative.dev/client/pkg/util" | ||
pkgtest "knative.dev/pkg/test" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"gotest.tools/v3/assert" | ||
|
||
"knative.dev/client/lib/test" | ||
) | ||
|
||
func TestMultiContainers(t *testing.T) { | ||
t.Parallel() | ||
it, err := test.NewKnTest() | ||
assert.NilError(t, err) | ||
defer func() { | ||
assert.NilError(t, it.Teardown()) | ||
}() | ||
|
||
r := test.NewKnRunResultCollector(t, it) | ||
defer r.DumpIfFailed() | ||
|
||
tempDir, err := ioutil.TempDir("", "kn-file") | ||
defer os.RemoveAll(tempDir) | ||
assert.NilError(t, err) | ||
|
||
t.Log("Creating a multicontainer service") | ||
out := addContainer(r, "sidecar", pkgtest.ImagePath("sidecarcontainer")) | ||
test.CreateFile("sidecar.yaml", out.Stdout, tempDir, test.FileModeReadWrite) | ||
createServiceWithSidecar(r, "testsvc0", filepath.Join(tempDir, "sidecar.yaml")) | ||
|
||
t.Log("Adding container no error") | ||
out = addContainer(r, "foo", pkgtest.ImagePath("sidecarcontainer")) | ||
r.AssertNoError(out) | ||
assert.Assert(t, util.ContainsAllIgnoreCase(out.Stdout,"containers", "foo", pkgtest.ImagePath("sidecarcontainer"))) | ||
|
||
t.Log("Adding container without name error") | ||
out = addContainer(r, "", pkgtest.ImagePath("sidecarcontainer")) | ||
r.AssertError(out) | ||
assert.Assert(t, util.ContainsAllIgnoreCase(out.Stderr, "requires", "container", "name")) | ||
|
||
t.Log("Adding container without image error") | ||
out = addContainer(r, "foo", "") | ||
r.AssertError(out) | ||
assert.Assert(t, util.ContainsAllIgnoreCase(out.Stderr,"requires", "image", "name")) | ||
} | ||
|
||
func addContainer(r *test.KnRunResultCollector, containerName, image string) test.KnRunResult { | ||
args := []string{"container", "add"} | ||
if containerName != "" { | ||
args = append(args, containerName) | ||
} | ||
if image != "" { | ||
args = append(args, "--image", image) | ||
} | ||
|
||
out := r.KnTest().Kn().RunNoNamespace(args...) | ||
return out | ||
} | ||
|
||
func createServiceWithSidecar(r *test.KnRunResultCollector, serviceName, file string) { | ||
args := []string{"service", "create", serviceName, | ||
"--image", pkgtest.ImagePath("servingcontainer"), | ||
"--port", "8881", | ||
"--containers", file, | ||
} | ||
|
||
out := r.KnTest().Kn().Run(args...) | ||
r.AssertNoError(out) | ||
assert.Check(r.T(), util.ContainsAllIgnoreCase(out.Stdout, "service", serviceName, "creating", "namespace", r.KnTest().Kn().Namespace(), "ready")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2021 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- image: ko://knative.dev/serving/test/test_images/multicontainer/servingcontainer | ||
- image: ko://knative.dev/serving/test/test_images/multicontainer/sidecarcontainer |
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
vendor/knative.dev/networking/pkg/client/clientset/versioned/clientset.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
vendor/knative.dev/networking/pkg/client/clientset/versioned/doc.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
vendor/knative.dev/networking/pkg/client/clientset/versioned/scheme/doc.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
vendor/knative.dev/networking/pkg/client/clientset/versioned/scheme/register.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.