diff --git a/apis/v1alpha1/topologyspec.go b/apis/v1alpha1/topologyspec.go index 7eaedea7..b85669dc 100644 --- a/apis/v1alpha1/topologyspec.go +++ b/apis/v1alpha1/topologyspec.go @@ -99,6 +99,18 @@ type Expose struct { // // +optional DisableAutoExpose bool `json:"disableAutoExpose"` + // ExposeType configures the service type(s) related to exposing the topology. This is an enum + // that has the following valid values: + // - None: expose is *not* disabled, but we just don't create any services related to the pods, + // you may want to do this if you want to tickle the pods by pod name directly for some + // reason while not having extra services floating around. + // - ClusterIP: a clusterip service is created so you can hit that service name for the pods. + // - LoadBalancer: (default) creates a load balancer service so you can access your pods from + // outside the cluster. this is/was the only behavior up to v0.2.4. + // +kubebuilder:validation:Enum=None;ClusterIP;LoadBalancer + // +kubebuilder:default=LoadBalancer + // +optional + ExposeType string `json:"exposeType,omitempty"` } // Deployment holds configurations relevant to how clabernetes configures deployments that make diff --git a/assets/crd/clabernetes.containerlab.dev_configs.yaml b/assets/crd/clabernetes.containerlab.dev_configs.yaml index 3866a945..383a544f 100644 --- a/assets/crd/clabernetes.containerlab.dev_configs.yaml +++ b/assets/crd/clabernetes.containerlab.dev_configs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: configs.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -109,9 +109,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the ConfigMap or its @@ -177,9 +175,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key @@ -241,11 +237,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -256,6 +250,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -314,11 +314,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -329,6 +327,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object diff --git a/assets/crd/clabernetes.containerlab.dev_connectivities.yaml b/assets/crd/clabernetes.containerlab.dev_connectivities.yaml index 752984ff..faeee19e 100644 --- a/assets/crd/clabernetes.containerlab.dev_connectivities.yaml +++ b/assets/crd/clabernetes.containerlab.dev_connectivities.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: connectivities.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml b/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml index ea3602f8..8cc21824 100644 --- a/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml +++ b/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: imagerequests.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/assets/crd/clabernetes.containerlab.dev_topologies.yaml b/assets/crd/clabernetes.containerlab.dev_topologies.yaml index 84f7c14d..59c7eac0 100644 --- a/assets/crd/clabernetes.containerlab.dev_topologies.yaml +++ b/assets/crd/clabernetes.containerlab.dev_topologies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: topologies.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -144,9 +144,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the ConfigMap or its @@ -212,9 +210,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key @@ -375,11 +371,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -390,6 +384,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -497,7 +497,6 @@ spec: (or equivalent for kne). When this is `false` (default), clabernetes will add and expose the following list of ports to whatever ports you have already defined: - 21 - tcp - ftp 22 - tcp - ssh 23 - tcp - telnet @@ -513,7 +512,6 @@ spec: 9559 - tcp - p4rt 57400 - tcp - gnmi (nokia srl/sros default) - This setting is *ignored completely* if `DisableExpose` is true! type: boolean disableExpose: @@ -521,6 +519,22 @@ spec: DisableExpose indicates if exposing nodes via LoadBalancer service should be disabled, by default any mapped ports in a containerlab topology will be exposed. type: boolean + exposeType: + default: LoadBalancer + description: |- + ExposeType configures the service type(s) related to exposing the topology. This is an enum + that has the following valid values: + - None: expose is *not* disabled, but we just don't create any services related to the pods, + you may want to do this if you want to tickle the pods by pod name directly for some + reason while not having extra services floating around. + - ClusterIP: a clusterip service is created so you can hit that service name for the pods. + - LoadBalancer: (default) creates a load balancer service so you can access your pods from + outside the cluster. this is/was the only behavior up to v0.2.4. + enum: + - None + - ClusterIP + - LoadBalancer + type: string type: object imagePull: description: |- @@ -733,16 +747,8 @@ spec: description: Conditions is a list of conditions for the topology custom resource. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -783,12 +789,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml index 3866a945..383a544f 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: configs.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -109,9 +109,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the ConfigMap or its @@ -177,9 +175,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key @@ -241,11 +237,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -256,6 +250,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -314,11 +314,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -329,6 +327,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml index 752984ff..faeee19e 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: connectivities.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml index ea3602f8..8cc21824 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: imagerequests.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml index 84f7c14d..59c7eac0 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.4 name: topologies.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -144,9 +144,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the ConfigMap or its @@ -212,9 +210,7 @@ spec: This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. - TODO: Add other useful fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key @@ -375,11 +371,9 @@ spec: Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. - This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. - This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. @@ -390,6 +384,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -497,7 +497,6 @@ spec: (or equivalent for kne). When this is `false` (default), clabernetes will add and expose the following list of ports to whatever ports you have already defined: - 21 - tcp - ftp 22 - tcp - ssh 23 - tcp - telnet @@ -513,7 +512,6 @@ spec: 9559 - tcp - p4rt 57400 - tcp - gnmi (nokia srl/sros default) - This setting is *ignored completely* if `DisableExpose` is true! type: boolean disableExpose: @@ -521,6 +519,22 @@ spec: DisableExpose indicates if exposing nodes via LoadBalancer service should be disabled, by default any mapped ports in a containerlab topology will be exposed. type: boolean + exposeType: + default: LoadBalancer + description: |- + ExposeType configures the service type(s) related to exposing the topology. This is an enum + that has the following valid values: + - None: expose is *not* disabled, but we just don't create any services related to the pods, + you may want to do this if you want to tickle the pods by pod name directly for some + reason while not having extra services floating around. + - ClusterIP: a clusterip service is created so you can hit that service name for the pods. + - LoadBalancer: (default) creates a load balancer service so you can access your pods from + outside the cluster. this is/was the only behavior up to v0.2.4. + enum: + - None + - ClusterIP + - LoadBalancer + type: string type: object imagePull: description: |- @@ -733,16 +747,8 @@ spec: description: Conditions is a list of conditions for the topology custom resource. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -783,12 +789,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/clabverter/assets/topology.yaml.template b/clabverter/assets/topology.yaml.template index 09165211..1fdd73fe 100644 --- a/clabverter/assets/topology.yaml.template +++ b/clabverter/assets/topology.yaml.template @@ -51,6 +51,7 @@ spec: {{- if .DisableExpose }} expose: disableExpose: true + exposeType: LoadBalancer {{- end }} {{- if .Naming }} naming: {{ .Naming }} diff --git a/clabverter/test-fixtures/golden/simple-no-explicit-namespace/topo01.yaml b/clabverter/test-fixtures/golden/simple-no-explicit-namespace/topo01.yaml index f2a3429b..4566a7e7 100755 --- a/clabverter/test-fixtures/golden/simple-no-explicit-namespace/topo01.yaml +++ b/clabverter/test-fixtures/golden/simple-no-explicit-namespace/topo01.yaml @@ -90,6 +90,7 @@ spec: expose: disableAutoExpose: false disableExpose: true + exposeType: LoadBalancer imagePull: insecureRegistries: - 1.2.3.4 diff --git a/constants/kubernetes.go b/constants/kubernetes.go index d0e8ad74..c5cb8d02 100644 --- a/constants/kubernetes.go +++ b/constants/kubernetes.go @@ -12,12 +12,6 @@ const ( // KubernetesDeployment is a const to use for "deployment". KubernetesDeployment = "deployment" - - // KubernetesServiceClusterIPType is a const to use for "ClusterIP". - KubernetesServiceClusterIPType = "ClusterIP" - - // KubernetesServiceLoadBalancerType is a const to use for "LoadBalancer". - KubernetesServiceLoadBalancerType = "LoadBalancer" ) const ( diff --git a/controllers/topology/serviceexpose.go b/controllers/topology/serviceexpose.go index 9ef1b715..fb676883 100644 --- a/controllers/topology/serviceexpose.go +++ b/controllers/topology/serviceexpose.go @@ -18,6 +18,17 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) +const exposeTypeNone = "None" + +func exposeTypeToServiceType(exposeType string) k8scorev1.ServiceType { + switch exposeType { + case string(k8scorev1.ServiceTypeClusterIP): + return k8scorev1.ServiceTypeClusterIP + default: + return k8scorev1.ServiceTypeLoadBalancer + } +} + // NewServiceExposeReconciler returns an instance of ServiceExposeReconciler. func NewServiceExposeReconciler( log claberneteslogging.Instance, @@ -99,6 +110,12 @@ func (r *ServiceExposeReconciler) Resolve( continue } + if owningTopology.Spec.Expose.ExposeType == exposeTypeNone { + // expose type is none -- this means we "expose" the nodes but dont create any + // service(s) for them (so folks can tickle the pods directly only) + continue + } + exposedNodes = append(exposedNodes, nodeName) } @@ -153,7 +170,9 @@ func (r *ServiceExposeReconciler) renderServiceBase( }, Spec: k8scorev1.ServiceSpec{ Selector: selectorLabels, - Type: clabernetesconstants.KubernetesServiceLoadBalancerType, + // if we ever get here we know expose is not none, so we can just cast the string from + // our crd to the appropriate flavor service + Type: exposeTypeToServiceType(owningTopology.Spec.Expose.ExposeType), }, } } @@ -241,6 +260,10 @@ func (r *ServiceExposeReconciler) Render( reconcileData *ReconcileData, nodeName string, ) *k8scorev1.Service { + if owningTopology.Spec.Expose.ExposeType == exposeTypeNone { + return nil + } + owningTopologyName := owningTopology.GetName() serviceName := fmt.Sprintf("%s-%s", owningTopologyName, nodeName) @@ -273,6 +296,10 @@ func (r *ServiceExposeReconciler) RenderAll( ) []*k8scorev1.Service { services := make([]*k8scorev1.Service, len(nodeNames)) + if owningTopology.Spec.Expose.ExposeType == exposeTypeNone { + return services + } + for idx, nodeName := range nodeNames { services[idx] = r.Render( owningTopology, diff --git a/controllers/topology/serviceexpose_test.go b/controllers/topology/serviceexpose_test.go index bae07976..db3f3310 100644 --- a/controllers/topology/serviceexpose_test.go +++ b/controllers/topology/serviceexpose_test.go @@ -261,6 +261,74 @@ func TestRenderServiceExpose(t *testing.T) { srl1: kind: srl image: ghcr.io/nokia/srlinux +`, + }, + }, + Status: clabernetesapisv1alpha1.TopologyStatus{ + // to set naming for test purposes we need to update the *status* of the topo + // since this is done very early in the rec + RemoveTopologyPrefix: clabernetesutil.ToPointer(true), + }, + }, + owningTopologyStatus: &clabernetesapisv1alpha1.TopologyStatus{ + ExposedPorts: map[string]*clabernetesapisv1alpha1.ExposedPorts{}, + }, + clabernetesConfigs: map[string]*clabernetesutilcontainerlab.Config{ + "srl1": { + Name: "srl1", + Prefix: clabernetesutil.ToPointer(""), + Topology: &clabernetesutilcontainerlab.Topology{ + Defaults: &clabernetesutilcontainerlab.NodeDefinition{ + Ports: []string{ + "21022:22/tcp", + "21023:23/tcp", + "21161:161/udp", + "33333:57400/tcp", + "60000:21/tcp", + "60001:80/tcp", + "60002:443/tcp", + "60003:830/tcp", + "60004:5000/tcp", + "60005:5900/tcp", + "60006:6030/tcp", + "60007:9339/tcp", + "60008:9340/tcp", + "60009:9559/tcp", + }, + }, + Kinds: nil, + Nodes: map[string]*clabernetesutilcontainerlab.NodeDefinition{ + "srl1": { + Kind: "srl", + Image: "ghcr.io/nokia/srlinux", + }, + }, + Links: nil, + }, + Debug: false, + }, + }, + nodeName: "srl1", + }, + { + name: "simple-cluster-ip-expose-type", + owningTopology: &clabernetesapisv1alpha1.Topology{ + ObjectMeta: metav1.ObjectMeta{ + Name: "render-service-expose-test", + Namespace: "clabernetes", + }, + Spec: clabernetesapisv1alpha1.TopologySpec{ + Expose: clabernetesapisv1alpha1.Expose{ + ExposeType: string(k8scorev1.ServiceTypeClusterIP), + }, + Definition: clabernetesapisv1alpha1.Definition{ + Containerlab: `--- + name: test + topology: + nodes: + srl1: + kind: srl + image: ghcr.io/nokia/srlinux `, }, }, diff --git a/controllers/topology/servicefabric.go b/controllers/topology/servicefabric.go index b4b328e0..e6ad11d1 100644 --- a/controllers/topology/servicefabric.go +++ b/controllers/topology/servicefabric.go @@ -155,7 +155,7 @@ func (r *ServiceFabricReconciler) renderServiceBase( }, }, Selector: selectorLabels, - Type: clabernetesconstants.KubernetesServiceClusterIPType, + Type: k8scorev1.ServiceTypeClusterIP, }, } } diff --git a/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type-status.json b/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type-status.json new file mode 100755 index 00000000..d78ecd93 --- /dev/null +++ b/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type-status.json @@ -0,0 +1,23 @@ +{ + "srl1": { + "loadBalancerAddress": "", + "tcpPorts": [ + 22, + 23, + 57400, + 21, + 80, + 443, + 830, + 5000, + 5900, + 6030, + 9339, + 9340, + 9559 + ], + "udpPorts": [ + 161 + ] + } +} \ No newline at end of file diff --git a/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type.json b/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type.json new file mode 100755 index 00000000..e051993b --- /dev/null +++ b/controllers/topology/test-fixtures/golden/serviceexpose/render-service/simple-cluster-ip-expose-type.json @@ -0,0 +1,113 @@ +{ + "metadata": { + "name": "srl1", + "namespace": "clabernetes", + "creationTimestamp": null, + "labels": { + "clabernetes/app": "clabernetes", + "clabernetes/name": "srl1", + "clabernetes/topologyKind": "containerlab", + "clabernetes/topologyNode": "srl1", + "clabernetes/topologyOwner": "render-service-expose-test", + "clabernetes/topologyServiceType": "expose" + } + }, + "spec": { + "ports": [ + { + "name": "port-22-tcp", + "protocol": "TCP", + "port": 22, + "targetPort": 21022 + }, + { + "name": "port-23-tcp", + "protocol": "TCP", + "port": 23, + "targetPort": 21023 + }, + { + "name": "port-161-udp", + "protocol": "UDP", + "port": 161, + "targetPort": 21161 + }, + { + "name": "port-57400-tcp", + "protocol": "TCP", + "port": 57400, + "targetPort": 33333 + }, + { + "name": "port-21-tcp", + "protocol": "TCP", + "port": 21, + "targetPort": 60000 + }, + { + "name": "port-80-tcp", + "protocol": "TCP", + "port": 80, + "targetPort": 60001 + }, + { + "name": "port-443-tcp", + "protocol": "TCP", + "port": 443, + "targetPort": 60002 + }, + { + "name": "port-830-tcp", + "protocol": "TCP", + "port": 830, + "targetPort": 60003 + }, + { + "name": "port-5000-tcp", + "protocol": "TCP", + "port": 5000, + "targetPort": 60004 + }, + { + "name": "port-5900-tcp", + "protocol": "TCP", + "port": 5900, + "targetPort": 60005 + }, + { + "name": "port-6030-tcp", + "protocol": "TCP", + "port": 6030, + "targetPort": 60006 + }, + { + "name": "port-9339-tcp", + "protocol": "TCP", + "port": 9339, + "targetPort": 60007 + }, + { + "name": "port-9340-tcp", + "protocol": "TCP", + "port": 9340, + "targetPort": 60008 + }, + { + "name": "port-9559-tcp", + "protocol": "TCP", + "port": 9559, + "targetPort": 60009 + } + ], + "selector": { + "clabernetes/app": "clabernetes", + "clabernetes/name": "srl1", + "clabernetes/topologyNode": "srl1", + "clabernetes/topologyOwner": "render-service-expose-test" + }, + "type": "ClusterIP" + }, + "status": { + "loadBalancer": {} + } +} \ No newline at end of file diff --git a/e2e/clabverter/clabverter_basic_test.go b/e2e/clabverter/clabverter_basic_test.go index 276319a2..d97e2a75 100644 --- a/e2e/clabverter/clabverter_basic_test.go +++ b/e2e/clabverter/clabverter_basic_test.go @@ -50,6 +50,10 @@ func TestClabverterBasic(t *testing.T) { } defer func() { + if *clabernetestesthelper.SkipCleanup { + return + } + err = os.Remove("test-fixtures/10-apply.yaml") if err != nil { t.Errorf("failed cleaning up clabverted topology file, err: %s", err) diff --git a/e2e/clabverter/test-fixtures/golden/10-topology.clabverter-basic.yaml b/e2e/clabverter/test-fixtures/golden/10-topology.clabverter-basic.yaml index 844912aa..24894c09 100755 --- a/e2e/clabverter/test-fixtures/golden/10-topology.clabverter-basic.yaml +++ b/e2e/clabverter/test-fixtures/golden/10-topology.clabverter-basic.yaml @@ -30,6 +30,7 @@ spec: expose: disableAutoExpose: false disableExpose: false + exposeType: LoadBalancer imagePull: {} naming: prefixed statusProbes: diff --git a/e2e/topology/basic/test-fixtures/golden/10-topology.topology-basic.yaml b/e2e/topology/basic/test-fixtures/golden/10-topology.topology-basic.yaml index ecc1d53a..49d60fea 100755 --- a/e2e/topology/basic/test-fixtures/golden/10-topology.topology-basic.yaml +++ b/e2e/topology/basic/test-fixtures/golden/10-topology.topology-basic.yaml @@ -23,6 +23,7 @@ spec: expose: disableAutoExpose: false disableExpose: false + exposeType: LoadBalancer imagePull: {} naming: global statusProbes: diff --git a/e2e/topology/basic/test-fixtures/golden/20-topology.topology-basic.yaml b/e2e/topology/basic/test-fixtures/golden/20-topology.topology-basic.yaml index 45006e61..ca848313 100755 --- a/e2e/topology/basic/test-fixtures/golden/20-topology.topology-basic.yaml +++ b/e2e/topology/basic/test-fixtures/golden/20-topology.topology-basic.yaml @@ -28,6 +28,7 @@ spec: expose: disableAutoExpose: false disableExpose: false + exposeType: LoadBalancer imagePull: {} naming: global statusProbes: diff --git a/generated/clientset/fake/clientset_generated.go b/generated/clientset/fake/clientset_generated.go index 93b7f277..86b13e6e 100644 --- a/generated/clientset/fake/clientset_generated.go +++ b/generated/clientset/fake/clientset_generated.go @@ -31,8 +31,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { diff --git a/generated/clientset/typed/apis/v1alpha1/config.go b/generated/clientset/typed/apis/v1alpha1/config.go index c9b6a0d0..dde35331 100644 --- a/generated/clientset/typed/apis/v1alpha1/config.go +++ b/generated/clientset/typed/apis/v1alpha1/config.go @@ -20,14 +20,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/srl-labs/clabernetes/apis/v1alpha1" scheme "github.com/srl-labs/clabernetes/generated/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ConfigsGetter has a method to return a ConfigInterface. @@ -48,6 +47,7 @@ type ConfigInterface interface { config *v1alpha1.Config, opts v1.UpdateOptions, ) (*v1alpha1.Config, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus( ctx context.Context, config *v1alpha1.Config, @@ -71,174 +71,18 @@ type ConfigInterface interface { // configs implements ConfigInterface type configs struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.Config, *v1alpha1.ConfigList] } // newConfigs returns a Configs func newConfigs(c *ClabernetesV1alpha1Client, namespace string) *configs { return &configs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.Config, *v1alpha1.ConfigList]( + "configs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Config { return &v1alpha1.Config{} }, + func() *v1alpha1.ConfigList { return &v1alpha1.ConfigList{} }), } } - -// Get takes name of the config, and returns the corresponding config object, and an error if there is any. -func (c *configs) Get( - ctx context.Context, - name string, - options v1.GetOptions, -) (result *v1alpha1.Config, err error) { - result = &v1alpha1.Config{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Configs that match those selectors. -func (c *configs) List( - ctx context.Context, - opts v1.ListOptions, -) (result *v1alpha1.ConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configs. -func (c *configs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Create( - ctx context.Context, - config *v1alpha1.Config, - opts v1.CreateOptions, -) (result *v1alpha1.Config, err error) { - result = &v1alpha1.Config{} - err = c.client.Post(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Update( - ctx context.Context, - config *v1alpha1.Config, - opts v1.UpdateOptions, -) (result *v1alpha1.Config, err error) { - result = &v1alpha1.Config{} - err = c.client.Put(). - Namespace(c.ns). - Resource("configs"). - Name(config.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *configs) UpdateStatus( - ctx context.Context, - config *v1alpha1.Config, - opts v1.UpdateOptions, -) (result *v1alpha1.Config, err error) { - result = &v1alpha1.Config{} - err = c.client.Put(). - Namespace(c.ns). - Resource("configs"). - Name(config.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the config and deletes it. Returns an error if one occurs. -func (c *configs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("configs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *configs) DeleteCollection( - ctx context.Context, - opts v1.DeleteOptions, - listOpts v1.ListOptions, -) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched config. -func (c *configs) Patch( - ctx context.Context, - name string, - pt types.PatchType, - data []byte, - opts v1.PatchOptions, - subresources ...string, -) (result *v1alpha1.Config, err error) { - result = &v1alpha1.Config{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("configs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/generated/clientset/typed/apis/v1alpha1/connectivity.go b/generated/clientset/typed/apis/v1alpha1/connectivity.go index b224977a..b82d06c1 100644 --- a/generated/clientset/typed/apis/v1alpha1/connectivity.go +++ b/generated/clientset/typed/apis/v1alpha1/connectivity.go @@ -20,14 +20,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/srl-labs/clabernetes/apis/v1alpha1" scheme "github.com/srl-labs/clabernetes/generated/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ConnectivitiesGetter has a method to return a ConnectivityInterface. @@ -48,6 +47,7 @@ type ConnectivityInterface interface { connectivity *v1alpha1.Connectivity, opts v1.UpdateOptions, ) (*v1alpha1.Connectivity, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus( ctx context.Context, connectivity *v1alpha1.Connectivity, @@ -71,174 +71,18 @@ type ConnectivityInterface interface { // connectivities implements ConnectivityInterface type connectivities struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.Connectivity, *v1alpha1.ConnectivityList] } // newConnectivities returns a Connectivities func newConnectivities(c *ClabernetesV1alpha1Client, namespace string) *connectivities { return &connectivities{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.Connectivity, *v1alpha1.ConnectivityList]( + "connectivities", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Connectivity { return &v1alpha1.Connectivity{} }, + func() *v1alpha1.ConnectivityList { return &v1alpha1.ConnectivityList{} }), } } - -// Get takes name of the connectivity, and returns the corresponding connectivity object, and an error if there is any. -func (c *connectivities) Get( - ctx context.Context, - name string, - options v1.GetOptions, -) (result *v1alpha1.Connectivity, err error) { - result = &v1alpha1.Connectivity{} - err = c.client.Get(). - Namespace(c.ns). - Resource("connectivities"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Connectivities that match those selectors. -func (c *connectivities) List( - ctx context.Context, - opts v1.ListOptions, -) (result *v1alpha1.ConnectivityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ConnectivityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("connectivities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested connectivities. -func (c *connectivities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("connectivities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a connectivity and creates it. Returns the server's representation of the connectivity, and an error, if there is any. -func (c *connectivities) Create( - ctx context.Context, - connectivity *v1alpha1.Connectivity, - opts v1.CreateOptions, -) (result *v1alpha1.Connectivity, err error) { - result = &v1alpha1.Connectivity{} - err = c.client.Post(). - Namespace(c.ns). - Resource("connectivities"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(connectivity). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a connectivity and updates it. Returns the server's representation of the connectivity, and an error, if there is any. -func (c *connectivities) Update( - ctx context.Context, - connectivity *v1alpha1.Connectivity, - opts v1.UpdateOptions, -) (result *v1alpha1.Connectivity, err error) { - result = &v1alpha1.Connectivity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("connectivities"). - Name(connectivity.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(connectivity). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *connectivities) UpdateStatus( - ctx context.Context, - connectivity *v1alpha1.Connectivity, - opts v1.UpdateOptions, -) (result *v1alpha1.Connectivity, err error) { - result = &v1alpha1.Connectivity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("connectivities"). - Name(connectivity.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(connectivity). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the connectivity and deletes it. Returns an error if one occurs. -func (c *connectivities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("connectivities"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *connectivities) DeleteCollection( - ctx context.Context, - opts v1.DeleteOptions, - listOpts v1.ListOptions, -) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("connectivities"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched connectivity. -func (c *connectivities) Patch( - ctx context.Context, - name string, - pt types.PatchType, - data []byte, - opts v1.PatchOptions, - subresources ...string, -) (result *v1alpha1.Connectivity, err error) { - result = &v1alpha1.Connectivity{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("connectivities"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/generated/clientset/typed/apis/v1alpha1/fake/fake_config.go b/generated/clientset/typed/apis/v1alpha1/fake/fake_config.go index abf94858..041396cb 100644 --- a/generated/clientset/typed/apis/v1alpha1/fake/fake_config.go +++ b/generated/clientset/typed/apis/v1alpha1/fake/fake_config.go @@ -45,11 +45,12 @@ func (c *FakeConfigs) Get( name string, options v1.GetOptions, ) (result *v1alpha1.Config, err error) { + emptyResult := &v1alpha1.Config{} obj, err := c.Fake. - Invokes(testing.NewGetAction(configsResource, c.ns, name), &v1alpha1.Config{}) + Invokes(testing.NewGetActionWithOptions(configsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Config), err } @@ -59,14 +60,15 @@ func (c *FakeConfigs) List( ctx context.Context, opts v1.ListOptions, ) (result *v1alpha1.ConfigList, err error) { + emptyResult := &v1alpha1.ConfigList{} obj, err := c.Fake. Invokes( - testing.NewListAction(configsResource, configsKind, c.ns, opts), - &v1alpha1.ConfigList{}, + testing.NewListActionWithOptions(configsResource, configsKind, c.ns, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -85,7 +87,7 @@ func (c *FakeConfigs) List( // Watch returns a watch.Interface that watches the requested configs. func (c *FakeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(configsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(configsResource, c.ns, opts)) } @@ -95,11 +97,15 @@ func (c *FakeConfigs) Create( config *v1alpha1.Config, opts v1.CreateOptions, ) (result *v1alpha1.Config, err error) { + emptyResult := &v1alpha1.Config{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(configsResource, c.ns, config), &v1alpha1.Config{}) + Invokes( + testing.NewCreateActionWithOptions(configsResource, c.ns, config, opts), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Config), err } @@ -110,11 +116,15 @@ func (c *FakeConfigs) Update( config *v1alpha1.Config, opts v1.UpdateOptions, ) (result *v1alpha1.Config, err error) { + emptyResult := &v1alpha1.Config{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(configsResource, c.ns, config), &v1alpha1.Config{}) + Invokes( + testing.NewUpdateActionWithOptions(configsResource, c.ns, config, opts), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Config), err } @@ -125,15 +135,22 @@ func (c *FakeConfigs) UpdateStatus( ctx context.Context, config *v1alpha1.Config, opts v1.UpdateOptions, -) (*v1alpha1.Config, error) { +) (result *v1alpha1.Config, err error) { + emptyResult := &v1alpha1.Config{} obj, err := c.Fake. Invokes( - testing.NewUpdateSubresourceAction(configsResource, "status", c.ns, config), - &v1alpha1.Config{}, + testing.NewUpdateSubresourceActionWithOptions( + configsResource, + "status", + c.ns, + config, + opts, + ), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Config), err } @@ -155,7 +172,7 @@ func (c *FakeConfigs) DeleteCollection( opts v1.DeleteOptions, listOpts v1.ListOptions, ) error { - action := testing.NewDeleteCollectionAction(configsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(configsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ConfigList{}) return err @@ -170,20 +187,22 @@ func (c *FakeConfigs) Patch( opts v1.PatchOptions, subresources ...string, ) (result *v1alpha1.Config, err error) { + emptyResult := &v1alpha1.Config{} obj, err := c.Fake. Invokes( - testing.NewPatchSubresourceAction( + testing.NewPatchSubresourceActionWithOptions( configsResource, c.ns, name, pt, data, + opts, subresources...), - &v1alpha1.Config{}, + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Config), err } diff --git a/generated/clientset/typed/apis/v1alpha1/fake/fake_connectivity.go b/generated/clientset/typed/apis/v1alpha1/fake/fake_connectivity.go index 68e0afc0..8f9fa000 100644 --- a/generated/clientset/typed/apis/v1alpha1/fake/fake_connectivity.go +++ b/generated/clientset/typed/apis/v1alpha1/fake/fake_connectivity.go @@ -45,11 +45,15 @@ func (c *FakeConnectivities) Get( name string, options v1.GetOptions, ) (result *v1alpha1.Connectivity, err error) { + emptyResult := &v1alpha1.Connectivity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(connectivitiesResource, c.ns, name), &v1alpha1.Connectivity{}) + Invokes( + testing.NewGetActionWithOptions(connectivitiesResource, c.ns, name, options), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Connectivity), err } @@ -59,14 +63,20 @@ func (c *FakeConnectivities) List( ctx context.Context, opts v1.ListOptions, ) (result *v1alpha1.ConnectivityList, err error) { + emptyResult := &v1alpha1.ConnectivityList{} obj, err := c.Fake. Invokes( - testing.NewListAction(connectivitiesResource, connectivitiesKind, c.ns, opts), - &v1alpha1.ConnectivityList{}, + testing.NewListActionWithOptions( + connectivitiesResource, + connectivitiesKind, + c.ns, + opts, + ), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -88,7 +98,7 @@ func (c *FakeConnectivities) Watch( opts v1.ListOptions, ) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(connectivitiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(connectivitiesResource, c.ns, opts)) } @@ -98,14 +108,15 @@ func (c *FakeConnectivities) Create( connectivity *v1alpha1.Connectivity, opts v1.CreateOptions, ) (result *v1alpha1.Connectivity, err error) { + emptyResult := &v1alpha1.Connectivity{} obj, err := c.Fake. Invokes( - testing.NewCreateAction(connectivitiesResource, c.ns, connectivity), - &v1alpha1.Connectivity{}, + testing.NewCreateActionWithOptions(connectivitiesResource, c.ns, connectivity, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Connectivity), err } @@ -116,14 +127,15 @@ func (c *FakeConnectivities) Update( connectivity *v1alpha1.Connectivity, opts v1.UpdateOptions, ) (result *v1alpha1.Connectivity, err error) { + emptyResult := &v1alpha1.Connectivity{} obj, err := c.Fake. Invokes( - testing.NewUpdateAction(connectivitiesResource, c.ns, connectivity), - &v1alpha1.Connectivity{}, + testing.NewUpdateActionWithOptions(connectivitiesResource, c.ns, connectivity, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Connectivity), err } @@ -134,20 +146,22 @@ func (c *FakeConnectivities) UpdateStatus( ctx context.Context, connectivity *v1alpha1.Connectivity, opts v1.UpdateOptions, -) (*v1alpha1.Connectivity, error) { +) (result *v1alpha1.Connectivity, err error) { + emptyResult := &v1alpha1.Connectivity{} obj, err := c.Fake. Invokes( - testing.NewUpdateSubresourceAction( + testing.NewUpdateSubresourceActionWithOptions( connectivitiesResource, "status", c.ns, connectivity, + opts, ), - &v1alpha1.Connectivity{}, + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Connectivity), err } @@ -169,7 +183,12 @@ func (c *FakeConnectivities) DeleteCollection( opts v1.DeleteOptions, listOpts v1.ListOptions, ) error { - action := testing.NewDeleteCollectionAction(connectivitiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions( + connectivitiesResource, + c.ns, + opts, + listOpts, + ) _, err := c.Fake.Invokes(action, &v1alpha1.ConnectivityList{}) return err @@ -184,20 +203,22 @@ func (c *FakeConnectivities) Patch( opts v1.PatchOptions, subresources ...string, ) (result *v1alpha1.Connectivity, err error) { + emptyResult := &v1alpha1.Connectivity{} obj, err := c.Fake. Invokes( - testing.NewPatchSubresourceAction( + testing.NewPatchSubresourceActionWithOptions( connectivitiesResource, c.ns, name, pt, data, + opts, subresources...), - &v1alpha1.Connectivity{}, + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Connectivity), err } diff --git a/generated/clientset/typed/apis/v1alpha1/fake/fake_imagerequest.go b/generated/clientset/typed/apis/v1alpha1/fake/fake_imagerequest.go index 374d39f0..48fbc491 100644 --- a/generated/clientset/typed/apis/v1alpha1/fake/fake_imagerequest.go +++ b/generated/clientset/typed/apis/v1alpha1/fake/fake_imagerequest.go @@ -45,11 +45,15 @@ func (c *FakeImageRequests) Get( name string, options v1.GetOptions, ) (result *v1alpha1.ImageRequest, err error) { + emptyResult := &v1alpha1.ImageRequest{} obj, err := c.Fake. - Invokes(testing.NewGetAction(imagerequestsResource, c.ns, name), &v1alpha1.ImageRequest{}) + Invokes( + testing.NewGetActionWithOptions(imagerequestsResource, c.ns, name, options), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ImageRequest), err } @@ -59,14 +63,15 @@ func (c *FakeImageRequests) List( ctx context.Context, opts v1.ListOptions, ) (result *v1alpha1.ImageRequestList, err error) { + emptyResult := &v1alpha1.ImageRequestList{} obj, err := c.Fake. Invokes( - testing.NewListAction(imagerequestsResource, imagerequestsKind, c.ns, opts), - &v1alpha1.ImageRequestList{}, + testing.NewListActionWithOptions(imagerequestsResource, imagerequestsKind, c.ns, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -88,7 +93,7 @@ func (c *FakeImageRequests) Watch( opts v1.ListOptions, ) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(imagerequestsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(imagerequestsResource, c.ns, opts)) } @@ -98,14 +103,15 @@ func (c *FakeImageRequests) Create( imageRequest *v1alpha1.ImageRequest, opts v1.CreateOptions, ) (result *v1alpha1.ImageRequest, err error) { + emptyResult := &v1alpha1.ImageRequest{} obj, err := c.Fake. Invokes( - testing.NewCreateAction(imagerequestsResource, c.ns, imageRequest), - &v1alpha1.ImageRequest{}, + testing.NewCreateActionWithOptions(imagerequestsResource, c.ns, imageRequest, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ImageRequest), err } @@ -116,14 +122,15 @@ func (c *FakeImageRequests) Update( imageRequest *v1alpha1.ImageRequest, opts v1.UpdateOptions, ) (result *v1alpha1.ImageRequest, err error) { + emptyResult := &v1alpha1.ImageRequest{} obj, err := c.Fake. Invokes( - testing.NewUpdateAction(imagerequestsResource, c.ns, imageRequest), - &v1alpha1.ImageRequest{}, + testing.NewUpdateActionWithOptions(imagerequestsResource, c.ns, imageRequest, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ImageRequest), err } @@ -134,15 +141,22 @@ func (c *FakeImageRequests) UpdateStatus( ctx context.Context, imageRequest *v1alpha1.ImageRequest, opts v1.UpdateOptions, -) (*v1alpha1.ImageRequest, error) { +) (result *v1alpha1.ImageRequest, err error) { + emptyResult := &v1alpha1.ImageRequest{} obj, err := c.Fake. Invokes( - testing.NewUpdateSubresourceAction(imagerequestsResource, "status", c.ns, imageRequest), - &v1alpha1.ImageRequest{}, + testing.NewUpdateSubresourceActionWithOptions( + imagerequestsResource, + "status", + c.ns, + imageRequest, + opts, + ), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ImageRequest), err } @@ -164,7 +178,12 @@ func (c *FakeImageRequests) DeleteCollection( opts v1.DeleteOptions, listOpts v1.ListOptions, ) error { - action := testing.NewDeleteCollectionAction(imagerequestsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions( + imagerequestsResource, + c.ns, + opts, + listOpts, + ) _, err := c.Fake.Invokes(action, &v1alpha1.ImageRequestList{}) return err @@ -179,20 +198,22 @@ func (c *FakeImageRequests) Patch( opts v1.PatchOptions, subresources ...string, ) (result *v1alpha1.ImageRequest, err error) { + emptyResult := &v1alpha1.ImageRequest{} obj, err := c.Fake. Invokes( - testing.NewPatchSubresourceAction( + testing.NewPatchSubresourceActionWithOptions( imagerequestsResource, c.ns, name, pt, data, + opts, subresources...), - &v1alpha1.ImageRequest{}, + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ImageRequest), err } diff --git a/generated/clientset/typed/apis/v1alpha1/fake/fake_topology.go b/generated/clientset/typed/apis/v1alpha1/fake/fake_topology.go index 1cd17fa1..a019fc04 100644 --- a/generated/clientset/typed/apis/v1alpha1/fake/fake_topology.go +++ b/generated/clientset/typed/apis/v1alpha1/fake/fake_topology.go @@ -45,11 +45,15 @@ func (c *FakeTopologies) Get( name string, options v1.GetOptions, ) (result *v1alpha1.Topology, err error) { + emptyResult := &v1alpha1.Topology{} obj, err := c.Fake. - Invokes(testing.NewGetAction(topologiesResource, c.ns, name), &v1alpha1.Topology{}) + Invokes( + testing.NewGetActionWithOptions(topologiesResource, c.ns, name, options), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Topology), err } @@ -59,14 +63,15 @@ func (c *FakeTopologies) List( ctx context.Context, opts v1.ListOptions, ) (result *v1alpha1.TopologyList, err error) { + emptyResult := &v1alpha1.TopologyList{} obj, err := c.Fake. Invokes( - testing.NewListAction(topologiesResource, topologiesKind, c.ns, opts), - &v1alpha1.TopologyList{}, + testing.NewListActionWithOptions(topologiesResource, topologiesKind, c.ns, opts), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -85,7 +90,7 @@ func (c *FakeTopologies) List( // Watch returns a watch.Interface that watches the requested topologies. func (c *FakeTopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(topologiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(topologiesResource, c.ns, opts)) } @@ -95,11 +100,15 @@ func (c *FakeTopologies) Create( topology *v1alpha1.Topology, opts v1.CreateOptions, ) (result *v1alpha1.Topology, err error) { + emptyResult := &v1alpha1.Topology{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(topologiesResource, c.ns, topology), &v1alpha1.Topology{}) + Invokes( + testing.NewCreateActionWithOptions(topologiesResource, c.ns, topology, opts), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Topology), err } @@ -110,11 +119,15 @@ func (c *FakeTopologies) Update( topology *v1alpha1.Topology, opts v1.UpdateOptions, ) (result *v1alpha1.Topology, err error) { + emptyResult := &v1alpha1.Topology{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(topologiesResource, c.ns, topology), &v1alpha1.Topology{}) + Invokes( + testing.NewUpdateActionWithOptions(topologiesResource, c.ns, topology, opts), + emptyResult, + ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Topology), err } @@ -125,15 +138,22 @@ func (c *FakeTopologies) UpdateStatus( ctx context.Context, topology *v1alpha1.Topology, opts v1.UpdateOptions, -) (*v1alpha1.Topology, error) { +) (result *v1alpha1.Topology, err error) { + emptyResult := &v1alpha1.Topology{} obj, err := c.Fake. Invokes( - testing.NewUpdateSubresourceAction(topologiesResource, "status", c.ns, topology), - &v1alpha1.Topology{}, + testing.NewUpdateSubresourceActionWithOptions( + topologiesResource, + "status", + c.ns, + topology, + opts, + ), + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Topology), err } @@ -155,7 +175,7 @@ func (c *FakeTopologies) DeleteCollection( opts v1.DeleteOptions, listOpts v1.ListOptions, ) error { - action := testing.NewDeleteCollectionAction(topologiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(topologiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.TopologyList{}) return err @@ -170,20 +190,22 @@ func (c *FakeTopologies) Patch( opts v1.PatchOptions, subresources ...string, ) (result *v1alpha1.Topology, err error) { + emptyResult := &v1alpha1.Topology{} obj, err := c.Fake. Invokes( - testing.NewPatchSubresourceAction( + testing.NewPatchSubresourceActionWithOptions( topologiesResource, c.ns, name, pt, data, + opts, subresources...), - &v1alpha1.Topology{}, + emptyResult, ) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Topology), err } diff --git a/generated/clientset/typed/apis/v1alpha1/imagerequest.go b/generated/clientset/typed/apis/v1alpha1/imagerequest.go index 7b5926ac..c0271270 100644 --- a/generated/clientset/typed/apis/v1alpha1/imagerequest.go +++ b/generated/clientset/typed/apis/v1alpha1/imagerequest.go @@ -20,14 +20,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/srl-labs/clabernetes/apis/v1alpha1" scheme "github.com/srl-labs/clabernetes/generated/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ImageRequestsGetter has a method to return a ImageRequestInterface. @@ -48,6 +47,7 @@ type ImageRequestInterface interface { imageRequest *v1alpha1.ImageRequest, opts v1.UpdateOptions, ) (*v1alpha1.ImageRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus( ctx context.Context, imageRequest *v1alpha1.ImageRequest, @@ -71,174 +71,18 @@ type ImageRequestInterface interface { // imageRequests implements ImageRequestInterface type imageRequests struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.ImageRequest, *v1alpha1.ImageRequestList] } // newImageRequests returns a ImageRequests func newImageRequests(c *ClabernetesV1alpha1Client, namespace string) *imageRequests { return &imageRequests{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.ImageRequest, *v1alpha1.ImageRequestList]( + "imagerequests", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.ImageRequest { return &v1alpha1.ImageRequest{} }, + func() *v1alpha1.ImageRequestList { return &v1alpha1.ImageRequestList{} }), } } - -// Get takes name of the imageRequest, and returns the corresponding imageRequest object, and an error if there is any. -func (c *imageRequests) Get( - ctx context.Context, - name string, - options v1.GetOptions, -) (result *v1alpha1.ImageRequest, err error) { - result = &v1alpha1.ImageRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("imagerequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ImageRequests that match those selectors. -func (c *imageRequests) List( - ctx context.Context, - opts v1.ListOptions, -) (result *v1alpha1.ImageRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ImageRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("imagerequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested imageRequests. -func (c *imageRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("imagerequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a imageRequest and creates it. Returns the server's representation of the imageRequest, and an error, if there is any. -func (c *imageRequests) Create( - ctx context.Context, - imageRequest *v1alpha1.ImageRequest, - opts v1.CreateOptions, -) (result *v1alpha1.ImageRequest, err error) { - result = &v1alpha1.ImageRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("imagerequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(imageRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a imageRequest and updates it. Returns the server's representation of the imageRequest, and an error, if there is any. -func (c *imageRequests) Update( - ctx context.Context, - imageRequest *v1alpha1.ImageRequest, - opts v1.UpdateOptions, -) (result *v1alpha1.ImageRequest, err error) { - result = &v1alpha1.ImageRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("imagerequests"). - Name(imageRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(imageRequest). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *imageRequests) UpdateStatus( - ctx context.Context, - imageRequest *v1alpha1.ImageRequest, - opts v1.UpdateOptions, -) (result *v1alpha1.ImageRequest, err error) { - result = &v1alpha1.ImageRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("imagerequests"). - Name(imageRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(imageRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the imageRequest and deletes it. Returns an error if one occurs. -func (c *imageRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("imagerequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *imageRequests) DeleteCollection( - ctx context.Context, - opts v1.DeleteOptions, - listOpts v1.ListOptions, -) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("imagerequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched imageRequest. -func (c *imageRequests) Patch( - ctx context.Context, - name string, - pt types.PatchType, - data []byte, - opts v1.PatchOptions, - subresources ...string, -) (result *v1alpha1.ImageRequest, err error) { - result = &v1alpha1.ImageRequest{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("imagerequests"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/generated/clientset/typed/apis/v1alpha1/topology.go b/generated/clientset/typed/apis/v1alpha1/topology.go index bc366496..93b4cff6 100644 --- a/generated/clientset/typed/apis/v1alpha1/topology.go +++ b/generated/clientset/typed/apis/v1alpha1/topology.go @@ -20,14 +20,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/srl-labs/clabernetes/apis/v1alpha1" scheme "github.com/srl-labs/clabernetes/generated/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TopologiesGetter has a method to return a TopologyInterface. @@ -48,6 +47,7 @@ type TopologyInterface interface { topology *v1alpha1.Topology, opts v1.UpdateOptions, ) (*v1alpha1.Topology, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus( ctx context.Context, topology *v1alpha1.Topology, @@ -71,174 +71,18 @@ type TopologyInterface interface { // topologies implements TopologyInterface type topologies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.Topology, *v1alpha1.TopologyList] } // newTopologies returns a Topologies func newTopologies(c *ClabernetesV1alpha1Client, namespace string) *topologies { return &topologies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.Topology, *v1alpha1.TopologyList]( + "topologies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Topology { return &v1alpha1.Topology{} }, + func() *v1alpha1.TopologyList { return &v1alpha1.TopologyList{} }), } } - -// Get takes name of the topology, and returns the corresponding topology object, and an error if there is any. -func (c *topologies) Get( - ctx context.Context, - name string, - options v1.GetOptions, -) (result *v1alpha1.Topology, err error) { - result = &v1alpha1.Topology{} - err = c.client.Get(). - Namespace(c.ns). - Resource("topologies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Topologies that match those selectors. -func (c *topologies) List( - ctx context.Context, - opts v1.ListOptions, -) (result *v1alpha1.TopologyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.TopologyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("topologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested topologies. -func (c *topologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("topologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a topology and creates it. Returns the server's representation of the topology, and an error, if there is any. -func (c *topologies) Create( - ctx context.Context, - topology *v1alpha1.Topology, - opts v1.CreateOptions, -) (result *v1alpha1.Topology, err error) { - result = &v1alpha1.Topology{} - err = c.client.Post(). - Namespace(c.ns). - Resource("topologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(topology). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a topology and updates it. Returns the server's representation of the topology, and an error, if there is any. -func (c *topologies) Update( - ctx context.Context, - topology *v1alpha1.Topology, - opts v1.UpdateOptions, -) (result *v1alpha1.Topology, err error) { - result = &v1alpha1.Topology{} - err = c.client.Put(). - Namespace(c.ns). - Resource("topologies"). - Name(topology.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(topology). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *topologies) UpdateStatus( - ctx context.Context, - topology *v1alpha1.Topology, - opts v1.UpdateOptions, -) (result *v1alpha1.Topology, err error) { - result = &v1alpha1.Topology{} - err = c.client.Put(). - Namespace(c.ns). - Resource("topologies"). - Name(topology.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(topology). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the topology and deletes it. Returns an error if one occurs. -func (c *topologies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("topologies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *topologies) DeleteCollection( - ctx context.Context, - opts v1.DeleteOptions, - listOpts v1.ListOptions, -) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("topologies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched topology. -func (c *topologies) Patch( - ctx context.Context, - name string, - pt types.PatchType, - data []byte, - opts v1.PatchOptions, - subresources ...string, -) (result *v1alpha1.Topology, err error) { - result = &v1alpha1.Topology{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("topologies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/generated/openapi/openapi.json b/generated/openapi/openapi.json index c32a8754..5043eeb1 100644 --- a/generated/openapi/openapi.json +++ b/generated/openapi/openapi.json @@ -683,7 +683,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -755,7 +755,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -817,13 +817,17 @@ "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -881,13 +885,17 @@ "description": "ResourcesDefault is the default set of resources for clabernetes launcher pods. This is used\nonly as a last option if a Topology does not have resources, and there are no resources for\nthe given containerlab kind/type", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -1143,7 +1151,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -1215,7 +1223,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -1358,13 +1366,17 @@ "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -1468,12 +1480,22 @@ "description": "Expose holds configurations relevant to how clabernetes exposes a topology.", "properties": { "disableAutoExpose": { - "description": "DisableAutoExpose disables the automagic exposing of ports for a given topology. When this\nsetting is disabled clabernetes will not auto add ports so if you want to expose (via a\nload balancer service) you will need to have ports outlined in your containerlab config\n(or equivalent for kne). When this is `false` (default), clabernetes will add and expose the\nfollowing list of ports to whatever ports you have already defined:\n\n\n21 - tcp - ftp\n22 - tcp - ssh\n23 - tcp - telnet\n80 - tcp - http\n161 - udp - snmp\n443 - tcp - https\n830 - tcp - netconf (over ssh)\n5000 - tcp - telnet for vrnetlab qemu host\n5900 - tcp - vnc\n6030 - tcp - gnmi (arista default)\n9339 - tcp - gnmi/gnoi\n9340 - tcp - gribi\n9559 - tcp - p4rt\n57400 - tcp - gnmi (nokia srl/sros default)\n\n\nThis setting is *ignored completely* if `DisableExpose` is true!", + "description": "DisableAutoExpose disables the automagic exposing of ports for a given topology. When this\nsetting is disabled clabernetes will not auto add ports so if you want to expose (via a\nload balancer service) you will need to have ports outlined in your containerlab config\n(or equivalent for kne). When this is `false` (default), clabernetes will add and expose the\nfollowing list of ports to whatever ports you have already defined:\n\n21 - tcp - ftp\n22 - tcp - ssh\n23 - tcp - telnet\n80 - tcp - http\n161 - udp - snmp\n443 - tcp - https\n830 - tcp - netconf (over ssh)\n5000 - tcp - telnet for vrnetlab qemu host\n5900 - tcp - vnc\n6030 - tcp - gnmi (arista default)\n9339 - tcp - gnmi/gnoi\n9340 - tcp - gribi\n9559 - tcp - p4rt\n57400 - tcp - gnmi (nokia srl/sros default)\n\nThis setting is *ignored completely* if `DisableExpose` is true!", "type": "boolean" }, "disableExpose": { "description": "DisableExpose indicates if exposing nodes via LoadBalancer service should be disabled, by\ndefault any mapped ports in a containerlab topology will be exposed.", "type": "boolean" + }, + "exposeType": { + "default": "LoadBalancer", + "description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIP: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.", + "enum": [ + "None", + "ClusterIP", + "LoadBalancer" + ], + "type": "string" } }, "type": "object" @@ -1664,7 +1686,7 @@ "conditions": { "description": "Conditions is a list of conditions for the topology custom resource.", "items": { - "description": "Condition contains details for one aspect of the current state of this API Resource.\n---\nThis struct is intended for direct use as an array at the field path .status.conditions. For example,\n\n\n\ttype FooStatus struct{\n\t // Represents the observations of a foo's current state.\n\t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t // other fields\n\t}", + "description": "Condition contains details for one aspect of the current state of this API Resource.", "properties": { "lastTransitionTime": { "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", @@ -1699,7 +1721,7 @@ "type": "string" }, "type": { - "description": "type of condition in CamelCase or in foo.example.com/CamelCase.\n---\nMany .condition.type values are consistent across resources like Available, but because arbitrary conditions can be\nuseful (see .node.status.conditions), the ability to deconflict is important.\nThe regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)", + "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", "maxLength": 316, "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", "type": "string" diff --git a/generated/openapi/openapi_generated.go b/generated/openapi/openapi_generated.go index 59f94132..0a8456d9 100644 --- a/generated/openapi/openapi_generated.go +++ b/generated/openapi/openapi_generated.go @@ -913,6 +913,13 @@ func schema_srl_labs_clabernetes_apis_v1alpha1_Expose( Format: "", }, }, + "exposeType": { + SchemaProps: spec.SchemaProps{ + Description: "ExposeType configures the service type(s) related to exposing the topology. This is an enum that has the following valid values: - None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIP: a clusterip service is created so you can hit that service name for the pods. - LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, diff --git a/go.mod b/go.mod index d89fbc2b..7e5d1234 100644 --- a/go.mod +++ b/go.mod @@ -6,20 +6,20 @@ require ( github.com/carlmontanari/difflibgo v0.0.0-20240227210139-93685b1c22ae github.com/carlmontanari/slurpeeth v0.0.0-20240209224827-246fa87e31f3 github.com/openconfig/kne v0.2.1 - github.com/urfave/cli/v2 v2.27.4 - google.golang.org/protobuf v1.34.2 + github.com/urfave/cli/v2 v2.27.5 + google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.31.1 - k8s.io/apiextensions-apiserver v0.31.1 - k8s.io/apimachinery v0.31.1 - k8s.io/client-go v0.31.1 + k8s.io/api v0.31.2 + k8s.io/apiextensions-apiserver v0.31.2 + k8s.io/apimachinery v0.31.2 + k8s.io/client-go v0.31.2 k8s.io/klog/v2 v2.130.1 - k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 + k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 sigs.k8s.io/controller-runtime v0.19.0 sigs.k8s.io/yaml v1.4.0 ) -require golang.org/x/crypto v0.27.0 +require golang.org/x/crypto v0.28.0 require ( github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -31,7 +31,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect @@ -93,9 +93,9 @@ require ( golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect @@ -105,9 +105,9 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiserver v0.31.1 // indirect - k8s.io/component-base v0.31.1 // indirect - k8s.io/kms v0.31.1 // indirect + k8s.io/apiserver v0.31.2 // indirect + k8s.io/component-base v0.31.2 // indirect + k8s.io/kms v0.31.2 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index b340008b..b02ad1ed 100644 --- a/go.sum +++ b/go.sum @@ -23,6 +23,8 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -147,6 +149,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= +github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= +github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= @@ -190,6 +194,8 @@ golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -214,16 +220,22 @@ golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -249,6 +261,8 @@ google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -268,30 +282,46 @@ k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= +k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= +k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c= k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM= +k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= +k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= +k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= +k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= +k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kms v0.31.1 h1:cGLyV3cIwb0ovpP/jtyIe2mEuQ/MkbhmeBF2IYCA9Io= k8s.io/kms v0.31.1/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kms v0.31.2 h1:pyx7l2qVOkClzFMIWMVF/FxsSkgd+OIGH7DecpbscJI= +k8s.io/kms v0.31.2/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f h1:bnWtxXWdAl5bVOCEPoNdvMkyj6cTW3zxHuwKIakuV9w= k8s.io/kube-openapi v0.0.0-20240812233141-91dab695df6f/go.mod h1:G0W3eI9gG219NHRq3h5uQaRBl4pj4ZpwzRP5ti8y770= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 h1:1dWzkmJrrprYvjGwh9kEUxmcUV/CtNU8QM7h1FLWQOo= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38/go.mod h1:coRQXBK9NxO98XUv3ZD6AK3xzHCxV6+b7lrquKwaKzA= +k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 h1:MErs8YA0abvOqJ8gIupA1Tz6PKXYUw34XsGlA7uSL1k= +k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094/go.mod h1:7ioBJr1A6igWjsR2fxq2EZ0mlMwYLejazSIc2bzMp2U= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= diff --git a/ui/clabernetes-openapi.json b/ui/clabernetes-openapi.json index c32a8754..5043eeb1 100644 --- a/ui/clabernetes-openapi.json +++ b/ui/clabernetes-openapi.json @@ -683,7 +683,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -755,7 +755,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -817,13 +817,17 @@ "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -881,13 +885,17 @@ "description": "ResourcesDefault is the default set of resources for clabernetes launcher pods. This is used\nonly as a last option if a Topology does not have resources, and there are no resources for\nthe given containerlab kind/type", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -1143,7 +1151,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -1215,7 +1223,7 @@ }, "name": { "default": "", - "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nTODO: Add other useful fields. apiVersion, kind, uid?\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\nTODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.", + "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { @@ -1358,13 +1366,17 @@ "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { - "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\n\nThis field is immutable. It can only be set for containers.", + "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", "items": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.", + "type": "string" } }, "required": [ @@ -1468,12 +1480,22 @@ "description": "Expose holds configurations relevant to how clabernetes exposes a topology.", "properties": { "disableAutoExpose": { - "description": "DisableAutoExpose disables the automagic exposing of ports for a given topology. When this\nsetting is disabled clabernetes will not auto add ports so if you want to expose (via a\nload balancer service) you will need to have ports outlined in your containerlab config\n(or equivalent for kne). When this is `false` (default), clabernetes will add and expose the\nfollowing list of ports to whatever ports you have already defined:\n\n\n21 - tcp - ftp\n22 - tcp - ssh\n23 - tcp - telnet\n80 - tcp - http\n161 - udp - snmp\n443 - tcp - https\n830 - tcp - netconf (over ssh)\n5000 - tcp - telnet for vrnetlab qemu host\n5900 - tcp - vnc\n6030 - tcp - gnmi (arista default)\n9339 - tcp - gnmi/gnoi\n9340 - tcp - gribi\n9559 - tcp - p4rt\n57400 - tcp - gnmi (nokia srl/sros default)\n\n\nThis setting is *ignored completely* if `DisableExpose` is true!", + "description": "DisableAutoExpose disables the automagic exposing of ports for a given topology. When this\nsetting is disabled clabernetes will not auto add ports so if you want to expose (via a\nload balancer service) you will need to have ports outlined in your containerlab config\n(or equivalent for kne). When this is `false` (default), clabernetes will add and expose the\nfollowing list of ports to whatever ports you have already defined:\n\n21 - tcp - ftp\n22 - tcp - ssh\n23 - tcp - telnet\n80 - tcp - http\n161 - udp - snmp\n443 - tcp - https\n830 - tcp - netconf (over ssh)\n5000 - tcp - telnet for vrnetlab qemu host\n5900 - tcp - vnc\n6030 - tcp - gnmi (arista default)\n9339 - tcp - gnmi/gnoi\n9340 - tcp - gribi\n9559 - tcp - p4rt\n57400 - tcp - gnmi (nokia srl/sros default)\n\nThis setting is *ignored completely* if `DisableExpose` is true!", "type": "boolean" }, "disableExpose": { "description": "DisableExpose indicates if exposing nodes via LoadBalancer service should be disabled, by\ndefault any mapped ports in a containerlab topology will be exposed.", "type": "boolean" + }, + "exposeType": { + "default": "LoadBalancer", + "description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIP: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.", + "enum": [ + "None", + "ClusterIP", + "LoadBalancer" + ], + "type": "string" } }, "type": "object" @@ -1664,7 +1686,7 @@ "conditions": { "description": "Conditions is a list of conditions for the topology custom resource.", "items": { - "description": "Condition contains details for one aspect of the current state of this API Resource.\n---\nThis struct is intended for direct use as an array at the field path .status.conditions. For example,\n\n\n\ttype FooStatus struct{\n\t // Represents the observations of a foo's current state.\n\t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t // other fields\n\t}", + "description": "Condition contains details for one aspect of the current state of this API Resource.", "properties": { "lastTransitionTime": { "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", @@ -1699,7 +1721,7 @@ "type": "string" }, "type": { - "description": "type of condition in CamelCase or in foo.example.com/CamelCase.\n---\nMany .condition.type values are consistent across resources like Available, but because arbitrary conditions can be\nuseful (see .node.status.conditions), the ability to deconflict is important.\nThe regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)", + "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", "maxLength": 316, "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", "type": "string"