Skip to content
Open
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
@@ -0,0 +1,7 @@
version: v2.5.0
name: golangci-lint-kube-api
destination: ./bin

plugins:
- module: sigs.k8s.io/kube-api-linter
version: latest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ jobs:
with:
go-version-file: go.mod

- name: Check linter configuration
run: make lint-config

- name: Run linter
uses: golangci/golangci-lint-action@v8
with:
version: v2.5.0

- name: Run lint target
run: make lint
15 changes: 15 additions & 0 deletions docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ linters:
- unconvert
- unparam
- unused
- kubeapilinter
settings:
revive:
rules:
- name: comment-spacings
- name: import-shadowing
custom:
kubeapilinter:
type: module
description: "Kube API Linter plugin"
original-url: "sigs.k8s.io/kube-api-linter"
settings:
linters: {}
lintersConfig:
optionalfields:
pointers:
preference: WhenRequired
exclusions:
generated: lax
rules:
Expand All @@ -36,6 +48,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
16 changes: 13 additions & 3 deletions docs/book/src/cronjob-tutorial/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ KIND ?= kind
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_BASE = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-kube-api

## Tool Versions
KUSTOMIZE_VERSION ?= v5.7.1
Expand Down Expand Up @@ -230,8 +231,17 @@ $(ENVTEST): $(LOCALBIN)

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT_BASE): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT_BASE),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT): $(GOLANGCI_LINT_BASE) .custom-gcl.yml
@echo "Running golangci-lint custom..."
@$(GOLANGCI_LINT_BASE) custom || { \
echo "golangci-lint failed. Cleaning up..."; \
rm -f $(GOLANGCI_LINT_BASE); \
exit 1; \
}

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
// schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +kubebuilder:validation:MinLength=0
// +required
Schedule string `json:"schedule"`

Check failure on line 70 in docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/cronjob-tutorial/testdata/project)

requiredfields: field Schedule has a valid zero value ("") and should be a pointer. (kubeapilinter)

// startingDeadlineSeconds defines in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
Expand All @@ -91,7 +91,7 @@

// jobTemplate defines the job that will be created when executing a CronJob.
// +required
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

Check failure on line 94 in docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/cronjob-tutorial/testdata/project)

requiredfields: field JobTemplate should have the omitempty tag. (kubeapilinter)

// successfulJobsHistoryLimit defines the number of successful finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
Expand Down Expand Up @@ -172,7 +172,7 @@
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

Check failure on line 175 in docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/cronjob-tutorial/testdata/project)

conditions: Conditions field in CronJobStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type (kubeapilinter)
}

/*
Expand All @@ -192,23 +192,23 @@

// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
metav1.ObjectMeta `json:"metadata,omitzero"`

// spec defines the desired state of CronJob
// +required
Spec CronJobSpec `json:"spec"`

Check failure on line 199 in docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/cronjob-tutorial/testdata/project)

requiredfields: field Spec does not allow the zero value. It must have the omitzero tag. (kubeapilinter)

// status defines the observed state of CronJob
// +optional
Status CronJobStatus `json:"status,omitempty,omitzero"`
Status CronJobStatus `json:"status,omitzero"`

Check failure on line 203 in docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/cronjob-tutorial/testdata/project)

optionalfields: field Status has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)
}

// +kubebuilder:object:root=true

// CronJobList contains a list of CronJob
type CronJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []CronJob `json:"items"`
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v2.5.0
name: golangci-lint-kube-api
destination: ./bin

plugins:
- module: sigs.k8s.io/kube-api-linter
version: latest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ jobs:
with:
go-version-file: go.mod

- name: Check linter configuration
run: make lint-config

- name: Run linter
uses: golangci/golangci-lint-action@v8
with:
version: v2.5.0

- name: Run lint target
run: make lint
15 changes: 15 additions & 0 deletions docs/book/src/getting-started/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ linters:
- unconvert
- unparam
- unused
- kubeapilinter
settings:
revive:
rules:
- name: comment-spacings
- name: import-shadowing
custom:
kubeapilinter:
type: module
description: "Kube API Linter plugin"
original-url: "sigs.k8s.io/kube-api-linter"
settings:
linters: {}
lintersConfig:
optionalfields:
pointers:
preference: WhenRequired
exclusions:
generated: lax
rules:
Expand All @@ -36,6 +48,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
16 changes: 13 additions & 3 deletions docs/book/src/getting-started/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ KIND ?= kind
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_BASE = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-kube-api

## Tool Versions
KUSTOMIZE_VERSION ?= v5.7.1
Expand Down Expand Up @@ -226,8 +227,17 @@ $(ENVTEST): $(LOCALBIN)

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT_BASE): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT_BASE),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT): $(GOLANGCI_LINT_BASE) .custom-gcl.yml
@echo "Running golangci-lint custom..."
@$(GOLANGCI_LINT_BASE) custom || { \
echo "golangci-lint failed. Cleaning up..."; \
rm -f $(GOLANGCI_LINT_BASE); \
exit 1; \
}

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false
// +optional
Size *int32 `json:"size,omitempty"`

Check failure on line 43 in docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/getting-started/testdata/project)

optionalfields: field Size does not allow the zero value. The field does not need to be a pointer. (kubeapilinter)
}

// MemcachedStatus defines the observed state of Memcached.
Expand All @@ -63,7 +63,7 @@
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

Check failure on line 66 in docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/getting-started/testdata/project)

conditions: Conditions field in MemcachedStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type (kubeapilinter)
}

// +kubebuilder:object:root=true
Expand All @@ -75,23 +75,23 @@

// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
metav1.ObjectMeta `json:"metadata,omitzero"`

// spec defines the desired state of Memcached
// +required
Spec MemcachedSpec `json:"spec"`

Check failure on line 82 in docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/getting-started/testdata/project)

requiredfields: field Spec has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)

// status defines the observed state of Memcached
// +optional
Status MemcachedStatus `json:"status,omitempty,omitzero"`
Status MemcachedStatus `json:"status,omitzero"`

Check failure on line 86 in docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/getting-started/testdata/project)

optionalfields: field Status has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)
}

// +kubebuilder:object:root=true

// MemcachedList contains a list of Memcached
type MemcachedList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []Memcached `json:"items"`
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v2.5.0
name: golangci-lint-kube-api
destination: ./bin

plugins:
- module: sigs.k8s.io/kube-api-linter
version: latest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ jobs:
with:
go-version-file: go.mod

- name: Check linter configuration
run: make lint-config

- name: Run linter
uses: golangci/golangci-lint-action@v8
with:
version: v2.5.0

- name: Run lint target
run: make lint
15 changes: 15 additions & 0 deletions docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ linters:
- unconvert
- unparam
- unused
- kubeapilinter
settings:
revive:
rules:
- name: comment-spacings
- name: import-shadowing
custom:
kubeapilinter:
type: module
description: "Kube API Linter plugin"
original-url: "sigs.k8s.io/kube-api-linter"
settings:
linters: {}
lintersConfig:
optionalfields:
pointers:
preference: WhenRequired
exclusions:
generated: lax
rules:
Expand All @@ -36,6 +48,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
16 changes: 13 additions & 3 deletions docs/book/src/multiversion-tutorial/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ KIND ?= kind
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_BASE = $(LOCALBIN)/golangci-lint
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-kube-api

## Tool Versions
KUSTOMIZE_VERSION ?= v5.7.1
Expand Down Expand Up @@ -230,8 +231,17 @@ $(ENVTEST): $(LOCALBIN)

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT_BASE): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT_BASE),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

$(GOLANGCI_LINT): $(GOLANGCI_LINT_BASE) .custom-gcl.yml
@echo "Running golangci-lint custom..."
@$(GOLANGCI_LINT_BASE) custom || { \
echo "golangci-lint failed. Cleaning up..."; \
rm -f $(GOLANGCI_LINT_BASE); \
exit 1; \
}

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +kubebuilder:validation:MinLength=0
// +required
Schedule string `json:"schedule"`

Check failure on line 42 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

requiredfields: field Schedule has a valid zero value ("") and should be a pointer. (kubeapilinter)

// startingDeadlineSeconds defines in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
Expand All @@ -63,7 +63,7 @@

// jobTemplate defines the job that will be created when executing a CronJob.
// +required
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

Check failure on line 66 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

requiredfields: field JobTemplate should have the omitempty tag. (kubeapilinter)

// successfulJobsHistoryLimit defines the number of successful finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
Expand Down Expand Up @@ -128,7 +128,7 @@
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

Check failure on line 131 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

conditions: Conditions field in CronJobStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type (kubeapilinter)
}

// +kubebuilder:docs-gen:collapse=Remaining code from cronjob_types.go
Expand All @@ -151,20 +151,20 @@
// +versionName=v1
// +kubebuilder:storageversion
// CronJob is the Schema for the cronjobs API
type CronJob struct {

Check failure on line 154 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

duplicatemarkers: CronJob has duplicated markers kubebuilder:storageversion (kubeapilinter)
metav1.TypeMeta `json:",inline"`

// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
metav1.ObjectMeta `json:"metadata,omitzero"`

// spec defines the desired state of CronJob
// +required
Spec CronJobSpec `json:"spec"`

Check failure on line 163 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

requiredfields: field Spec does not allow the zero value. It must have the omitzero tag. (kubeapilinter)

// status defines the observed state of CronJob
// +optional
Status CronJobStatus `json:"status,omitempty,omitzero"`
Status CronJobStatus `json:"status,omitzero"`

Check failure on line 167 in docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

optionalfields: field Status has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)
}

/*
Expand All @@ -175,7 +175,7 @@
// CronJobList contains a list of CronJob
type CronJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []CronJob `json:"items"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
type CronJobSpec struct {
// schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
// +required
Schedule CronSchedule `json:"schedule"`

Check failure on line 46 in docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

requiredfields: field Schedule has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)

/*
*/
Expand All @@ -70,7 +70,7 @@

// jobTemplate defines the job that will be created when executing a CronJob.
// +required
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

Check failure on line 73 in docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

requiredfields: field JobTemplate should have the omitempty tag. (kubeapilinter)

// successfulJobsHistoryLimit defines the number of successful finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
Expand Down Expand Up @@ -146,7 +146,7 @@

// CronJobStatus defines the observed state of CronJob.
type CronJobStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster

Check failure on line 149 in docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

commentstart: godoc for field CronJobStatus.Active should start with 'active ...' (kubeapilinter)
// Important: Run "make" to regenerate code after modifying this file
// active defines a list of pointers to currently running jobs.
// +optional
Expand Down Expand Up @@ -174,7 +174,7 @@
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

Check failure on line 177 in docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_types.go

View workflow job for this annotation

GitHub Actions / lint-samples (docs/book/src/multiversion-tutorial/testdata/project)

conditions: Conditions field in CronJobStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type (kubeapilinter)
}

// +kubebuilder:object:root=true
Expand All @@ -186,23 +186,23 @@

// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
metav1.ObjectMeta `json:"metadata,omitzero"`

// spec defines the desired state of CronJob
// +required
Spec CronJobSpec `json:"spec"`

// status defines the observed state of CronJob
// +optional
Status CronJobStatus `json:"status,omitempty,omitzero"`
Status CronJobStatus `json:"status,omitzero"`
}

// +kubebuilder:object:root=true

// CronJobList contains a list of CronJob
type CronJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []CronJob `json:"items"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,23 @@ type {{ .Resource.Kind }} struct {

// metadata is a standard object metadata
// +optional
metav1.ObjectMeta ` + "`" + `json:"metadata,omitempty,omitzero"` + "`" + `
metav1.ObjectMeta ` + "`" + `json:"metadata,omitzero"` + "`" + `

// spec defines the desired state of {{ .Resource.Kind }}
// +required
Spec {{ .Resource.Kind }}Spec ` + "`" + `json:"spec"` + "`" + `

// status defines the observed state of {{ .Resource.Kind }}
// +optional
Status {{ .Resource.Kind }}Status ` + "`" + `json:"status,omitempty,omitzero"` + "`" + `
Status {{ .Resource.Kind }}Status ` + "`" + `json:"status,omitzero"` + "`" + `
}

// +kubebuilder:object:root=true

// {{ .Resource.Kind }}List contains a list of {{ .Resource.Kind }}
type {{ .Resource.Kind }}List struct {
metav1.TypeMeta ` + "`" + `json:",inline"` + "`" + `
metav1.ListMeta ` + "`" + `json:"metadata,omitempty"` + "`" + `
metav1.ListMeta ` + "`" + `json:"metadata,omitzero"` + "`" + `
Items []{{ .Resource.Kind }} ` + "`" + `json:"items"` + "`" + `
}

Expand Down
Loading
Loading