Skip to content

Commit ac6f467

Browse files
authored
Merge pull request #4112 from camilamacedo86/fix-linter-issues-deploy-image
🐛 (deployimage/v1apha1): fix linter issues
2 parents c1bacc7 + f492ccc commit ac6f467

File tree

4 files changed

+96
-96
lines changed

4 files changed

+96
-96
lines changed

docs/book/src/getting-started/testdata/project/internal/controller/memcached_controller.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (r *MemcachedReconciler) doFinalizerOperationsForMemcached(cr *cachev1alpha
305305
// deploymentForMemcached returns a Memcached Deployment object
306306
func (r *MemcachedReconciler) deploymentForMemcached(
307307
memcached *cachev1alpha1.Memcached) (*appsv1.Deployment, error) {
308-
ls := labelsForMemcached(memcached.Name)
308+
ls := labelsForMemcached()
309309
replicas := memcached.Spec.Size
310310

311311
// Get the Operand image
@@ -335,28 +335,28 @@ func (r *MemcachedReconciler) deploymentForMemcached(
335335
// makefile target docker-buildx. Also, you can use docker manifest inspect <image>
336336
// to check what are the platforms supported.
337337
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
338-
//Affinity: &corev1.Affinity{
339-
// NodeAffinity: &corev1.NodeAffinity{
340-
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341-
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342-
// {
343-
// MatchExpressions: []corev1.NodeSelectorRequirement{
344-
// {
345-
// Key: "kubernetes.io/arch",
346-
// Operator: "In",
347-
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348-
// },
349-
// {
350-
// Key: "kubernetes.io/os",
351-
// Operator: "In",
352-
// Values: []string{"linux"},
353-
// },
354-
// },
355-
// },
356-
// },
357-
// },
358-
// },
359-
//},
338+
// Affinity: &corev1.Affinity{
339+
// NodeAffinity: &corev1.NodeAffinity{
340+
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341+
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342+
// {
343+
// MatchExpressions: []corev1.NodeSelectorRequirement{
344+
// {
345+
// Key: "kubernetes.io/arch",
346+
// Operator: "In",
347+
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348+
// },
349+
// {
350+
// Key: "kubernetes.io/os",
351+
// Operator: "In",
352+
// Values: []string{"linux"},
353+
// },
354+
// },
355+
// },
356+
// },
357+
// },
358+
// },
359+
// },
360360
SecurityContext: &corev1.PodSecurityContext{
361361
RunAsNonRoot: &[]bool{true}[0],
362362
// IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
@@ -403,7 +403,7 @@ func (r *MemcachedReconciler) deploymentForMemcached(
403403

404404
// labelsForMemcached returns the labels for selecting the resources
405405
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
406-
func labelsForMemcached(name string) map[string]string {
406+
func labelsForMemcached() map[string]string {
407407
var imageTag string
408408
image, err := imageForMemcached()
409409
if err == nil {

pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (r *{{ .Resource.Kind }}Reconciler) doFinalizerOperationsFor{{ .Resource.Ki
359359
// deploymentFor{{ .Resource.Kind }} returns a {{ .Resource.Kind }} Deployment object
360360
func (r *{{ .Resource.Kind }}Reconciler) deploymentFor{{ .Resource.Kind }}(
361361
{{ lower .Resource.Kind }} *{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}) (*appsv1.Deployment, error) {
362-
ls := labelsFor{{ .Resource.Kind }}({{ lower .Resource.Kind }}.Name)
362+
ls := labelsFor{{ .Resource.Kind }}()
363363
replicas := {{ lower .Resource.Kind }}.Spec.Size
364364
365365
// Get the Operand image
@@ -389,28 +389,28 @@ func (r *{{ .Resource.Kind }}Reconciler) deploymentFor{{ .Resource.Kind }}(
389389
// makefile target docker-buildx. Also, you can use docker manifest inspect <image>
390390
// to check what are the platforms supported.
391391
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
392-
//Affinity: &corev1.Affinity{
393-
// NodeAffinity: &corev1.NodeAffinity{
394-
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
395-
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
396-
// {
397-
// MatchExpressions: []corev1.NodeSelectorRequirement{
398-
// {
399-
// Key: "kubernetes.io/arch",
400-
// Operator: "In",
401-
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
402-
// },
403-
// {
404-
// Key: "kubernetes.io/os",
405-
// Operator: "In",
406-
// Values: []string{"linux"},
407-
// },
408-
// },
409-
// },
410-
// },
411-
// },
412-
// },
413-
//},
392+
// Affinity: &corev1.Affinity{
393+
// NodeAffinity: &corev1.NodeAffinity{
394+
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
395+
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
396+
// {
397+
// MatchExpressions: []corev1.NodeSelectorRequirement{
398+
// {
399+
// Key: "kubernetes.io/arch",
400+
// Operator: "In",
401+
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
402+
// },
403+
// {
404+
// Key: "kubernetes.io/os",
405+
// Operator: "In",
406+
// Values: []string{"linux"},
407+
// },
408+
// },
409+
// },
410+
// },
411+
// },
412+
// },
413+
// },
414414
SecurityContext: &corev1.PodSecurityContext{
415415
RunAsNonRoot: &[]bool{true}[0],
416416
// IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
@@ -436,7 +436,7 @@ func (r *{{ .Resource.Kind }}Reconciler) deploymentFor{{ .Resource.Kind }}(
436436
437437
// labelsFor{{ .Resource.Kind }} returns the labels for selecting the resources
438438
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
439-
func labelsFor{{ .Resource.Kind }}(name string) map[string]string {
439+
func labelsFor{{ .Resource.Kind }}() map[string]string {
440440
var imageTag string
441441
image, err := imageFor{{ .Resource.Kind }}()
442442
if err == nil {

testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (r *BusyboxReconciler) doFinalizerOperationsForBusybox(cr *examplecomv1alph
305305
// deploymentForBusybox returns a Busybox Deployment object
306306
func (r *BusyboxReconciler) deploymentForBusybox(
307307
busybox *examplecomv1alpha1.Busybox) (*appsv1.Deployment, error) {
308-
ls := labelsForBusybox(busybox.Name)
308+
ls := labelsForBusybox()
309309
replicas := busybox.Spec.Size
310310

311311
// Get the Operand image
@@ -335,28 +335,28 @@ func (r *BusyboxReconciler) deploymentForBusybox(
335335
// makefile target docker-buildx. Also, you can use docker manifest inspect <image>
336336
// to check what are the platforms supported.
337337
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
338-
//Affinity: &corev1.Affinity{
339-
// NodeAffinity: &corev1.NodeAffinity{
340-
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341-
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342-
// {
343-
// MatchExpressions: []corev1.NodeSelectorRequirement{
344-
// {
345-
// Key: "kubernetes.io/arch",
346-
// Operator: "In",
347-
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348-
// },
349-
// {
350-
// Key: "kubernetes.io/os",
351-
// Operator: "In",
352-
// Values: []string{"linux"},
353-
// },
354-
// },
355-
// },
356-
// },
357-
// },
358-
// },
359-
//},
338+
// Affinity: &corev1.Affinity{
339+
// NodeAffinity: &corev1.NodeAffinity{
340+
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341+
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342+
// {
343+
// MatchExpressions: []corev1.NodeSelectorRequirement{
344+
// {
345+
// Key: "kubernetes.io/arch",
346+
// Operator: "In",
347+
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348+
// },
349+
// {
350+
// Key: "kubernetes.io/os",
351+
// Operator: "In",
352+
// Values: []string{"linux"},
353+
// },
354+
// },
355+
// },
356+
// },
357+
// },
358+
// },
359+
// },
360360
SecurityContext: &corev1.PodSecurityContext{
361361
RunAsNonRoot: &[]bool{true}[0],
362362
// IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
@@ -397,7 +397,7 @@ func (r *BusyboxReconciler) deploymentForBusybox(
397397

398398
// labelsForBusybox returns the labels for selecting the resources
399399
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
400-
func labelsForBusybox(name string) map[string]string {
400+
func labelsForBusybox() map[string]string {
401401
var imageTag string
402402
image, err := imageForBusybox()
403403
if err == nil {

testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (r *MemcachedReconciler) doFinalizerOperationsForMemcached(cr *examplecomv1
305305
// deploymentForMemcached returns a Memcached Deployment object
306306
func (r *MemcachedReconciler) deploymentForMemcached(
307307
memcached *examplecomv1alpha1.Memcached) (*appsv1.Deployment, error) {
308-
ls := labelsForMemcached(memcached.Name)
308+
ls := labelsForMemcached()
309309
replicas := memcached.Spec.Size
310310

311311
// Get the Operand image
@@ -335,28 +335,28 @@ func (r *MemcachedReconciler) deploymentForMemcached(
335335
// makefile target docker-buildx. Also, you can use docker manifest inspect <image>
336336
// to check what are the platforms supported.
337337
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
338-
//Affinity: &corev1.Affinity{
339-
// NodeAffinity: &corev1.NodeAffinity{
340-
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341-
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342-
// {
343-
// MatchExpressions: []corev1.NodeSelectorRequirement{
344-
// {
345-
// Key: "kubernetes.io/arch",
346-
// Operator: "In",
347-
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348-
// },
349-
// {
350-
// Key: "kubernetes.io/os",
351-
// Operator: "In",
352-
// Values: []string{"linux"},
353-
// },
354-
// },
355-
// },
356-
// },
357-
// },
358-
// },
359-
//},
338+
// Affinity: &corev1.Affinity{
339+
// NodeAffinity: &corev1.NodeAffinity{
340+
// RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
341+
// NodeSelectorTerms: []corev1.NodeSelectorTerm{
342+
// {
343+
// MatchExpressions: []corev1.NodeSelectorRequirement{
344+
// {
345+
// Key: "kubernetes.io/arch",
346+
// Operator: "In",
347+
// Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
348+
// },
349+
// {
350+
// Key: "kubernetes.io/os",
351+
// Operator: "In",
352+
// Values: []string{"linux"},
353+
// },
354+
// },
355+
// },
356+
// },
357+
// },
358+
// },
359+
// },
360360
SecurityContext: &corev1.PodSecurityContext{
361361
RunAsNonRoot: &[]bool{true}[0],
362362
// IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
@@ -403,7 +403,7 @@ func (r *MemcachedReconciler) deploymentForMemcached(
403403

404404
// labelsForMemcached returns the labels for selecting the resources
405405
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
406-
func labelsForMemcached(name string) map[string]string {
406+
func labelsForMemcached() map[string]string {
407407
var imageTag string
408408
image, err := imageForMemcached()
409409
if err == nil {

0 commit comments

Comments
 (0)