Skip to content

Commit 76629ed

Browse files
authored
Merge pull request #4 from maiqueb/claim-instead-of-lease
model: rename CRD
2 parents 544ceb7 + 98122cc commit 76629ed

File tree

17 files changed

+376
-376
lines changed

17 files changed

+376
-376
lines changed

artifacts/k8s.cni.cncf.io_ipamleases.yaml renamed to artifacts/k8s.cni.cncf.io_ipamclaims.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.13.0
7-
name: ipamleases.k8s.cni.cncf.io
7+
name: ipamclaims.k8s.cni.cncf.io
88
spec:
99
group: k8s.cni.cncf.io
1010
names:
11-
kind: IPAMLease
12-
listKind: IPAMLeaseList
13-
plural: ipamleases
14-
singular: ipamlease
11+
kind: IPAMClaim
12+
listKind: IPAMClaimList
13+
plural: ipamclaims
14+
singular: ipamclaim
1515
scope: Namespaced
1616
versions:
1717
- name: v1alpha1
1818
schema:
1919
openAPIV3Schema:
20-
description: IPAMLease is the Schema for the IPAMLease API
20+
description: IPAMClaim is the Schema for the IPAMClaim API
2121
properties:
2222
apiVersion:
2323
description: 'APIVersion defines the versioned schema of this representation

cmd/example/main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ func main() {
3333
}
3434

3535
// create a persistent IP allocation
36-
pip := &v1alpha1.IPAMLease{
36+
pip := &v1alpha1.IPAMClaim{
3737
ObjectMeta: metav1.ObjectMeta{
3838
Name: "example",
3939
},
40-
Spec: v1alpha1.IPAMLeaseSpec{
40+
Spec: v1alpha1.IPAMClaimSpec{
4141
Network: "tenantblue",
4242
Interface: "iface321",
4343
},
4444
}
4545

46-
ipamLease, err := exampleClient.K8sV1alpha1().IPAMLeases("default").Create(
46+
ipamClaim, err := exampleClient.K8sV1alpha1().IPAMClaims("default").Create(
4747
context.Background(),
4848
pip,
4949
metav1.CreateOptions{},
@@ -54,24 +54,24 @@ func main() {
5454

5555
defer func() {
5656
// teardown persistent IP
57-
_ = exampleClient.K8sV1alpha1().IPAMLeases("default").Delete(
57+
_ = exampleClient.K8sV1alpha1().IPAMClaims("default").Delete(
5858
context.Background(),
5959
pip.Name,
6060
metav1.DeleteOptions{},
6161
)
6262
}()
6363

64-
ipamLease.Status.IPs = []string{"winner", "winner", "chicken", "dinner"}
65-
_, err = exampleClient.K8sV1alpha1().IPAMLeases("default").UpdateStatus(
64+
ipamClaim.Status.IPs = []string{"winner", "winner", "chicken", "dinner"}
65+
_, err = exampleClient.K8sV1alpha1().IPAMClaims("default").UpdateStatus(
6666
context.Background(),
67-
ipamLease,
67+
ipamClaim,
6868
metav1.UpdateOptions{},
6969
)
7070
if err != nil {
7171
glog.Fatalf("Error creating a dummy persistentIP object: %v", err)
7272
}
7373

74-
allPersistentIPs, err := exampleClient.K8sV1alpha1().IPAMLeases(metav1.NamespaceAll).List(
74+
allPersistentIPs, err := exampleClient.K8sV1alpha1().IPAMClaims(metav1.NamespaceAll).List(
7575
context.Background(),
7676
metav1.ListOptions{},
7777
)
@@ -80,7 +80,7 @@ func main() {
8080
}
8181

8282
for _, persistentIP := range allPersistentIPs.Items {
83-
fmt.Printf("IPAM lease name: %q\n", persistentIP.Name)
83+
fmt.Printf("IPAM claim name: %q\n", persistentIP.Name)
8484
fmt.Printf(" - spec: %v\n", persistentIP.Spec)
8585
fmt.Printf(" - status: %v\n", persistentIP.Status)
8686
}

pkg/crd/persistentip/v1alpha1/apis/clientset/versioned/typed/persistentip/v1alpha1/fake/fake_ipamclaim.go

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/crd/persistentip/v1alpha1/apis/clientset/versioned/typed/persistentip/v1alpha1/fake/fake_ipamlease.go

Lines changed: 0 additions & 141 deletions
This file was deleted.

pkg/crd/persistentip/v1alpha1/apis/clientset/versioned/typed/persistentip/v1alpha1/fake/fake_persistentip_client.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/crd/persistentip/v1alpha1/apis/clientset/versioned/typed/persistentip/v1alpha1/generated_expansion.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)