diff --git a/go.mod b/go.mod index ecf75b6e0..6041897ca 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( gomodules.xyz/go-sh v0.1.0 gomodules.xyz/pointer v0.1.0 gomodules.xyz/runtime v0.2.0 - gomodules.xyz/x v0.0.13 + gomodules.xyz/x v0.0.14 k8s.io/api v0.21.1 k8s.io/apiextensions-apiserver v0.21.1 k8s.io/apimachinery v0.21.1 @@ -22,11 +22,11 @@ require ( k8s.io/klog/v2 v2.9.0 k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 k8s.io/kubernetes v1.21.1 - kmodules.xyz/client-go v0.0.0-20220404224906-af7b092cfac5 + kmodules.xyz/client-go v0.0.0-20220427165208-36281a681909 kmodules.xyz/crd-schema-fuzz v0.0.0-20211025154117-6edb24ef11bc - kmodules.xyz/custom-resources v0.0.0-20220317220154-7beb809b1f5e + kmodules.xyz/custom-resources v0.0.0-20220422215041-237eae1d7ddd kmodules.xyz/objectstore-api v0.0.0-20220317220441-f1d593d0a778 - kmodules.xyz/offshoot-api v0.0.0-20220419215722-c7fc995091d3 + kmodules.xyz/offshoot-api v0.0.0-20220420055916-fefb02c26514 kmodules.xyz/prober v0.0.0-20220317043828-5ae0114adcad sigs.k8s.io/controller-runtime v0.9.0 sigs.k8s.io/yaml v1.3.0 diff --git a/go.sum b/go.sum index e4d89284a..8d803061a 100644 --- a/go.sum +++ b/go.sum @@ -983,8 +983,8 @@ gomodules.xyz/stow v0.2.4/go.mod h1:aAgUEHyZ+4nKznyVupMMkP0JX9MXW1ZRrbRGaclp3E0= gomodules.xyz/x v0.0.5/go.mod h1:EGy7cB7ifSuOcbNFc0U1zUPTf5yY8RtXVJlAlhGS9OE= gomodules.xyz/x v0.0.8/go.mod h1:YnL5CAnLrEtAV/NQGn5sKJe6u08/vDlRyJddXIuD9mc= gomodules.xyz/x v0.0.10/go.mod h1:AgHPywNbRKtogAdk08vCqsfwjtXtXX1/FUPyG7OWdOs= -gomodules.xyz/x v0.0.13 h1:k4ABA8dVGUTxqiNYOHPAs5sZbmgLxYcL9WuBT/kDOiM= -gomodules.xyz/x v0.0.13/go.mod h1:AgHPywNbRKtogAdk08vCqsfwjtXtXX1/FUPyG7OWdOs= +gomodules.xyz/x v0.0.14 h1:eD1+3YjTEt46dhErbuPEr1Vw+7xbFBNx6T26E7nCRwM= +gomodules.xyz/x v0.0.14/go.mod h1:AgHPywNbRKtogAdk08vCqsfwjtXtXX1/FUPyG7OWdOs= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1100,19 +1100,19 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= kmodules.xyz/client-go v0.0.0-20210617233340-13d22e91512b/go.mod h1:A6GAK6xP5zBuWK6A/vUkkjKzcuywkms7fIxRf5wblO4= kmodules.xyz/client-go v0.0.0-20220215012708-9963581d69a7/go.mod h1:sOq5P3AkZdv6D/skvUPwEG15NDYy5olwBllH/JXfhGI= -kmodules.xyz/client-go v0.0.0-20220404224906-af7b092cfac5 h1:UkXLQ5SMS98RwnJffKAU0ANXVq9AHSLabQ9NKUhkCgA= -kmodules.xyz/client-go v0.0.0-20220404224906-af7b092cfac5/go.mod h1:7pExIHGzUdu8ZGveYvAaXEhS4GdczoOy8z+hq6x6K9A= +kmodules.xyz/client-go v0.0.0-20220427165208-36281a681909 h1:c/7SJgQbmEzPdziKnx5uC7EtkTmbbyLBz7gQGfVGvSg= +kmodules.xyz/client-go v0.0.0-20220427165208-36281a681909/go.mod h1:7pExIHGzUdu8ZGveYvAaXEhS4GdczoOy8z+hq6x6K9A= kmodules.xyz/constants v0.0.0-20210218100002-2c304bfda278/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY= kmodules.xyz/crd-schema-fuzz v0.0.0-20210618002152-fae23aef5fb4/go.mod h1:IIkUctlfoptoci0BOrsUf8ya+MOG5uaeh1PE4uzaIbA= kmodules.xyz/crd-schema-fuzz v0.0.0-20211025154117-6edb24ef11bc h1:ot/XqJCnfQXF3jawygywjPNNDbjo3d/QiG6Aoz2yjaA= kmodules.xyz/crd-schema-fuzz v0.0.0-20211025154117-6edb24ef11bc/go.mod h1:yLOBJKasPhnCodKSZGFZ6OGFFrp0tq3ALS9rDnYFjkg= -kmodules.xyz/custom-resources v0.0.0-20220317220154-7beb809b1f5e h1:JpfwsPxcNXSDfyErTikfQOwr/RmQsHLm1/3NfUElsys= -kmodules.xyz/custom-resources v0.0.0-20220317220154-7beb809b1f5e/go.mod h1:OCLmlMhRowPtBPP1bu4xreNLj8/TYu/4lY477+eAzUM= +kmodules.xyz/custom-resources v0.0.0-20220422215041-237eae1d7ddd h1:Y5w0ZxHMSPUnzjAlVKXS6+ED/wXlxXyWVYckarkiBBA= +kmodules.xyz/custom-resources v0.0.0-20220422215041-237eae1d7ddd/go.mod h1:OCLmlMhRowPtBPP1bu4xreNLj8/TYu/4lY477+eAzUM= kmodules.xyz/objectstore-api v0.0.0-20220317220441-f1d593d0a778 h1:1biCLf6zjBzg9YI9xDjrH6RrKtizpKVB7iuo/5NWOo0= kmodules.xyz/objectstore-api v0.0.0-20220317220441-f1d593d0a778/go.mod h1:rJ3QmHvS0CCJAhhdbXh+O2nlEY5gEmgYdpo3vA4nAm4= kmodules.xyz/offshoot-api v0.0.0-20210829122105-6f4d481b0c61/go.mod h1:3LECbAL3FgbyK80NP3V3Pmiuo/a3hFWg/PR6SPFhTns= -kmodules.xyz/offshoot-api v0.0.0-20220419215722-c7fc995091d3 h1:jgOE/YqNIIMzh+4hXGgqvnx5JQKI4+WyfK2AAPL+1S4= -kmodules.xyz/offshoot-api v0.0.0-20220419215722-c7fc995091d3/go.mod h1:9i9RrFY0BtU9jSm70nxhWlLdl9TSZ8pxTnfyPUicq90= +kmodules.xyz/offshoot-api v0.0.0-20220420055916-fefb02c26514 h1:jE5GLkMfu/+ZkzVanE7zZ2z3b2w4Bg5VI87JnIyNGPk= +kmodules.xyz/offshoot-api v0.0.0-20220420055916-fefb02c26514/go.mod h1:9i9RrFY0BtU9jSm70nxhWlLdl9TSZ8pxTnfyPUicq90= kmodules.xyz/prober v0.0.0-20220317043828-5ae0114adcad h1:bMfimFOEgmaKCN/gnSxLIRvQbWg4dqBgcWrMnHWQgyc= kmodules.xyz/prober v0.0.0-20220317043828-5ae0114adcad/go.mod h1:QC3O1p+sU/8NnpLKI0VCAO3IQwPlwuimf9l6+Qp3Vt8= kmodules.xyz/resource-metrics v0.0.8/go.mod h1:M7rWuo2qh3BpHhogiEVPnvGY9Xx4Pfygqn1Rex8YbgM= diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index 6d780305e..e2ab73f60 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -71,6 +71,10 @@ func EnsureContainerDeleted(containers []core.Container, name string) []core.Con func UpsertContainer(containers []core.Container, upsert core.Container) []core.Container { for i, container := range containers { if container.Name == upsert.Name { + // can't be updated. So, keep existing values. usually not set in upsert. + upsert.TerminationMessagePath = container.TerminationMessagePath + upsert.TerminationMessagePolicy = container.TerminationMessagePolicy + err := mergo.Merge(&container, upsert, mergo.WithOverride) if err != nil { panic(err) diff --git a/vendor/kmodules.xyz/client-go/meta/incluster.go b/vendor/kmodules.xyz/client-go/meta/incluster.go index f5df04dd5..7bb753555 100644 --- a/vendor/kmodules.xyz/client-go/meta/incluster.go +++ b/vendor/kmodules.xyz/client-go/meta/incluster.go @@ -31,11 +31,15 @@ import ( "k8s.io/client-go/rest" ) -func Namespace() string { - if ns := os.Getenv("KUBE_NAMESPACE"); ns != "" { - return ns +func PodName() string { + if name := os.Getenv("POD_NAME"); name != "" { + return name } + s, _ := os.Hostname() + return s +} +func PodNamespace() string { if ns := os.Getenv("POD_NAMESPACE"); ns != "" { return ns } @@ -48,6 +52,14 @@ func Namespace() string { return core.NamespaceDefault } +// Deprecated: use PodNamespace +func Namespace() string { + if ns := os.Getenv("KUBE_NAMESPACE"); ns != "" { + return ns + } + return PodNamespace() +} + // PossiblyInCluster returns true if loading an inside-kubernetes-cluster is possible. // ref: https://github.com/kubernetes/kubernetes/blob/v1.18.3/staging/src/k8s.io/client-go/tools/clientcmd/client_config.go#L537 func PossiblyInCluster() bool { diff --git a/vendor/kmodules.xyz/custom-resources/apis/auditor/v1alpha1/siteinfo_types.go b/vendor/kmodules.xyz/custom-resources/apis/auditor/v1alpha1/siteinfo_types.go index f8612fc61..d81ea726b 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/auditor/v1alpha1/siteinfo_types.go +++ b/vendor/kmodules.xyz/custom-resources/apis/auditor/v1alpha1/siteinfo_types.go @@ -108,6 +108,6 @@ type NodeStats struct { // SiteInfoList is a list of SiteInfo type SiteInfoList struct { metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []SiteInfo `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SiteInfo `json:"items,omitempty"` } diff --git a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.pb.go b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.pb.go index 12160a2f1..36b1c56bf 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.pb.go +++ b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.pb.go @@ -369,65 +369,67 @@ func init() { } var fileDescriptor_ef11ad1bbe6c7f42 = []byte{ - // 926 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xf6, 0xc4, 0x3f, 0xb1, 0xcb, 0x84, 0x9f, 0x0e, 0x48, 0x43, 0x10, 0x4e, 0x64, 0x2e, 0x7b, - 0x20, 0x3d, 0x24, 0x20, 0x84, 0x00, 0xa1, 0xc5, 0x2b, 0x56, 0x44, 0x49, 0x20, 0xea, 0x5d, 0x59, - 0x08, 0x21, 0x96, 0xf6, 0xb8, 0x3d, 0x1e, 0xec, 0xf9, 0xd1, 0x74, 0x3b, 0xac, 0x11, 0x87, 0x7d, - 0x04, 0xde, 0x80, 0xf7, 0xe0, 0x09, 0x72, 0xdc, 0xe3, 0x9e, 0x22, 0x62, 0x2e, 0x70, 0x87, 0x0b, - 0x27, 0xd4, 0x35, 0x3d, 0x3f, 0x89, 0x37, 0x02, 0x39, 0x88, 0xbd, 0x4d, 0x57, 0x7d, 0xf5, 0x7d, - 0x55, 0xd3, 0x55, 0xd5, 0x70, 0x67, 0x12, 0x44, 0xc3, 0xd9, 0x54, 0x48, 0xfa, 0x70, 0xfe, 0xbd, - 0xe3, 0xce, 0xa4, 0x8a, 0x82, 0xdd, 0x44, 0xc8, 0x68, 0x96, 0xb8, 0x42, 0x3a, 0x3c, 0xf6, 0xa5, - 0x13, 0x08, 0x95, 0xf8, 0xae, 0x74, 0x4e, 0xf7, 0xf8, 0x34, 0x1e, 0xf3, 0x3d, 0xc7, 0x13, 0xa1, - 0x48, 0xb8, 0x12, 0x43, 0x1a, 0x27, 0x91, 0x8a, 0xc8, 0xdb, 0x65, 0x12, 0x9a, 0x92, 0x3c, 0xc8, - 0x49, 0x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, 0x3a, 0x5b, 0x74, 0xac, 0xc7, 0x8b, 0x8e, - 0xf5, 0x64, 0xd1, 0xb1, 0x7e, 0x59, 0x74, 0xac, 0x1f, 0x7f, 0xed, 0x54, 0xbe, 0x6c, 0x66, 0x05, - 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x24, 0xf5, 0x4e, 0xc1, 0x98, 0x0a, 0x00, 0x00, + // 952 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcb, 0x6e, 0x23, 0x45, + 0x14, 0x75, 0xc7, 0x8f, 0xd8, 0xd7, 0x09, 0x8f, 0xca, 0x20, 0x35, 0x41, 0x74, 0x22, 0xb3, 0x99, + 0x05, 0xe9, 0x26, 0x01, 0x21, 0x04, 0x08, 0x0d, 0x8e, 0x18, 0x11, 0x25, 0x81, 0xa8, 0x66, 0x64, + 0x21, 0x84, 0x18, 0xca, 0xed, 0x72, 0xbb, 0xb1, 0xfb, 0xa1, 0xae, 0x72, 0x18, 0x23, 0x16, 0xf3, + 0x09, 0xfc, 0x01, 0xff, 0xc1, 0x17, 0x64, 0x39, 0xcb, 0x59, 0x45, 0xc4, 0x6c, 0x80, 0x3d, 0x1b, + 0x56, 0xa8, 0x6e, 0x57, 0x3f, 0x62, 0x07, 0x81, 0x1c, 0x04, 0xbb, 0xae, 0xba, 0xe7, 0x9e, 0x73, + 0x6e, 0xd7, 0xad, 0x5b, 0x70, 0x38, 0x0e, 0xa2, 0xc1, 0x74, 0xc2, 0x85, 0xfd, 0x78, 0xf6, 0xad, + 0xe3, 0x4e, 0x85, 0x8c, 0x82, 0xbd, 0x84, 0x8b, 0x68, 0x9a, 0xb8, 0x5c, 0x38, 0x2c, 0xf6, 0x85, + 0x13, 0x70, 0x99, 0xf8, 0xae, 0x70, 0xce, 0xf7, 0xd9, 0x24, 0x1e, 0xb1, 0x7d, 0xc7, 0xe3, 0x21, + 0x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0, 0xc1, 0x5f, 0x70, 0xfe, 0xe1, + 0xd9, 0x91, 0x8e, 0xd0, 0x12, 0x4a, 0x3d, 0xc7, 0x63, 0x3f, 0x1c, 0x2c, 0x3e, 0xd8, 0xc7, 0x7e, + 0x38, 0xa0, 0x18, 0xe9, 0xda, 0x17, 0x57, 0x56, 0xe5, 0xe9, 0x95, 0x55, 0x79, 0x76, 0x65, 0x55, + 0x9e, 0xcc, 0x2d, 0xe3, 0x62, 0x6e, 0x19, 0x4f, 0xe7, 0x96, 0xf1, 0x6c, 0x6e, 0x19, 0x3f, 0xcd, + 0x2d, 0xe3, 0xfb, 0x9f, 0xad, 0xca, 0xe7, 0xcd, 0xac, 0x80, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0xdd, 0x3f, 0x9c, 0xe6, 0x0e, 0x0b, 0x00, 0x00, } func (m *Field) Marshal() (dAtA []byte, err error) { @@ -759,6 +761,20 @@ func (m *MetricsConfigurationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + } + if len(m.CommonLabels) > 0 { + for iNdEx := len(m.CommonLabels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CommonLabels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 } } @@ -913,15 +929,15 @@ func (m *TargetRef) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - i -= len(m.APIVersion) - copy(dAtA[i:], m.APIVersion) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIVersion))) - i-- - dAtA[i] = 0x12 i -= len(m.Kind) copy(dAtA[i:], m.Kind) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) i-- + dAtA[i] = 0x12 + i -= len(m.APIVersion) + copy(dAtA[i:], m.APIVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIVersion))) + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1054,6 +1070,12 @@ func (m *MetricsConfigurationSpec) Size() (n int) { _ = l l = m.TargetRef.Size() n += 1 + l + sovGenerated(uint64(l)) + if len(m.CommonLabels) > 0 { + for _, e := range m.CommonLabels { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } if len(m.Metrics) > 0 { for _, e := range m.Metrics { l = e.Size() @@ -1114,10 +1136,10 @@ func (m *TargetRef) Size() (n int) { } var l int _ = l - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) l = len(m.APIVersion) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -1220,6 +1242,11 @@ func (this *MetricsConfigurationSpec) String() string { if this == nil { return "nil" } + repeatedStringForCommonLabels := "[]Label{" + for _, f := range this.CommonLabels { + repeatedStringForCommonLabels += strings.Replace(strings.Replace(f.String(), "Label", "Label", 1), `&`, ``, 1) + "," + } + repeatedStringForCommonLabels += "}" repeatedStringForMetrics := "[]Metrics{" for _, f := range this.Metrics { repeatedStringForMetrics += strings.Replace(strings.Replace(f.String(), "Metrics", "Metrics", 1), `&`, ``, 1) + "," @@ -1227,6 +1254,7 @@ func (this *MetricsConfigurationSpec) String() string { repeatedStringForMetrics += "}" s := strings.Join([]string{`&MetricsConfigurationSpec{`, `TargetRef:` + strings.Replace(strings.Replace(this.TargetRef.String(), "TargetRef", "TargetRef", 1), `&`, ``, 1) + `,`, + `CommonLabels:` + repeatedStringForCommonLabels + `,`, `Metrics:` + repeatedStringForMetrics + `,`, `}`, }, "") @@ -1276,8 +1304,8 @@ func (this *TargetRef) String() string { return "nil" } s := strings.Join([]string{`&TargetRef{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `APIVersion:` + fmt.Sprintf("%v", this.APIVersion) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `}`, }, "") return s @@ -2288,6 +2316,40 @@ func (m *MetricsConfigurationSpec) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommonLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommonLabels = append(m.CommonLabels, Label{}) + if err := m.CommonLabels[len(m.CommonLabels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) } @@ -2750,7 +2812,7 @@ func (m *TargetRef) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field APIVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2778,11 +2840,11 @@ func (m *TargetRef) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kind = string(dAtA[iNdEx:postIndex]) + m.APIVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2810,7 +2872,7 @@ func (m *TargetRef) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.APIVersion = string(dAtA[iNdEx:postIndex]) + m.Kind = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.proto b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.proto index 909d9fe1b..c6364b1c0 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.proto +++ b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/generated.proto @@ -226,8 +226,12 @@ message MetricsConfigurationSpec { // TargetRef defines the object for which metrics will be collected optional TargetRef targetRef = 1; + // CommonLabels defines the common labels added to all the exported metrics + // +optional + repeated Label commonLabels = 2; + // List of Metrics configuration for the resource object defined in TargetRef - repeated Metrics metrics = 2; + repeated Metrics metrics = 3; } // Parameter contains the information of a parameter used in expression evaluation @@ -293,11 +297,11 @@ message StateValues { // TargetRef contains the Object's apiVersion & kind to specify the target resource message TargetRef { + // APIVersion defines the versioned schema of this representation of an object. + optional string apiVersion = 1; + // Kind is a string value representing the REST resource this object represents. // In CamelCase. - optional string kind = 1; - - // APIVersion defines the versioned schema of this representation of an object. - optional string apiVersion = 2; + optional string kind = 2; } diff --git a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/metricsconfiguration_types.go b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/metricsconfiguration_types.go index 3557992e8..5ecee77a8 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/metricsconfiguration_types.go +++ b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/metricsconfiguration_types.go @@ -51,18 +51,22 @@ type MetricsConfigurationSpec struct { // TargetRef defines the object for which metrics will be collected TargetRef TargetRef `json:"targetRef" protobuf:"bytes,1,opt,name=targetRef"` + // CommonLabels defines the common labels added to all the exported metrics + // +optional + CommonLabels []Label `json:"commonLabels,omitempty" protobuf:"bytes,2,rep,name=commonLabels"` + // List of Metrics configuration for the resource object defined in TargetRef - Metrics []Metrics `json:"metrics" protobuf:"bytes,2,rep,name=metrics"` + Metrics []Metrics `json:"metrics" protobuf:"bytes,3,rep,name=metrics"` } // TargetRef contains the Object's apiVersion & kind to specify the target resource type TargetRef struct { + // APIVersion defines the versioned schema of this representation of an object. + APIVersion string `json:"apiVersion" protobuf:"bytes,1,opt,name=apiVersion"` + // Kind is a string value representing the REST resource this object represents. // In CamelCase. - Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` - - // APIVersion defines the versioned schema of this representation of an object. - APIVersion string `json:"apiVersion" protobuf:"bytes,2,opt,name=apiVersion"` + Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` } // Metrics contains the configuration of a metric in prometheus style. @@ -136,7 +140,7 @@ type Field struct { // "Array" for array field like .spec.containers // "String" for string field like .statue.phase (for pod status) // +kubebuilder:validation:Enum=Integer;DateTime;Array;String - Type FieldType `json:"type" protobuf:"bytes,2,opt,name=type"` + Type FieldType `json:"type" protobuf:"bytes,2,opt,name=type,casttype=FieldType"` } // Label contains the information of a metric label. @@ -261,7 +265,7 @@ type MetricValue struct { // As there must be a metric value, metric value is kept as 1. // The metric will look like `kube_pod_info{host_ip="172.18.0.2", pod_ip="10.244.0.14", node="kind-control-plane" .....} 1` // +optional - Value *float64 `json:"value,omitempty" protobuf:"bytes,1,opt,name=value"` + Value *float64 `json:"value,omitempty" protobuf:"fixed64,1,opt,name=value"` // ValueFromPath contains the field path of the manifest file of a object. // ValueFromPath is used when the metric value is coming from diff --git a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/openapi_generated.go index bb93a78c1..c74026606 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/openapi_generated.go @@ -16100,6 +16100,20 @@ func schema_custom_resources_apis_metrics_v1alpha1_MetricsConfigurationSpec(ref Ref: ref("kmodules.xyz/custom-resources/apis/metrics/v1alpha1.TargetRef"), }, }, + "commonLabels": { + SchemaProps: spec.SchemaProps{ + Description: "CommonLabels defines the common labels added to all the exported metrics", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/custom-resources/apis/metrics/v1alpha1.Label"), + }, + }, + }, + }, + }, "metrics": { SchemaProps: spec.SchemaProps{ Description: "List of Metrics configuration for the resource object defined in TargetRef", @@ -16119,7 +16133,7 @@ func schema_custom_resources_apis_metrics_v1alpha1_MetricsConfigurationSpec(ref }, }, Dependencies: []string{ - "kmodules.xyz/custom-resources/apis/metrics/v1alpha1.Metrics", "kmodules.xyz/custom-resources/apis/metrics/v1alpha1.TargetRef"}, + "kmodules.xyz/custom-resources/apis/metrics/v1alpha1.Label", "kmodules.xyz/custom-resources/apis/metrics/v1alpha1.Metrics", "kmodules.xyz/custom-resources/apis/metrics/v1alpha1.TargetRef"}, } } @@ -16235,24 +16249,24 @@ func schema_custom_resources_apis_metrics_v1alpha1_TargetRef(ref common.Referenc Description: "TargetRef contains the Object's apiVersion & kind to specify the target resource", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. In CamelCase.", + Description: "APIVersion defines the versioned schema of this representation of an object.", Default: "", Type: []string{"string"}, Format: "", }, }, - "apiVersion": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object.", + Description: "Kind is a string value representing the REST resource this object represents. In CamelCase.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"kind", "apiVersion"}, + Required: []string{"apiVersion", "kind"}, }, }, } diff --git a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/zz_generated.deepcopy.go index 3dd763ab6..b4debb118 100644 --- a/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/custom-resources/apis/metrics/v1alpha1/zz_generated.deepcopy.go @@ -175,6 +175,11 @@ func (in *MetricsConfigurationList) DeepCopyObject() runtime.Object { func (in *MetricsConfigurationSpec) DeepCopyInto(out *MetricsConfigurationSpec) { *out = *in out.TargetRef = in.TargetRef + if in.CommonLabels != nil { + in, out := &in.CommonLabels, &out.CommonLabels + *out = make([]Label, len(*in)) + copy(*out, *in) + } if in.Metrics != nil { in, out := &in.Metrics, &out.Metrics *out = make([]Metrics, len(*in)) diff --git a/vendor/kmodules.xyz/custom-resources/crds/metrics.appscode.com_metricsconfigurations.yaml b/vendor/kmodules.xyz/custom-resources/crds/metrics.appscode.com_metricsconfigurations.yaml index e0222575f..7dcde9d48 100644 --- a/vendor/kmodules.xyz/custom-resources/crds/metrics.appscode.com_metricsconfigurations.yaml +++ b/vendor/kmodules.xyz/custom-resources/crds/metrics.appscode.com_metricsconfigurations.yaml @@ -48,6 +48,44 @@ spec: description: MetricsConfigurationSpec is the spec of MetricsConfiguration object. properties: + commonLabels: + description: CommonLabels defines the common labels added to all the + exported metrics + items: + description: "Label contains the information of a metric label. + Given labels are always added in the metrics along with resource + name and namespace. Resource's name and namespace are always added + in the labels by default. No configuration is needed for name + and namespace labels. \n Example: kube_pod_info{pod=\"\", + namespace=\"\", host_ip=\"172.18.0.2\", pod_ip=\"10.244.0.14\", + node=\"kind-control-plane\"} 1 In the example pod, namespace, + host_ip, pod_ip, node are labels. pod(resource name) and namespace + are default labels. No configurations is needed for those. \n + To generate others labels, config should be given in the following + way \n labels: - key: host_ip valuePath: .status.hostIP + \ - key: pod_ip valuePath: .status.podIP - key: node valuePath: + .spec.nodeName \n Either Value or ValuePath must be specified + for a Label. If both is specified, ValuePath is ignored. Note + that if a valuePath doesn't exist for a label key, the label will + be ignored." + properties: + key: + description: Key defines the label key + type: string + value: + description: 'Value defines the hard coded label value. Example: + labels: - key: unit value: byte - key: environment value: + production' + type: string + valuePath: + description: 'ValuePath defines the label value path. Example: + To add deployment''s resource version as labels, labels: - + key: version valuePath: .metadata.resourceVersion' + type: string + required: + - key + type: object + type: array metrics: description: List of Metrics configuration for the resource object defined in TargetRef diff --git a/vendor/modules.txt b/vendor/modules.txt index 59df2c59a..1a81fdf7e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -289,7 +289,7 @@ gomodules.xyz/pointer # gomodules.xyz/runtime v0.2.0 ## explicit; go 1.15 gomodules.xyz/runtime -# gomodules.xyz/x v0.0.13 +# gomodules.xyz/x v0.0.14 ## explicit; go 1.17 gomodules.xyz/x/arrays # google.golang.org/appengine v1.6.7 @@ -889,7 +889,7 @@ k8s.io/utils/net k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/trace -# kmodules.xyz/client-go v0.0.0-20220404224906-af7b092cfac5 +# kmodules.xyz/client-go v0.0.0-20220427165208-36281a681909 ## explicit; go 1.17 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -902,7 +902,7 @@ kmodules.xyz/client-go/tools/exec # kmodules.xyz/crd-schema-fuzz v0.0.0-20211025154117-6edb24ef11bc ## explicit; go 1.15 kmodules.xyz/crd-schema-fuzz -# kmodules.xyz/custom-resources v0.0.0-20220317220154-7beb809b1f5e +# kmodules.xyz/custom-resources v0.0.0-20220422215041-237eae1d7ddd ## explicit; go 1.17 kmodules.xyz/custom-resources/apis/appcatalog kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1 @@ -919,7 +919,7 @@ kmodules.xyz/custom-resources/crds # kmodules.xyz/objectstore-api v0.0.0-20220317220441-f1d593d0a778 ## explicit; go 1.15 kmodules.xyz/objectstore-api/api/v1 -# kmodules.xyz/offshoot-api v0.0.0-20220419215722-c7fc995091d3 +# kmodules.xyz/offshoot-api v0.0.0-20220420055916-fefb02c26514 ## explicit; go 1.15 kmodules.xyz/offshoot-api/api/v1 # kmodules.xyz/prober v0.0.0-20220317043828-5ae0114adcad