Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec pointer to have better support for omit empty #7

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
96 changes: 49 additions & 47 deletions config/crd/bases/req.nephio.org_datanetworks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,53 +92,55 @@ spec:
status:
properties:
ipAllocationStatus:
description: IPAllocationStatus defines the observed state of IPAllocation
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource
properties:
kind:
description: Type of this condition. At most one of each
condition type may apply to a resource at any point in
time.
type: string
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition
from one status to another.
type: string
status:
description: Status of this condition; is it currently True,
False, or Unknown?
type: string
required:
- kind
- lastTransitionTime
- reason
- status
type: object
type: array
expiryTime:
description: expiryTime indicated when the allocation expires
type: string
gateway:
description: Gateway identifies the gatway IP for the network
type: string
prefix:
description: AllocatedPrefix identifies the prefix that was allocated
by the IPAM system
type: string
type: object
items:
description: IPAllocationStatus defines the observed state of IPAllocation
properties:
conditions:
description: Conditions of the resource.
items:
description: A Condition that may apply to a resource
properties:
kind:
description: Type of this condition. At most one of each
condition type may apply to a resource at any point
in time.
type: string
lastTransitionTime:
description: LastTransitionTime is the last time this
condition transitioned from one status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition
from one status to another.
type: string
status:
description: Status of this condition; is it currently
True, False, or Unknown?
type: string
required:
- kind
- lastTransitionTime
- reason
- status
type: object
type: array
expiryTime:
description: expiryTime indicated when the allocation expires
type: string
gateway:
description: Gateway identifies the gatway IP for the network
type: string
prefix:
description: AllocatedPrefix identifies the prefix that was
allocated by the IPAM system
type: string
type: object
type: array
type: object
type: object
served: true
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.20
require (
github.com/google/go-cmp v0.5.9
github.com/nokia/k8s-ipam v0.0.4-0.20230416191338-dcd944a8d636
github.com/stretchr/testify v1.8.1
k8s.io/api v0.27.1
k8s.io/apimachinery v0.27.1
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-runtime v0.14.6
)

Expand Down Expand Up @@ -35,7 +35,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.15.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
Expand All @@ -57,7 +56,6 @@ require (
k8s.io/client-go v0.27.1 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230327201221-f5883ff37f0c // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 Nephio.
Copyright 2023 The Nephio Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
18 changes: 18 additions & 0 deletions lcov.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
mode: set
github.com/nephio-project/api/nf_requirements/v1alpha1/capacity_interfaces.go:22.63,24.2 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/capacity_interfaces.go:27.65,29.2 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/capacity_interfaces.go:32.41,34.2 1 0
github.com/nephio-project/api/nf_requirements/v1alpha1/capacity_interfaces.go:37.44,39.2 1 0
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:24.65,26.35 2 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:26.35,29.3 2 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:30.2,30.12 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:34.42,35.25 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:35.25,37.3 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:38.2,38.21 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:42.33,44.2 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/dnn_interfaces.go:47.40,49.2 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/interface_interfaces.go:43.63,45.35 2 1
github.com/nephio-project/api/nf_requirements/v1alpha1/interface_interfaces.go:45.35,48.3 2 1
github.com/nephio-project/api/nf_requirements/v1alpha1/interface_interfaces.go:49.2,49.12 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/interface_interfaces.go:53.42,55.2 1 1
github.com/nephio-project/api/nf_requirements/v1alpha1/interface_interfaces.go:58.56,60.2 1 1
2 changes: 1 addition & 1 deletion nf_deployments/v1alpha1/zz_generated.deepcopy.go

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

44 changes: 44 additions & 0 deletions nf_requirements/v1alpha1/capacity_interfaces.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2023 The Nephio Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
*/

package v1alpha1

import "k8s.io/apimachinery/pkg/api/resource"

// GetMaxUplinkThroughput return the max uplinkthroughput
func (r *Capacity) GetMaxUplinkThroughput() *resource.Quantity {
return r.Spec.MaxUplinkThroughput
}

// GetMaxDownlinkThroughput return the max downlinkthroughput
func (r *Capacity) GetMaxDownlinkThroughput() *resource.Quantity {
return r.Spec.MaxDownlinkThroughput
}

// GetMaxSessions returns the max sessions
func (r *Capacity) GetMaxSessions() *int {
return r.Spec.MaxSessions
}

// GetMaxSubscribers returns the max subscribers
func (r *Capacity) GetMaxSubscribers() *int {
return r.Spec.MaxSubscribers
}

// GetMaxNFConnections returns the max connections to a network function
func (r *Capacity) GetMaxNFConnections() *uint16 {
return r.Spec.MaxNFConnections
}
Loading