Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lifecycle-operator): adopt KeptnApp name from either Keptn or k8s label #2440

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func generateResource(ctx context.Context, pod *corev1.Pod, namespace string) *k
initEmptyAnnotations(&pod.ObjectMeta, 2)
// at this point if the pod does not have an app annotation it means we create the app
// and it will have a single workload
pod.ObjectMeta.Annotations[apicommon.AppAnnotation] = pod.ObjectMeta.Annotations[apicommon.WorkloadAnnotation]
appName, _ := GetLabelOrAnnotation(&pod.ObjectMeta, apicommon.WorkloadAnnotation, apicommon.K8sRecommendedWorkloadAnnotations)
pod.Annotations[apicommon.AppAnnotation] = appName
// so we can mark the app request as single service type
kacr.Annotations[apicommon.AppTypeAnnotation] = string(apicommon.AppTypeSingleService)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: test
name: test
status:
readyReplicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: test
name: test
spec:
replicas: 1
selector:
matchLabels:
app: test
strategy: {}
template:
metadata:
labels:
app: test
annotations:
app.kubernetes.io/name: "waiter"
keptn.sh/version: "0.4"
spec:
containers:
- image: busybox
name: busybox
command: ['sh', '-c', 'echo The app is running! && sleep infinity']
initContainers:
- name: init-myservice
image: busybox:1.36.1
command: ['sh', '-c', 'sleep 30']
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1
kind: TestStep
commands:
- script: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled'
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnWorkload
metadata:
name: waiter-waiter
---
apiVersion: lifecycle.keptn.sh/v1alpha4
kind: KeptnWorkloadVersion
metadata:
name: waiter-waiter-0.4
status:
currentPhase: Completed
deploymentStatus: Succeeded
postDeploymentEvaluationStatus: Succeeded
postDeploymentStatus: Succeeded
preDeploymentEvaluationStatus: Succeeded
preDeploymentStatus: Succeeded
---
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnApp
metadata:
name: waiter
---
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnAppVersion
metadata:
name: waiter-0.4-6b86b273
Loading