mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Switch to apps/v1 in various tests.
This commit is contained in:
@@ -1,18 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes 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 implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package target_test
|
||||
|
||||
@@ -47,7 +34,7 @@ spec:
|
||||
app: mungebot
|
||||
`)
|
||||
th.WriteF("/app/base/deployment/deployment.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mungebot
|
||||
@@ -79,7 +66,7 @@ func TestMediumBase(t *testing.T) {
|
||||
t.Fatalf("Err: %v", err)
|
||||
}
|
||||
th.AssertActualEqualsExpected(m, `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -174,7 +161,7 @@ adipiscing elit, sed do eiusmod tempor
|
||||
incididunt ut labore et dolore magna aliqua.
|
||||
`)
|
||||
th.WriteF("/app/overlay/deployment/deployment.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mungebot
|
||||
@@ -211,7 +198,7 @@ spec:
|
||||
t.Fatalf("Err: %v", err)
|
||||
}
|
||||
th.AssertActualEqualsExpected(m, `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
|
||||
@@ -30,7 +30,7 @@ resources:
|
||||
`)
|
||||
|
||||
th.WriteF("/app/base/deployment.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
@@ -53,7 +53,7 @@ patchesStrategicMerge:
|
||||
`)
|
||||
|
||||
th.WriteF("/app/probe/dep-patch.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
@@ -79,7 +79,7 @@ patchesStrategicMerge:
|
||||
`)
|
||||
|
||||
th.WriteF("/app/dns/dep-patch.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
@@ -100,7 +100,7 @@ patchesStrategicMerge:
|
||||
`)
|
||||
|
||||
th.WriteF("/app/restart/dep-patch.yaml", `
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
@@ -133,26 +133,27 @@ func TestCompositeDiamond(t *testing.T) {
|
||||
t.Fatalf("Expected resource accumulation error")
|
||||
}
|
||||
if !strings.Contains(
|
||||
err.Error(), "already registered id: extensions_v1beta1_Deployment|~X|my-deployment") {
|
||||
err.Error(), "already registered id: apps_v1_Deployment|~X|my-deployment") {
|
||||
t.Fatalf("Unexpected err: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Expected output
|
||||
//
|
||||
// apiVersion: extensions/v1beta1
|
||||
// kind: Deployment
|
||||
// metadata:
|
||||
// name: my-deployment
|
||||
// spec:
|
||||
// template:
|
||||
// spec:
|
||||
// containers:
|
||||
// - image: my-image
|
||||
// livenessProbe:
|
||||
// httpGet:
|
||||
// path: /healthz
|
||||
// port: 8080
|
||||
// name: my-deployment
|
||||
// dnsPolicy: ClusterFirst
|
||||
// restartPolicy: Always
|
||||
//nolint: varcheck
|
||||
const expectedPatchedDeployment = `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: my-image
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8080
|
||||
name: my-deployment
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user