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
1 change: 0 additions & 1 deletion docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ command = "./markerdocs.sh"

[context.deploy-preview.environment]
environment = { GO_VERSION = "1.23" }

5 changes: 3 additions & 2 deletions docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func main() {
os.Exit(1)
}

// +kubebuilder:docs-gen:collapse=old stuff
// +kubebuilder:docs-gen:collapse=Remaining code from main.go

if err := (&controller.CronJobReconciler{
Client: mgr.GetClient(),
Expand Down Expand Up @@ -239,5 +239,6 @@ func main() {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
// +kubebuilder:docs-gen:collapse=old stuff
}

// +kubebuilder:docs-gen:collapse=Remaining code from main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Clock interface {
Now() time.Time
}

// +kubebuilder:docs-gen:collapse=Clock
// +kubebuilder:docs-gen:collapse=Clock Code Implementation

// Definitions to manage status conditions
const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ var _ = Describe("CronJob controller", func() {

})

// +kubebuilder:docs-gen:collapse=Remaining code from cronjob_controller_test.go

/*
After writing all this code, you can run `go test ./...` in your `controllers/` directory again to run your new test!
*/
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ var _ = AfterSuite(func() {
Expect(err).NotTo(HaveOccurred())
})

// +kubebuilder:docs-gen:collapse=Remaining code from suite_test.go

/*
Now that you have your controller running on a test cluster and a client ready to perform operations on your CronJob, we can start writing integration tests!
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
batchv1 "tutorial.kubebuilder.io/project/api/v1"
)

// +kubebuilder:docs-gen:collapse=Go imports
// +kubebuilder:docs-gen:collapse=Imports

/*
Next, we'll setup a logger for the webhooks.
Expand Down Expand Up @@ -279,4 +279,4 @@ func validateCronJobName(cronjob *batchv1.CronJob) *field.Error {
return nil
}

// +kubebuilder:docs-gen:collapse=Validate object name
// +kubebuilder:docs-gen:collapse=validateCronJobName() Code Implementation
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type CronJobStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// +kubebuilder:docs-gen:collapse=old stuff
// +kubebuilder:docs-gen:collapse=Remaining code from cronjob_types.go

/*
Since we'll have more than one version, we'll need to mark a storage version.
Expand Down Expand Up @@ -183,4 +183,4 @@ func init() {
SchemeBuilder.Register(&CronJob{}, &CronJobList{})
}

// +kubebuilder:docs-gen:collapse=old stuff
// +kubebuilder:docs-gen:collapse=Remaining code from cronjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ func (src *CronJob) ConvertTo(dstRaw conversion.Hub) error {
dst.Status.Active = src.Status.Active
dst.Status.LastScheduleTime = src.Status.LastScheduleTime

// +kubebuilder:docs-gen:collapse=rote conversion

// +kubebuilder:docs-gen:collapse=rest of conversion Code Implementation
return nil
}

Expand Down Expand Up @@ -141,7 +140,6 @@ func (dst *CronJob) ConvertFrom(srcRaw conversion.Hub) error {
dst.Status.Active = src.Status.Active
dst.Status.LastScheduleTime = src.Status.LastScheduleTime

// +kubebuilder:docs-gen:collapse=rote conversion

// +kubebuilder:docs-gen:collapse=rest of conversion Code Implementation
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ type CronJobSpec struct {
// +optional
// +kubebuilder:validation:Minimum=0
FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`

// +kubebuilder:docs-gen:collapse=The rest of Spec

}

// +kubebuilder:docs-gen:collapse=CronJobSpec Full Code

/*
Next, we'll need to define a type to hold our schedule.
Based on our proposed YAML above, it'll have a field for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "CronJob")
os.Exit(1)
}
// +kubebuilder:docs-gen:collapse=existing setup

/*
Our existing call to SetupWebhookWithManager registers our conversion webhooks with the manager, too.
Expand All @@ -225,8 +224,7 @@ func main() {
}
// +kubebuilder:scaffold:builder

/*
*/
// +kubebuilder:docs-gen:collapse=Remaining code from main.go

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
Expand All @@ -242,5 +240,8 @@ func main() {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
// +kubebuilder:docs-gen:collapse=existing setup
}

// +kubebuilder:docs-gen:collapse=Remaining code from main.go

// +kubebuilder:docs-gen:collapse=Remaining code from main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Clock interface {
Now() time.Time
}

// +kubebuilder:docs-gen:collapse=Clock
// +kubebuilder:docs-gen:collapse=Clock Code Implementation

// Definitions to manage status conditions
const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ var _ = Describe("CronJob controller", func() {

})

// +kubebuilder:docs-gen:collapse=Remaining code from cronjob_controller_test.go

/*
After writing all this code, you can run `go test ./...` in your `controllers/` directory again to run your new test!
*/
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ var _ = AfterSuite(func() {
Expect(err).NotTo(HaveOccurred())
})

// +kubebuilder:docs-gen:collapse=Remaining code from suite_test.go

/*
Now that you have your controller running on a test cluster and a client ready to perform operations on your CronJob, we can start writing integration tests!
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
batchv1 "tutorial.kubebuilder.io/project/api/v1"
)

// +kubebuilder:docs-gen:collapse=Go imports
// +kubebuilder:docs-gen:collapse=Imports

/*
Next, we'll setup a logger for the webhooks.
Expand Down Expand Up @@ -284,4 +284,4 @@ func validateCronJobName(cronjob *batchv1.CronJob) *field.Error {
return nil
}

// +kubebuilder:docs-gen:collapse=Validate object name
// +kubebuilder:docs-gen:collapse=validateCronJobName() Code Implementation
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +kubebuilder:docs-gen:collapse=Apache License

package v2

Expand Down
Loading