Skip to content

Commit

Permalink
feat: add license file type
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Apr 24, 2023
1 parent 779d00d commit 0dd4961
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Table of Contents

- [v1.20.0](#v1200)
- [v1.19.1](#v1191)
- [v1.19.0](#v1190)
- [v1.18.1](#v1181)
Expand Down Expand Up @@ -55,6 +56,15 @@
- [v0.2.0](#v020)
- [v0.1.0](#v010)

## [v1.20.0]

> Release date: 2023/04/24
### Add

- Add the license type to the file package.


## [v1.19.1]

> Release date: 2023/03/21
Expand Down Expand Up @@ -1192,6 +1202,7 @@ No breaking changes have been introduced in this release.

Debut release of decK

[v1.20.0]: https://github.com/kong/deck/compare/v1.19.1...v1.20.0
[v1.19.1]: https://github.com/kong/deck/compare/v1.19.0...v1.19.1
[v1.19.0]: https://github.com/kong/deck/compare/v1.18.1...v1.19.0
[v1.18.1]: https://github.com/kong/deck/compare/v1.18.0...v1.18.1
Expand Down
25 changes: 25 additions & 0 deletions file/kong_json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
},
"type": "array"
},
"licenses": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/FLicense"
},
"type": "array"
},
"plugins": {
"items": {
"$ref": "#/definitions/FPlugin"
Expand Down Expand Up @@ -549,6 +556,24 @@
"additionalProperties": false,
"type": "object"
},
"FLicense": {
"properties": {
"created_at": {
"type": "integer"
},
"id": {
"type": "string"
},
"payload": {
"type": "string"
},
"updated_at": {
"type": "integer"
}
},
"additionalProperties": false,
"type": "object"
},
"FPlugin": {
"required": [
"name"
Expand Down
20 changes: 20 additions & 0 deletions file/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,24 @@ func (c FVault) sortKey() string {
return ""
}

// FLicense exists as a file type _only_
// This is a compatibility layer for KIC library usage. deck cannot interact with the license entity.
// Ref https://github.com/Kong/deck/pull/882 if we need to support this entity throughout deck.

// FLicense represents a Kong License.
// +k8s:deepcopy-gen=true
type FLicense struct {
kong.License `yaml:",inline,omitempty"`
}

// sortKey is used for sorting.
func (c FLicense) sortKey() string {
if c.ID != nil {
return *c.ID
}
return ""
}

//go:generate go run ./codegen/main.go

// Content represents a serialized Kong state.
Expand Down Expand Up @@ -707,4 +725,6 @@ type Content struct {
ServicePackages []FServicePackage `json:"service_packages,omitempty" yaml:"service_packages,omitempty"`

Vaults []FVault `json:"vaults,omitempty" yaml:"vaults,omitempty"`

Licenses []FLicense `json:"licenses,omitempty" yaml:"licenses,omitempty"`
}
24 changes: 24 additions & 0 deletions file/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/hexops/gotextdiff v1.0.3
github.com/imdario/mergo v0.3.15
github.com/kong/go-kong v0.39.0
github.com/kong/go-kong v0.40.0
github.com/mitchellh/go-homedir v1.1.0
github.com/shirou/gopsutil/v3 v3.23.3
github.com/spf13/cobra v1.7.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kong/go-kong v0.39.0 h1:fAtZXpM7RVYukBu7Mu6RvRpklZOfXBXUs06NlDY5yXg=
github.com/kong/go-kong v0.39.0/go.mod h1:QHn1QBxwbtGBR+F2S5y49m/fEMmYeYAHeNCP+iGGBBk=
github.com/kong/go-kong v0.40.0 h1:6rd70L4GbPz90j3ey+wjHd4aC21uFgbqsoASJhbcbdU=
github.com/kong/go-kong v0.40.0/go.mod h1:t3siZEEGBB3FA5EQv9CL5EcaiogPTG0A175VQ6KvEHE=
github.com/kong/semver/v4 v4.0.1 h1:DIcNR8W3gfx0KabFBADPalxxsp+q/5COwIFkkhrFQ2Y=
github.com/kong/semver/v4 v4.0.1/go.mod h1:LImQ0oT15pJvSns/hs2laLca2zcYoHu5EsSNY0J6/QA=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
Expand Down

0 comments on commit 0dd4961

Please sign in to comment.