Skip to content

Commit

Permalink
remove unused apiproduct field (#53)
Browse files Browse the repository at this point in the history
* remove unused apiproduct field
spec.routing.expose

* remove unused apiproduct field
spec.information
  • Loading branch information
eguzki authored Oct 8, 2021
1 parent 161e225 commit b23551c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 60 deletions.
17 changes: 4 additions & 13 deletions apis/networking/v1beta1/apiproduct_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ type SecurityScheme struct {
OpenIDConnectAuth *OpenIDConnectAuth `json:"openIDConnectAuth,omitempty"`
}

type ProductInformation struct {
Description string `json:"description"`
Owner string `json:"owner"`
}

type Routing struct {
Hosts []string `json:"hosts"`
Expose bool `json:"expose"`
Hosts []string `json:"hosts"`
}

type Mapping struct {
Expand Down Expand Up @@ -112,12 +106,9 @@ type RateLimitSpec struct {

// APIProductSpec defines the desired state of APIProduct
type APIProductSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Information ProductInformation `json:"information"`
Routing Routing `json:"routing"`
SecurityScheme []*SecurityScheme `json:"securityScheme"`
APIs []*APISelector `json:"APIs"`
Routing Routing `json:"routing"`
SecurityScheme []*SecurityScheme `json:"securityScheme"`
APIs []*APISelector `json:"APIs"`

// RateLimit configures global rate limit parameters
// +optional
Expand Down
8 changes: 1 addition & 7 deletions apis/networking/v1beta1/apiproduct_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ import (
)

func TestAPIProductTypeBasic(t *testing.T) {
apiProduct := APIProduct{
Spec: APIProductSpec{
Information: ProductInformation{
Description: "some descr",
},
},
}
apiProduct := APIProduct{}
_, err := json.MarshalIndent(apiProduct, "", " ")
if err != nil {
t.Error(err)
Expand Down
16 changes: 0 additions & 16 deletions apis/networking/v1beta1/zz_generated.deepcopy.go

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

16 changes: 0 additions & 16 deletions config/crd/bases/networking.kuadrant.io_apiproducts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ spec:
- namespace
type: object
type: array
information:
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Important: Run "make" to regenerate code after modifying this file'
properties:
description:
type: string
owner:
type: string
required:
- description
- owner
type: object
rateLimit:
description: RateLimit configures global rate limit parameters
properties:
Expand Down Expand Up @@ -126,14 +114,11 @@ spec:
type: object
routing:
properties:
expose:
type: boolean
hosts:
items:
type: string
type: array
required:
- expose
- hosts
type: object
securityScheme:
Expand Down Expand Up @@ -174,7 +159,6 @@ spec:
type: array
required:
- APIs
- information
- routing
- securityScheme
type: object
Expand Down
4 changes: 0 additions & 4 deletions controllers/apiproduct_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ func apiProduct(ns string) *networkingv1beta1.APIProduct {
},
ObjectMeta: metav1.ObjectMeta{Name: "apiproduct01", Namespace: ns},
Spec: networkingv1beta1.APIProductSpec{
Information: networkingv1beta1.ProductInformation{
Description: "My super nice API Product",
Owner: "whoever@mycompany.com",
},
Routing: networkingv1beta1.Routing{
Hosts: []string{"petstore.127.0.0.1.nip.io"},
},
Expand Down
4 changes: 0 additions & 4 deletions samples/apiproduct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ kind: APIProduct
metadata:
name: animaltoys
spec:
information:
description: My super nice API Product.
owner: whoever@mycompany.com
routing:
hosts:
- api.animaltoys.127.0.0.1.nip.io
expose: true
APIs:
- name: dogs
namespace: default
Expand Down

0 comments on commit b23551c

Please sign in to comment.