Skip to content

Commit

Permalink
Update Kubernetes APIs to 1.25 (#64)
Browse files Browse the repository at this point in the history
This includes all new APIs and breaking changes from upstream.

API removals include the previously deprecated ClusterName on
ObjectMeta.

Signed-off-by: Scott Andrews <[email protected]>
  • Loading branch information
scothis authored Aug 24, 2022
1 parent 701f022 commit 7deb019
Show file tree
Hide file tree
Showing 21 changed files with 642 additions and 1,124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Ensure generated code is committed
run: ./hack/update-codegen.sh && git diff --exit-code
- name: Test
Expand Down
6 changes: 3 additions & 3 deletions apis/apps/v1/zz_generated.die.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/authentication/v1/zz_generated.die.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/authorization/rbac/v1/zz_generated.die.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions apis/batch/v1/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ type _ = batchv1.Job
// +die
type _ = batchv1.JobSpec

func (d *JobSpecDie) PodFailurePolicyDie(fn func(d *PodFailurePolicyDie)) *JobSpecDie {
return d.DieStamp(func(r *batchv1.JobSpec) {
d := PodFailurePolicyBlank.DieImmutable(false).DieFeedPtr(r.PodFailurePolicy)
fn(d)
r.PodFailurePolicy = d.DieReleasePtr()
})
}

func (d *JobSpecDie) SelectorDie(fn func(d *diemetav1.LabelSelectorDie)) *JobSpecDie {
return d.DieStamp(func(r *batchv1.JobSpec) {
d := diemetav1.LabelSelectorBlank.DieImmutable(false).DieFeedPtr(r.Selector)
Expand All @@ -45,6 +53,44 @@ func (d *JobSpecDie) TemplateDie(fn func(d *diecorev1.PodTemplateSpecDie)) *JobS
})
}

// +die
type _ = batchv1.PodFailurePolicy

func (d *PodFailurePolicyDie) RulesDie(rules ...*PodFailurePolicyRuleDie) *PodFailurePolicyDie {
return d.DieStamp(func(r *batchv1.PodFailurePolicy) {
r.Rules = make([]batchv1.PodFailurePolicyRule, len(rules))
for i := range rules {
r.Rules[i] = rules[i].DieRelease()
}
})
}

// +die
type _ = batchv1.PodFailurePolicyRule

func (d *PodFailurePolicyRuleDie) OnExitCodesDie(fn func(d *PodFailurePolicyOnExitCodesRequirementDie)) *PodFailurePolicyRuleDie {
return d.DieStamp(func(r *batchv1.PodFailurePolicyRule) {
d := PodFailurePolicyOnExitCodesRequirementBlank.DieImmutable(false).DieFeedPtr(r.OnExitCodes)
fn(d)
r.OnExitCodes = d.DieReleasePtr()
})
}

func (d *PodFailurePolicyRuleDie) OnPodConditionsDie(patterns ...*PodFailurePolicyOnPodConditionsPatternDie) *PodFailurePolicyRuleDie {
return d.DieStamp(func(r *batchv1.PodFailurePolicyRule) {
r.OnPodConditions = make([]batchv1.PodFailurePolicyOnPodConditionsPattern, len(patterns))
for i := range patterns {
r.OnPodConditions[i] = patterns[i].DieRelease()
}
})
}

// +die
type _ = batchv1.PodFailurePolicyOnExitCodesRequirement

// +die
type _ = batchv1.PodFailurePolicyOnPodConditionsPattern

// +die
type _ = batchv1.JobStatus

Expand Down
Loading

0 comments on commit 7deb019

Please sign in to comment.