Merge pull request #22810 from amygdala/cassandra2
Automatic merge from submit-queue phase 2 of cassandra example overhaul Here's the next iteration in overhauling this example, towards https://github.com/kubernetes/kubernetes/issues/20961. This removes the pod adoption part, but doesn't (yet) otherwise change any of the resources used. It also includes some README cleanup, and removes some explicit specification of labels in the rc yaml. This PR doesn't yet add any commentary on how we're using the seed provider (re: https://github.com/kubernetes/kubernetes/issues/20961#issuecomment-190405959 etc.). Maybe we should add that. Also: LMK if this PR should include any changes to the links out to the docs. cc @bgrant0607 @johndmulhausen
This commit is contained in:
@@ -477,7 +477,7 @@ func TestAnnotateObjectFromFile(t *testing.T) {
|
||||
switch req.Method {
|
||||
case "GET":
|
||||
switch req.URL.Path {
|
||||
case "/namespaces/test/pods/cassandra":
|
||||
case "/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil
|
||||
default:
|
||||
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
|
||||
@@ -485,7 +485,7 @@ func TestAnnotateObjectFromFile(t *testing.T) {
|
||||
}
|
||||
case "PATCH":
|
||||
switch req.URL.Path {
|
||||
case "/namespaces/test/pods/cassandra":
|
||||
case "/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil
|
||||
default:
|
||||
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
|
||||
@@ -504,7 +504,7 @@ func TestAnnotateObjectFromFile(t *testing.T) {
|
||||
cmd := NewCmdAnnotate(f, buf)
|
||||
cmd.SetOutput(buf)
|
||||
options := &AnnotateOptions{}
|
||||
options.filenames = []string{"../../../examples/cassandra/cassandra.yaml"}
|
||||
options.filenames = []string{"../../../examples/cassandra/cassandra-controller.yaml"}
|
||||
args := []string{"a=b", "c-"}
|
||||
if err := options.Complete(f, buf, cmd, args); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
|
||||
@@ -337,7 +337,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
|
||||
|
||||
cmd := NewCmdGet(f, buf)
|
||||
cmd.SetOutput(buf)
|
||||
cmd.Flags().Set("filename", "../../../examples/cassandra/cassandra.yaml")
|
||||
cmd.Flags().Set("filename", "../../../examples/cassandra/cassandra-controller.yaml")
|
||||
cmd.Run(cmd, []string{})
|
||||
|
||||
expected := []runtime.Object{&pods.Items[0]}
|
||||
@@ -789,9 +789,9 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
|
||||
Codec: codec,
|
||||
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
|
||||
switch req.URL.Path {
|
||||
case "/namespaces/test/pods/cassandra":
|
||||
case "/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods[0])}, nil
|
||||
case "/watch/namespaces/test/pods/cassandra":
|
||||
case "/watch/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: watchBody(codec, events)}, nil
|
||||
default:
|
||||
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
|
||||
@@ -805,7 +805,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
|
||||
cmd.SetOutput(buf)
|
||||
|
||||
cmd.Flags().Set("watch", "true")
|
||||
cmd.Flags().Set("filename", "../../../examples/cassandra/cassandra.yaml")
|
||||
cmd.Flags().Set("filename", "../../../examples/cassandra/cassandra-controller.yaml")
|
||||
cmd.Run(cmd, []string{})
|
||||
|
||||
expected := []runtime.Object{&pods[0], events[0].Object, events[1].Object}
|
||||
|
||||
@@ -333,7 +333,7 @@ func TestLabelForResourceFromFile(t *testing.T) {
|
||||
switch req.Method {
|
||||
case "GET":
|
||||
switch req.URL.Path {
|
||||
case "/namespaces/test/pods/cassandra":
|
||||
case "/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil
|
||||
default:
|
||||
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
|
||||
@@ -341,7 +341,7 @@ func TestLabelForResourceFromFile(t *testing.T) {
|
||||
}
|
||||
case "PATCH":
|
||||
switch req.URL.Path {
|
||||
case "/namespaces/test/pods/cassandra":
|
||||
case "/namespaces/test/replicationcontrollers/cassandra":
|
||||
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil
|
||||
default:
|
||||
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
|
||||
@@ -359,7 +359,7 @@ func TestLabelForResourceFromFile(t *testing.T) {
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
cmd := NewCmdLabel(f, buf)
|
||||
options := &LabelOptions{
|
||||
Filenames: []string{"../../../examples/cassandra/cassandra.yaml"},
|
||||
Filenames: []string{"../../../examples/cassandra/cassandra-controller.yaml"},
|
||||
}
|
||||
|
||||
err := RunLabel(f, buf, cmd, []string{"a=b"}, options)
|
||||
|
||||
Reference in New Issue
Block a user