From 44d296abf1d419896564aa20bc5f69f83deeb1c5 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 26 Mar 2024 11:03:10 +0545 Subject: [PATCH 1/3] refactor: use the new configQuery * removed v1/Config. Wasn't being used [skip ci] --- api/v1/system_types.go | 34 +-------------------------------- api/v1/zz_generated.deepcopy.go | 27 -------------------------- go.mod | 2 +- go.sum | 2 -- hack/generate-schemas/go.mod | 10 +++++----- hack/generate-schemas/go.sum | 25 ++++++++++++------------ 6 files changed, 20 insertions(+), 80 deletions(-) diff --git a/api/v1/system_types.go b/api/v1/system_types.go index 826ab652b..c5bd26930 100644 --- a/api/v1/system_types.go +++ b/api/v1/system_types.go @@ -19,6 +19,7 @@ type Topology struct { Spec TopologySpec `json:"spec,omitempty"` Status TopologyStatus `json:"status,omitempty"` } + type TopologySpec struct { Type string `json:"type,omitempty"` Id *Template `json:"id,omitempty"` //nolint @@ -91,39 +92,6 @@ func (c ComponentCheck) Hash() string { return h } -type Config struct { - ID []string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Tags map[string]string `json:"tags,omitempty"` -} - -func (c Config) ToDuty() types.ConfigQuery { - return types.ConfigQuery{ - ID: c.ID, - Type: c.Type, - Name: c.Name, - Namespace: c.Namespace, - Tags: c.Tags, - } -} - -func (c Config) String() string { - s := c.Type - if c.Namespace != "" { - s += "/" + c.Namespace - } - - if c.Name != "" { - s += "/" + c.Name - } - if len(c.Tags) > 0 { - s += " " + fmt.Sprintf("%v", c.Tags) - } - return s -} - // +kubebuilder:object:root=true // TopologyList contains a list of Topology diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 2e79c2f43..99541c1c6 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1222,33 +1222,6 @@ func (in *Condition) DeepCopy() *Condition { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Config) DeepCopyInto(out *Config) { - *out = *in - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. -func (in *Config) DeepCopy() *Config { - if in == nil { - return nil - } - out := new(Config) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConfigDB) DeepCopyInto(out *ConfigDB) { *out = *in diff --git a/go.mod b/go.mod index 5824b4641..70c8e76ed 100644 --- a/go.mod +++ b/go.mod @@ -308,4 +308,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -// replace github.com/flanksource/duty => ../duty +replace github.com/flanksource/duty => ../duty diff --git a/go.sum b/go.sum index 5dd74924a..e67cb3140 100644 --- a/go.sum +++ b/go.sum @@ -848,8 +848,6 @@ github.com/flanksource/artifacts v1.0.4 h1:KjQTwsvQ73uHqTK7o4Jwt/RW8fyxJOTJ6JLgz github.com/flanksource/artifacts v1.0.4/go.mod h1:wkbdseaTkDo4Q6k6T86vXd4Uy47M6NPCmexgHvCTDl0= github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw= github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY= -github.com/flanksource/duty v1.0.391 h1:Ko5KmFNK6hfW6DaqkRvUKY38HG//1JTs+DfZd5A9WMA= -github.com/flanksource/duty v1.0.391/go.mod h1:+cOqyE1wgw+k3CT4O30ZHcH9u5EAtaXQR0W6zuVQRCc= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index 1bd7dbb40..87bf16eb7 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -67,7 +67,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/cel-go v0.18.2 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect @@ -94,7 +94,7 @@ require ( github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect - github.com/jackc/pgx/v5 v5.5.4 // indirect + github.com/jackc/pgx/v5 v5.5.5 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jeremywohl/flatten v0.0.0-20180923035001-588fe0d4c603 // indirect github.com/jinzhu/inflection v1.0.0 // indirect @@ -188,11 +188,11 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect gorm.io/driver/postgres v1.5.4 // indirect gorm.io/gorm v1.25.5 // indirect - k8s.io/api v0.28.4 // indirect + k8s.io/api v0.28.8 // indirect k8s.io/apiextensions-apiserver v0.28.3 // indirect - k8s.io/apimachinery v0.28.4 // indirect + k8s.io/apimachinery v0.28.8 // indirect k8s.io/cli-runtime v0.28.2 // indirect - k8s.io/client-go v0.28.4 // indirect + k8s.io/client-go v0.28.8 // indirect k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index 45eb2a1ac..4a4e0429b 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -835,8 +835,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -982,8 +983,8 @@ github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= -github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8= -github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jeremywohl/flatten v0.0.0-20180923035001-588fe0d4c603 h1:gSech9iGLFCosfl/DC7BWnpSSh/tQClWnKS2I2vdPww= @@ -1101,7 +1102,7 @@ github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47 github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= -github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= +github.com/onsi/ginkgo/v2 v2.17.0 h1:kdnunFXpBjbzN56hcJHrXZ8M+LOkenKA7NnBzTNigTI= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -1111,7 +1112,7 @@ github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeR github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -1653,7 +1654,7 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1992,18 +1993,18 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= k8s.io/api v0.26.4/go.mod h1:WwKEXU3R1rgCZ77AYa7DFksd9/BAIKyOmRlbVxgvjCk= -k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= -k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= +k8s.io/api v0.28.8 h1:G0/G7yX1puRAcon/+XPLsKXZ9A5L7Ds6oKbDIe027xw= +k8s.io/api v0.28.8/go.mod h1:rU8f1t9CNUAXlk/1j/wMJ7XnaxkR1g1AlZGQAOOL+sw= k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apimachinery v0.26.4/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= -k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= +k8s.io/apimachinery v0.28.8 h1:hi/nrxHwk4QLV+W/SHve1bypTE59HCDorLY1stBIxKQ= +k8s.io/apimachinery v0.28.8/go.mod h1:cBnwIM3fXoRo28SqbV/Ihxf/iviw85KyXOrzxvZQ83U= k8s.io/cli-runtime v0.28.2 h1:64meB2fDj10/ThIMEJLO29a1oujSm0GQmKzh1RtA/uk= k8s.io/cli-runtime v0.28.2/go.mod h1:bTpGOvpdsPtDKoyfG4EG041WIyFZLV9qq4rPlkyYfDA= -k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= -k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= +k8s.io/client-go v0.28.8 h1:TE59Tjd87WKvS2FPBTfIKLFX0nQJ4SSHsnDo5IHjgOw= +k8s.io/client-go v0.28.8/go.mod h1:uDVQ/rPzWpWIy40c6lZ4mUwaEvRWGnpoqSO4FM65P3o= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From b2b30da91c5d651f7a226e1b257a2bc356958b41 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 26 Mar 2024 11:47:49 +0545 Subject: [PATCH 2/3] chore: bump duty --- go.mod | 4 ++-- go.sum | 2 ++ hack/generate-schemas/go.mod | 2 +- hack/generate-schemas/go.sum | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 70c8e76ed..ac87f1b3e 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/fergusstrange/embedded-postgres v1.25.0 github.com/flanksource/artifacts v1.0.4 github.com/flanksource/commons v1.22.1 - github.com/flanksource/duty v1.0.391 + github.com/flanksource/duty v1.0.398 github.com/flanksource/gomplate/v3 v3.24.2 github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7 github.com/flanksource/kommons v0.31.4 @@ -308,4 +308,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace github.com/flanksource/duty => ../duty +// replace github.com/flanksource/duty => ../duty diff --git a/go.sum b/go.sum index e67cb3140..ef839997b 100644 --- a/go.sum +++ b/go.sum @@ -848,6 +848,8 @@ github.com/flanksource/artifacts v1.0.4 h1:KjQTwsvQ73uHqTK7o4Jwt/RW8fyxJOTJ6JLgz github.com/flanksource/artifacts v1.0.4/go.mod h1:wkbdseaTkDo4Q6k6T86vXd4Uy47M6NPCmexgHvCTDl0= github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw= github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY= +github.com/flanksource/duty v1.0.398 h1:z0Q4/40+mOxK6P5hSrQD0LJuMXvDdZ0SLx7k0yITNDU= +github.com/flanksource/duty v1.0.398/go.mod h1:qQm7wt7TlqV6TFn+PU98bQIYCCau5/3baepXGTQRtV4= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index 87bf16eb7..62f7b04bc 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -50,7 +50,7 @@ require ( github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/exaring/otelpgx v0.5.2 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/flanksource/duty v1.0.391 // indirect + github.com/flanksource/duty v1.0.398 // indirect github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7 // indirect github.com/flanksource/kommons v0.31.4 // indirect github.com/flanksource/kubectl-neat v1.0.4 // indirect diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index 4a4e0429b..c0bb50dc9 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -730,8 +730,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw= github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY= -github.com/flanksource/duty v1.0.391 h1:Ko5KmFNK6hfW6DaqkRvUKY38HG//1JTs+DfZd5A9WMA= -github.com/flanksource/duty v1.0.391/go.mod h1:+cOqyE1wgw+k3CT4O30ZHcH9u5EAtaXQR0W6zuVQRCc= +github.com/flanksource/duty v1.0.398 h1:z0Q4/40+mOxK6P5hSrQD0LJuMXvDdZ0SLx7k0yITNDU= +github.com/flanksource/duty v1.0.398/go.mod h1:qQm7wt7TlqV6TFn+PU98bQIYCCau5/3baepXGTQRtV4= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= From 904f78170a4fd7ed6020fb5073dfbdd2961063fc Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 26 Mar 2024 11:57:07 +0545 Subject: [PATCH 3/3] chore: make gen, make resources, make manifests --- config/deploy/crd.yaml | 192 ++++++++++++++++++++++++--- config/deploy/manifests.yaml | 192 ++++++++++++++++++++++++--- config/schemas/component.schema.json | 39 ++++-- config/schemas/topology.schema.json | 39 ++++-- 4 files changed, 408 insertions(+), 54 deletions(-) diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index 2a606ed70..ad3367f53 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -7219,24 +7219,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array forEach: @@ -7318,24 +7344,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value @@ -7607,24 +7659,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array forEach: @@ -7706,24 +7784,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value @@ -7898,24 +8002,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array icon: @@ -7949,24 +8079,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index b3fc98ad9..27deae355 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -7487,24 +7487,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array forEach: @@ -7586,24 +7612,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value @@ -7875,24 +7927,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array forEach: @@ -7974,24 +8052,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value @@ -8166,24 +8270,50 @@ spec: ConfigQuery is used to look up and associate config items with a component. properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object type: array icon: @@ -8217,24 +8347,50 @@ spec: config: description: Lookup a config by it properties: + agent: + description: |- + Agent can be the agent id or the name of the agent. + Additionally, the special "self" value can be used to select resources without an agent. + type: string + cache: + description: |- + Cache directives + 'no-cache' (should not fetch from cache but can be cached) + 'no-store' (should not cache) + 'max-age=X' (cache for X duration) + type: string class: + description: Deprecated. Use `fieldSelector (config_class=)` type: string external_id: + description: Deprecated. Use `fieldSelector (external_id=)` + type: string + fieldSelector: type: string id: - items: - type: string - type: array + type: string + labelSelector: + type: string name: type: string namespace: type: string + statuses: + items: + type: string + type: array tags: additionalProperties: type: string + description: Deprecated. Use `labelSelector` type: object type: + description: Deprecated. Use `types` type: string + types: + items: + type: string + type: array type: object display: description: Apply transformations to the value diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index 1f7294b11..7a2801fdb 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -1113,19 +1113,13 @@ }, "ConfigQuery": { "properties": { - "id": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { + "agent": { "type": "string" }, - "class": { + "cache": { "type": "string" }, - "external_id": { + "id": { "type": "string" }, "name": { @@ -1134,6 +1128,24 @@ "namespace": { "type": "string" }, + "types": { + "$ref": "#/$defs/Items" + }, + "statuses": { + "$ref": "#/$defs/Items" + }, + "labelSelector": { + "type": "string" + }, + "fieldSelector": { + "type": "string" + }, + "class": { + "type": "string" + }, + "external_id": { + "type": "string" + }, "tags": { "patternProperties": { ".*": { @@ -1141,6 +1153,9 @@ } }, "type": "object" + }, + "type": { + "type": "string" } }, "additionalProperties": false, @@ -2299,6 +2314,12 @@ "name" ] }, + "Items": { + "items": { + "type": "string" + }, + "type": "array" + }, "JSONCheck": { "properties": { "path": { diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index fb16df2d3..f1d5af72c 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -1083,19 +1083,13 @@ }, "ConfigQuery": { "properties": { - "id": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { + "agent": { "type": "string" }, - "class": { + "cache": { "type": "string" }, - "external_id": { + "id": { "type": "string" }, "name": { @@ -1104,6 +1098,24 @@ "namespace": { "type": "string" }, + "types": { + "$ref": "#/$defs/Items" + }, + "statuses": { + "$ref": "#/$defs/Items" + }, + "labelSelector": { + "type": "string" + }, + "fieldSelector": { + "type": "string" + }, + "class": { + "type": "string" + }, + "external_id": { + "type": "string" + }, "tags": { "patternProperties": { ".*": { @@ -1111,6 +1123,9 @@ } }, "type": "object" + }, + "type": { + "type": "string" } }, "additionalProperties": false, @@ -2269,6 +2284,12 @@ "name" ] }, + "Items": { + "items": { + "type": "string" + }, + "type": "array" + }, "JSONCheck": { "properties": { "path": {