Skip to content

Commit

Permalink
🌱 fix file.Template to machinery.Template in the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
monteiro-renato committed Nov 21, 2024
1 parent 45925f3 commit 701390e
Show file tree
Hide file tree
Showing 68 changed files with 84 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Certificate struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Certificate) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "certmanager", "certificate.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Kustomization struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "certmanager", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type KustomizeConfig struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *KustomizeConfig) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "certmanager", "kustomizeconfig.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Kustomization struct {
machinery.ResourceMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "crd", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type KustomizeConfig struct {
machinery.ResourceMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *KustomizeConfig) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "crd", "kustomizeconfig.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type EnableCAInjectionPatch struct {
machinery.ResourceMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *EnableCAInjectionPatch) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type EnableWebhookPatch struct {
machinery.ResourceMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *EnableWebhookPatch) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type CertManagerMetricsPatch struct {
Force bool
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CertManagerMetricsPatch) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "default", "certmanager_metrics_manager_patch.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Kustomization struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "default", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type ManagerMetricsPatch struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *ManagerMetricsPatch) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "default", "manager_metrics_patch.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type MetricsService struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *MetricsService) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "default", "metrics_service.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ManagerWebhookPatch struct {
Force bool
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *ManagerWebhookPatch) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "default", "manager_webhook_patch.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Config struct {
Image string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Config) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "manager", "manager.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Kustomization struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "manager", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type NetworkPolicyAllowMetrics struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *NetworkPolicyAllowMetrics) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "network-policy", "allow-metrics-traffic.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type NetworkPolicyAllowWebhooks struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *NetworkPolicyAllowWebhooks) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "network-policy", "allow-webhook-traffic.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Kustomization struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "network-policy", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Kustomization struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "prometheus", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Monitor struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Monitor) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "prometheus", "monitor.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ServiceMonitorPatch struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *ServiceMonitorPatch) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "prometheus", "monitor_tls_patch.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type CRDAdminRole struct {
RoleName string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CRDAdminRole) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type CRDEditorRole struct {
RoleName string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CRDEditorRole) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type CRDViewerRole struct {
RoleName string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CRDViewerRole) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Kustomization struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type LeaderElectionRole struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *LeaderElectionRole) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "leader_election_role.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type LeaderElectionRoleBinding struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *LeaderElectionRoleBinding) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "leader_election_role_binding.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type MetricsAuthRole struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *MetricsAuthRole) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "metrics_auth_role.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type MetricsAuthRoleBinding struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *MetricsAuthRoleBinding) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "metrics_auth_role_binding.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type MetricsReaderRole struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *MetricsReaderRole) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "metrics_reader_role.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Role struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Role) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "role.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type RoleBinding struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *RoleBinding) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "role_binding.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type ServiceAccount struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *ServiceAccount) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "rbac", "service_account.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type CRDSample struct {
Force bool
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CRDSample) SetTemplateDefaults() error {
if f.Path == "" {
if f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Kustomization struct {
Force bool
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Kustomization) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "webhook", "kustomization.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type KustomizeConfig struct {
machinery.TemplateMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *KustomizeConfig) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "webhook", "kustomizeconfig.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Service struct {
machinery.ProjectNameMixin
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Service) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("config", "webhook", "service.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Types struct {
Port string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *Types) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type CRDSample struct {
Port string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *CRDSample) SetTemplateDefaults() error {
if f.Path == "" {
if f.Resource.Group != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type ControllerTest struct {
PackageName string
}

// SetTemplateDefaults implements file.Template
// SetTemplateDefaults implements machinery.Template
func (f *ControllerTest) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
Expand Down Expand Up @@ -78,7 +78,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
{{ if not (isEmptyStr .Resource.Path) -}}
{{ .Resource.ImportAlias }} "{{ .Resource.Path }}"
{{- end }}
Expand Down Expand Up @@ -133,7 +133,7 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() {
{{- end }}
},
}
err = k8sClient.Create(ctx, {{ lower .Resource.Kind }})
Expect(err).NotTo(HaveOccurred())
}
Expand All @@ -150,11 +150,11 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() {
}).Should(Succeed())
// TODO(user): Attention if you improve this code by adding other context test you MUST
// be aware of the current delete namespace limitations.
// be aware of the current delete namespace limitations.
// More info: https://book.kubebuilder.io/reference/envtest.html#testing-considerations
By("Deleting the Namespace to perform the tests")
_ = k8sClient.Delete(ctx, namespace);
By("Removing the Image ENV VAR which stores the Operand image")
_ = os.Unsetenv("{{ upper .Resource.Kind }}_IMAGE")
})
Expand Down
Loading

0 comments on commit 701390e

Please sign in to comment.