Skip to content

Commit

Permalink
🐛 (deploy-image/v1-alpha1): Fix sample by ensuring the right labels
Browse files Browse the repository at this point in the history
The config/sample generated when we are using the plugin was missing the labels

````yaml
  labels:
    app.kubernetes.io/name: {{ .ProjectName }}
    app.kubernetes.io/managed-by: kustomize
```:wq
  • Loading branch information
camilamacedo86 committed Aug 25, 2024
1 parent d47b048 commit 6a17411
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apiVersion: cache.example.com/v1alpha1
kind: Memcached
metadata:
labels:
app.kubernetes.io/name: project
app.kubernetes.io/managed-by: kustomize
name: memcached-sample
spec:
# TODO(user): edit the following value to ensure the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/*
Copyright 2022 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.
Expand All @@ -27,6 +30,7 @@ var _ machinery.Template = &CRDSample{}
type CRDSample struct {
machinery.TemplateMixin
machinery.ResourceMixin
machinery.ProjectNameMixin

// Port if informed we will create the scaffold with this spec
Port string
Expand Down Expand Up @@ -54,6 +58,9 @@ func (f *CRDSample) SetTemplateDefaults() error {
const crdSampleTemplate = `apiVersion: {{ .Resource.QualifiedGroup }}/{{ .Resource.Version }}
kind: {{ .Resource.Kind }}
metadata:
labels:
app.kubernetes.io/name: {{ .ProjectName }}
app.kubernetes.io/managed-by: kustomize
name: {{ lower .Resource.Kind }}-sample
spec:
# TODO(user): edit the following value to ensure the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apiVersion: example.com.testproject.org/v1alpha1
kind: Busybox
metadata:
labels:
app.kubernetes.io/name: project-v4-with-deploy-image
app.kubernetes.io/managed-by: kustomize
name: busybox-sample
spec:
# TODO(user): edit the following value to ensure the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apiVersion: example.com.testproject.org/v1alpha1
kind: Memcached
metadata:
labels:
app.kubernetes.io/name: project-v4-with-deploy-image
app.kubernetes.io/managed-by: kustomize
name: memcached-sample
spec:
# TODO(user): edit the following value to ensure the number
Expand Down

0 comments on commit 6a17411

Please sign in to comment.