Skip to content

Commit

Permalink
k8s 1.27 (#104)
Browse files Browse the repository at this point in the history
Consume k8s 1.27 types.

Also now ignoring k8s.io patch releases. The API types don't
change over the course of a k8s minor release. There is little
value in bumping patch versions if they are never released.

Signed-off-by: Scott Andrews <[email protected]>
  • Loading branch information
scothis authored Apr 12, 2023
1 parent 06326aa commit b9d05b1
Show file tree
Hide file tree
Showing 26 changed files with 782 additions and 220 deletions.
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ updates:
ignore:
- dependency-name: k8s.io/*
update-types:
- version-update:semver-major
- version-update:semver-minor
- version-update:semver-patch
- package-ecosystem: gomod
directory: "/cmd/diegen"
schedule:
Expand Down
3 changes: 3 additions & 0 deletions apis/admissionregistration/v1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ func (d *RuleWithOperationsDie) Scope(v *admissionregistrationv1.ScopeType) *Rul

// +die
type _ admissionregistrationv1.Rule

// +die
type _ = admissionregistrationv1.MatchCondition
17 changes: 17 additions & 0 deletions apis/admissionregistration/v1/mutatingwebhookconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,20 @@ func (d *MutatingWebhookDie) ObjectSelectorDie(fn func(d *diemetav1.LabelSelecto
r.ObjectSelector = d.DieReleasePtr()
})
}

func (d *MutatingWebhookDie) MatchConditionDie(name string, fn func(d *MatchConditionDie)) *MutatingWebhookDie {
return d.DieStamp(func(r *admissionregistrationv1.MutatingWebhook) {
for i := range r.MatchConditions {
if name == r.MatchConditions[i].Name {
d := MatchConditionBlank.DieImmutable(false).DieFeed(r.MatchConditions[i])
fn(d)
r.MatchConditions[i] = d.DieRelease()
return
}
}

d := MatchConditionBlank.DieImmutable(false).DieFeed(admissionregistrationv1.MatchCondition{Name: name})
fn(d)
r.MatchConditions = append(r.MatchConditions, d.DieRelease())
})
}
17 changes: 17 additions & 0 deletions apis/admissionregistration/v1/validatingwebhookconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,20 @@ func (d *ValidatingWebhookDie) ObjectSelectorDie(fn func(d *diemetav1.LabelSelec
r.ObjectSelector = d.DieReleasePtr()
})
}

func (d *ValidatingWebhookDie) MatchConditionDie(name string, fn func(d *MatchConditionDie)) *ValidatingWebhookDie {
return d.DieStamp(func(r *admissionregistrationv1.ValidatingWebhook) {
for i := range r.MatchConditions {
if name == r.MatchConditions[i].Name {
d := MatchConditionBlank.DieImmutable(false).DieFeed(r.MatchConditions[i])
fn(d)
r.MatchConditions[i] = d.DieRelease()
return
}
}

d := MatchConditionBlank.DieImmutable(false).DieFeed(admissionregistrationv1.MatchCondition{Name: name})
fn(d)
r.MatchConditions = append(r.MatchConditions, d.DieRelease())
})
}
196 changes: 196 additions & 0 deletions apis/admissionregistration/v1/zz_generated.die.go

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

9 changes: 9 additions & 0 deletions apis/admissionregistration/v1/zz_generated.die_test.go

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

4 changes: 2 additions & 2 deletions apis/apiextensions/v1/zz_generated.die.go

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

8 changes: 4 additions & 4 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.

Loading

0 comments on commit b9d05b1

Please sign in to comment.