Skip to content

Commit

Permalink
Add Resource Tags (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
spjmurray authored Nov 27, 2024
1 parent 7ccbe68 commit 65949d7
Show file tree
Hide file tree
Showing 15 changed files with 251 additions and 413 deletions.
4 changes: 2 additions & 2 deletions charts/region/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's Region Controller

type: application

version: v0.1.45
appVersion: v0.1.45
version: v0.1.46
appVersion: v0.1.46

icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png

Expand Down
16 changes: 16 additions & 0 deletions charts/region/crds/region.unikorn-cloud.org_quotas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ spec:
x-kubernetes-list-map-keys:
- id
x-kubernetes-list-type: map
tags:
description: Tags are aribrary user data.
items:
description: Tag is an arbirary key/value.
properties:
name:
description: Name of the tag.
type: string
value:
description: Value of the tag.
type: string
required:
- name
- value
type: object
type: array
type: object
status:
type: object
Expand Down
16 changes: 16 additions & 0 deletions charts/region/crds/region.unikorn-cloud.org_regions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ spec:
enum:
- openstack
type: string
tags:
description: Tags are aribrary user data.
items:
description: Tag is an arbirary key/value.
properties:
name:
description: Name of the tag.
type: string
value:
description: Value of the tag.
type: string
required:
- name
- value
type: object
type: array
required:
- provider
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ spec:
- tcp
- udp
type: string
tags:
description: Tags are aribrary user data.
items:
description: Tag is an arbirary key/value.
properties:
name:
description: Name of the tag.
type: string
value:
description: Value of the tag.
type: string
required:
- name
- value
type: object
type: array
required:
- cidr
- direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spec:
description: |-
Tags are an abitrary list of key/value pairs that a client
may populate to store metadata for the resource.
Tags are aribrary user data.
items:
description: Tag is an arbirary key/value.
properties:
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ require (
github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56
github.com/oapi-codegen/runtime v1.1.1
github.com/spf13/pflag v1.0.5
github.com/unikorn-cloud/core v0.1.76
github.com/unikorn-cloud/identity v0.2.44
github.com/unikorn-cloud/core v0.1.85
github.com/unikorn-cloud/identity v0.2.45
go.opentelemetry.io/otel v1.31.0
go.opentelemetry.io/otel/sdk v1.31.0
go.opentelemetry.io/otel/trace v1.31.0
Expand All @@ -23,6 +23,7 @@ require (
)

require (
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
Expand Down Expand Up @@ -57,7 +58,6 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/masterminds/semver v1.5.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
Expand Down Expand Up @@ -101,8 +101,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/masterminds/semver v1.5.0 h1:hTxJTTY7tjvnWMrl08O6u3G6BLlKVwxSz01lVac9P8U=
github.com/masterminds/semver v1.5.0/go.mod h1:s7KNT9fnd7edGzwwP7RBX4H0v/CYd5qdOLfkL1V75yg=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -146,10 +144,10 @@ 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/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/unikorn-cloud/core v0.1.76 h1:h9TsNTYimmu7N23RB3J7PLKp+ekJF7vM9AF1yMuVgIo=
github.com/unikorn-cloud/core v0.1.76/go.mod h1:S9AF4PwTQljImb9w0P2jKjzRe8fLM+rx+ZbxrAHw/yE=
github.com/unikorn-cloud/identity v0.2.44 h1:tXV/qsJ77Dkx8ba8gnBFXHWUgBNsJ2oo/5TjnyhkH7U=
github.com/unikorn-cloud/identity v0.2.44/go.mod h1:JMbS6iTYzt0OVt5AkqZys3WVnpLabGvUl8kGWcxzFZI=
github.com/unikorn-cloud/core v0.1.85 h1:S4B0nr0jhxF8SCsKyCRVwcx8+kJsI8fQVONLJDf9aic=
github.com/unikorn-cloud/core v0.1.85/go.mod h1:wEKzCwAnIyTbo27l++Wl+gK95TAxMsFS3y3jbFB03aw=
github.com/unikorn-cloud/identity v0.2.45 h1:YFmw3uunwdZMuYiimv4lfU6s7iTtYoc22xJqLTrlOVg=
github.com/unikorn-cloud/identity v0.2.45/go.mod h1:WzNNv05ReDMLfWsOtq53uzhX2GU2nXDw76Bdsf3BPnM=
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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
26 changes: 11 additions & 15 deletions pkg/apis/unikorn/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type Region struct {

// RegionSpec defines metadata about the region.
type RegionSpec struct {
// Tags are aribrary user data.
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Type defines the provider type.
Provider Provider `json:"provider"`
// Openstack is provider specific configuration for the region.
Expand Down Expand Up @@ -255,17 +257,6 @@ type RegionStatus struct {
Conditions []unikornv1core.Condition `json:"conditions,omitempty"`
}

// Tag is an arbirary key/value.
type Tag struct {
// Name of the tag.
Name string `json:"name"`
// Value of the tag.
Value string `json:"value"`
}

// TagList is an ordered list of tags.
type TagList []Tag

// IdentityList is a typed list of identities.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IdentityList struct {
Expand Down Expand Up @@ -300,7 +291,7 @@ type IdentitySpec struct {
Pause bool `json:"pause,omitempty"`
// Tags are an abitrary list of key/value pairs that a client
// may populate to store metadata for the resource.
Tags TagList `json:"tags,omitempty"`
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Provider defines the provider type.
Provider Provider `json:"provider"`
}
Expand Down Expand Up @@ -383,7 +374,7 @@ type NetworkSpec struct {
Pause bool `json:"pause,omitempty"`
// Tags are an abitrary list of key/value pairs that a client
// may populate to store metadata for the resource.
Tags TagList `json:"tags,omitempty"`
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Provider defines the provider type.
Provider Provider `json:"provider"`
// Prefix is the IPv4 address prefix.
Expand Down Expand Up @@ -499,6 +490,8 @@ type Quota struct {
}

type QuotaSpec struct {
// Tags are aribrary user data.
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Flavors is a list of flavors and their count.
// +listType=map
// +listMapKey=id
Expand Down Expand Up @@ -545,7 +538,8 @@ type SecurityGroupSpec struct {
Pause bool `json:"pause,omitempty"`
// Tags are an abitrary list of key/value pairs that a client
// may populate to store metadata for the resource.
Tags TagList `json:"tags,omitempty"`
// Tags are aribrary user data.
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Provider defines the provider type.
Provider Provider `json:"provider"`
}
Expand Down Expand Up @@ -608,6 +602,8 @@ type SecurityGroupRule struct {
type SecurityGroupRuleSpec struct {
// Pause, if true, will inhibit reconciliation.
Pause bool `json:"pause,omitempty"`
// Tags are aribrary user data.
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Direction is the direction of the rule.
Direction *SecurityGroupRuleDirection `json:"direction"`
// Protocol is the protocol of the rule.
Expand Down Expand Up @@ -710,7 +706,7 @@ type ServerSpec struct {
Pause bool `json:"pause,omitempty"`
// Tags are an abitrary list of key/value pairs that a client
// may populate to store metadata for the resource.
Tags TagList `json:"tags,omitempty"`
Tags unikornv1core.TagList `json:"tags,omitempty"`
// Provider defines the provider type.
Provider Provider `json:"provider"`
// FlavorID is the flavor ID.
Expand Down
59 changes: 19 additions & 40 deletions pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 65949d7

Please sign in to comment.