From caf0e2c1f3dde7bbd8e176f4ff4f98fb694420be Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Feb 2023 14:21:23 +0530 Subject: [PATCH 01/30] Fixed aggregator functionality for dynamic tables --- .../{custom_resource_name.group_name}.md | 307 ++++++++++++++++++ go.mod | 54 +-- go.sum | 148 ++++++--- kubernetes/common_columns.go | 31 +- kubernetes/plugin.go | 125 ++++--- .../table_kubernetes_custom_resource.go | 241 +++++++------- 6 files changed, 634 insertions(+), 272 deletions(-) create mode 100644 docs/tables/{custom_resource_name.group_name}.md diff --git a/docs/tables/{custom_resource_name.group_name}.md b/docs/tables/{custom_resource_name.group_name}.md new file mode 100644 index 0000000..f77d3ac --- /dev/null +++ b/docs/tables/{custom_resource_name.group_name}.md @@ -0,0 +1,307 @@ +# Table: {custom_resource_name.group_name} + +Query data from the custom resource called `{custom_resource_name.group_name}`, e.g., `certificates.cert-manager.io`, `storeconfigs.crossplane.io`. A table is automatically created to represent each custom resource. + +For instance, given the CRD `certManager.yaml`: + +```yml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + # Table name of the custom resource + name: certificates.cert-manager.io + labels: + app: cert-manager + app.kubernetes.io/name: cert-manager-crd + # Generated labels {{- include "labels" . | nindent 4 }} +spec: + group: cert-manager.io + names: + kind: Certificate + listKind: CertificateList + plural: certificates + shortNames: + - cert + - certs + singular: certificate + categories: + - cert-manager + scope: Namespaced + versions: + - name: v1 + subresources: + status: {} + schema: + openAPIV3Schema: + description: "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. \n The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`)." + type: object + required: + - spec + properties: + apiVersion: + description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: Desired state of the Certificate resource. + type: object + required: + - secretName + properties: + additionalOutputFormats: + description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. + type: array + items: + description: CertificateAdditionalOutputFormat defines an additional output format of a Certificate resource. These contain supplementary data formats of the signed certificate chain and paired private key. + type: object + required: + - type + properties: + type: + description: Type is the name of the format type that should be written to the Certificate's target Secret. + type: string + enum: + - DER + - CombinedPEM + commonName: + description: "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4" + type: string + dnsNames: + description: DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + type: array + items: + type: string + duration: + description: The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + emailAddresses: + description: EmailAddresses is a list of email subjectAltNames to be set on the Certificate. + type: array + items: + type: string + encodeUsagesInRequest: + description: EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest + type: boolean + ipAddresses: + description: IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + type: array + items: + type: string + isCA: + description: IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`. + type: boolean + literalSubject: + description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. + type: string + privateKey: + description: Options to control private keys used for the Certificate. + type: object + properties: + algorithm: + description: Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either `RSA`,`Ed25519` or `ECDSA` If `algorithm` is specified and `size` is not provided, key size of 256 will be used for `ECDSA` key algorithm and key size of 2048 will be used for `RSA` key algorithm. key size is ignored when using the `Ed25519` key algorithm. + type: string + enum: + - RSA + - ECDSA + - Ed25519 + encoding: + description: The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1 and PKCS#8, respectively. Defaults to `PKCS1` if not specified. + type: string + enum: + - PKCS1 + - PKCS8 + rotationPolicy: + description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility. + type: string + enum: + - Never + - Always + size: + description: Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. If `algorithm` is set to `Ed25519`, Size is ignored. No other values are allowed. + type: integer + renewBefore: + description: How long before the currently issued certificate's expiry cert-manager should renew the certificate. The default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + revisionHistoryLimit: + description: revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. + type: integer + format: int32 + secretName: + description: SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer. + type: string + secretTemplate: + description: SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotations on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplate annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager sets on the Certificate's Secret. + type: object + properties: + annotations: + description: Annotations is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + labels: + description: Labels is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + usages: + description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. + type: array + items: + description: "KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 \n Valid KeyUsage values are as follows: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\"" + type: string + served: true + storage: true +``` + +And the custom resource `spCloudCertificate.yaml`: + +```yml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: temporal-w-spcloud123456 + labels: + workspace-id: w_spcloud123456 + identity-id: o_spcloud123456 + region: apse1 + shard: "0001" + workspace-pluginset: "202203170111114" + app.kubernetes.io/component: steampipe-workspace-db + app.kubernetes.io/managed-by: steampipe-api + app.kubernetes.io/part-of: steampipe-cloud + app.kubernetes.io/instance: w-spcloud123456 + app.kubernetes.io/version: 0.13.3-workspace-spcloud.20220317010004 +spec: + secretName: temporal-w-spcloud123456-tls + duration: 87600h # 10 years + dnsNames: + - w-spcloud123456 +``` + +This plugin will automatically create a table called `certificates.cert-manager.io`: + +``` +> select name, uid, kind, api_version, namespace from "certificates.cert-manager.io"; ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| name | uid | kind | api_version | namespace | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| temporal-w-spcloudt6t6sk7toegg-tls | 5ccd69be-6e73-4edc-8c1d-bccd6a1e6e38 | Certificate | cert-manager.io/v1 | default | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +``` + +## Examples + +### Inspect the table structure + +List all tables: + +```sql +.inspect kubernetes; ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| table | description | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| certificates.cert-manager.io | Represents Custom resource certificates.cert-manager.io. | +| kubernetes_cluster_role | ClusterRole contains rules that represent a set of permissions. | +| kubernetes_cluster_role_binding | A ClusterRoleBinding grants the permissions defined in a cluster role to a user or set of users. Access granted by ClusterRoleBinding is cluster-wide. | +| ... | ... | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +``` + +To get details of a specific custom resource table, inspect it by name: + +```sql +select column_name, data_type from INFORMATION_SCHEMA.COLUMNS where table_name like 'certificates.cert-manager.io'; ++-------------------------+--------------------------+ +| column_name | data_type | ++-------------------------+--------------------------+ +| _ctx | jsonb | +| additionalOutputFormats | jsonb | +| emailAddresses | jsonb | +| ipAddresses | jsonb | +| subject | jsonb | +| isCA | boolean | +| issuerRef | jsonb | +| revisionHistoryLimit | bigint | +| dnsNames | jsonb | +| encodeUsagesInRequest | boolean | +| secretTemplate | jsonb | +| creation_timestamp | timestamp with time zone | +| labels | jsonb | +| keystores | jsonb | +| privateKey | jsonb | +| uris | jsonb | +| usages | jsonb | +| uid | text | +| kind | text | +| api_version | text | +| namespace | text | +| secretName | text | +| commonName | text | +| duration | text | +| name | text | +| renewBefore | text | +| literalSubject | text | ++-------------------------+--------------------------+ +``` + +### List all certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + "certificates.cert-manager.io"; +``` + +### List certificates added in the last 24 hours + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + "certificates.cert-manager.io" +where + creation_timestamp = now() - interval '24 hrs'; +``` + +### List ISCA certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + "certificates.cert-manager.io" +where + "isCA"; +``` + +### List expired certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + "certificates.cert - manager.io" +where + now() > creation_timestamp + (interval '1 hour' * nullif(left("renewbefore", length("renewbefore") - 1), '')::int); +``` diff --git a/go.mod b/go.mod index c2851db..fa491d1 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.19 require ( github.com/mitchellh/go-homedir v1.1.0 - github.com/turbot/steampipe-plugin-sdk/v5 v5.0.2 + github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3 k8s.io/api v0.25.2 k8s.io/apiextensions-apiserver v0.25.2 - k8s.io/apimachinery v0.25.2 + k8s.io/apimachinery v0.25.3 k8s.io/client-go v0.25.2 ) @@ -26,25 +26,26 @@ require ( github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/agext/levenshtein v1.2.2 // indirect - github.com/allegro/bigcache/v3 v3.0.2 // indirect + github.com/allegro/bigcache/v3 v3.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/aws/aws-sdk-go v1.15.78 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect + github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822 // indirect github.com/btubbs/datetime v0.1.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/eko/gocache/v3 v3.1.1 // indirect + github.com/eko/gocache/v3 v3.1.2 // indirect github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gertd/go-pluralize v0.2.1 // indirect + github.com/gertd/wild v0.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -58,13 +59,14 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/gax-go/v2 v2.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.6.2 // indirect - github.com/hashicorp/go-hclog v1.2.2 // indirect - github.com/hashicorp/go-plugin v1.4.6 // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl/v2 v2.15.0 // indirect @@ -79,10 +81,10 @@ require ( github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -90,18 +92,18 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pegasus-kv/thrift v0.13.0 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.12.2 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.33.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/sethvargo/go-retry v0.1.0 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sethvargo/go-retry v0.2.4 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stevenle/topsort v0.0.0-20130922064739-8130c1d7596b // indirect - github.com/tkrajina/go-reflector v0.5.4 // indirect - github.com/turbot/go-kit v0.5.0-rc.4 // indirect + github.com/tkrajina/go-reflector v0.5.6 // indirect + github.com/turbot/go-kit v0.5.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zclconf/go-cty v1.12.1 // indirect go.opencensus.io v0.23.0 // indirect @@ -117,20 +119,20 @@ require ( go.opentelemetry.io/otel/trace v1.10.0 // indirect go.opentelemetry.io/proto/otlp v0.16.0 // indirect golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect - golang.org/x/exp v0.0.0-20221109205753-fc8884afc316 // indirect - golang.org/x/net v0.1.0 // indirect + golang.org/x/exp v0.0.0-20221110155412-d0897a79cd37 // indirect + golang.org/x/net v0.2.0 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/api v0.57.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect - google.golang.org/grpc v1.48.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/grpc v1.51.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect diff --git a/go.sum b/go.sum index 9e774d9..0cb806e 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.0.0-20170206221025-ce650573d812/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -64,6 +65,7 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -76,15 +78,18 @@ github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2 h1:pami0o github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2/go.mod h1:jNIx5ykW1MroBuaTja9+VpglmaJOUzezumfhLlER3oY= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= +github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= +github.com/aclements/go-moremath v0.0.0-20161014184102-0ff62e0875ff/go.mod h1:idZL3yvz4kzx1dsBOAC+oYv6L92P1oFEhUXUB1A/lwQ= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajstarks/svgo v0.0.0-20200725142600-7a3c8b57fecb/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/allegro/bigcache/v3 v3.0.2 h1:AKZCw+5eAaVyNTBmI2fgyPVJhHkdWder3O9IrprcQfI= -github.com/allegro/bigcache/v3 v3.0.2/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= +github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= +github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= @@ -99,8 +104,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d h1:pVrfxiGfwelyab6n21ZBkbkmbevaf+WvMIiR7sr97hw= -github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= +github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822 h1:hjXJeBcAMS1WGENGqDpzvmgS43oECTx8UXq31UBu0Jw= +github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/btubbs/datetime v0.1.1 h1:KuV+F9tyq/hEnezmKZNGk8dzqMVsId6EpFVrQCfA3To= github.com/btubbs/datetime v0.1.1/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxAoks5jJM= github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -125,7 +130,7 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/coocood/freecache v1.2.1 h1:/v1CqMq45NFH9mp/Pt142reundeBM0dVUD3osQBeu/U= +github.com/coocood/freecache v1.2.3 h1:lcBwpZrwBZRZyLk/8EMyQVXRiFl663cCuMOrjCALeto= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= @@ -133,8 +138,8 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= @@ -143,8 +148,8 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eko/gocache/v3 v3.1.1 h1:r3CBwLnqPkcK56h9Do2CWw1kZ4TeKK0wDE1Oo/YZnhs= -github.com/eko/gocache/v3 v3.1.1/go.mod h1:UpP/LyHAioP/a/dizgl0MpgZ3A3CkS4NbG/mWkGTQ9M= +github.com/eko/gocache/v3 v3.1.2 h1:tBAn5kBScEmRXWHJl0iJgJU7TsMeOjySwHDZ/92riqg= +github.com/eko/gocache/v3 v3.1.2/go.mod h1:92prWCVTLxRkRlZuxDkLkwwUfitZ60zKNi6kn3qiDNU= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= @@ -161,16 +166,19 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= +github.com/gertd/wild v0.0.1 h1:GIS4NSMcOgS80515QP7ZY8CeJ1BX3hEvwMEPyO00C0U= +github.com/gertd/wild v0.0.1/go.mod h1:x60mlQynht6enk2xcruLToNem4cd/2zh+xN7eTUkKo4= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -206,6 +214,7 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -254,6 +263,11 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc= +github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg= +github.com/gonum/internal v0.0.0-20181124074243-f884aa714029/go.mod h1:Pu4dmpkhSyOzRwuXkOgAvijx4o+4YMUJJo9OvPYMkks= +github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9/go.mod h1:XA3DeT6rxh2EAE789SSiSJNqxPaC0aE9J8NTOI0Jo/A= +github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9/go.mod h1:0EXg4mc1CNP0HCqCz+K4ts155PXIlUywf0wqN+GfPZw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= @@ -272,6 +286,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -297,14 +312,16 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gopherjs/gopherjs v0.0.0-20220410123724-9e86199038b0 h1:fWY+zXdWhvWndXqnMj4SyC/vi8sK508OjhGCtMzsA9M= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= @@ -312,10 +329,10 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.6.2 h1:7jX7xcB+uVCliddZgeKyNxv0xoT7qL5KDtH7rU4IqIk= github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= -github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= -github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA= -github.com/hashicorp/go-plugin v1.4.6/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -337,6 +354,8 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -374,10 +393,15 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -385,8 +409,10 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/mattn/go-sqlite3 v0.0.0-20161215041557-2d44decb4941/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -394,8 +420,8 @@ github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdI github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -439,37 +465,40 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE= -github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/sethvargo/go-retry v0.1.0 h1:8sPqlWannzcReEcYjHSNw9becsiYudcwTD7CasGjQaI= -github.com/sethvargo/go-retry v0.1.0/go.mod h1:JzIOdZqQDNpPkQDmcqgtteAcxFLtYpNF/zJCM1ysDg8= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= +github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs= github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -477,6 +506,7 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stevenle/topsort v0.0.0-20130922064739-8130c1d7596b h1:wJSBFlabo96ySlmSX0a02WAPyGxagzTo9c5sk3sHP3E= @@ -493,13 +523,13 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/tkrajina/go-reflector v0.5.4 h1:dS9aJEa/eYNQU/fwsb5CSiATOxcNyA/gG/A7a582D5s= -github.com/tkrajina/go-reflector v0.5.4/go.mod h1:9PyLgEOzc78ey/JmQQHbW8cQJ1oucLlNQsg8yFvkVk8= -github.com/turbot/go-kit v0.5.0-rc.4 h1:uUvZiV2ANzwSe4DRF914o4xAIH/H5JPsGV/7/gg6Y1o= -github.com/turbot/go-kit v0.5.0-rc.4/go.mod h1:2PLaud4oWEbo68tMR0wSyg7SpTeb9uMFhl0WYRM5XOY= -github.com/turbot/steampipe-plugin-sdk/v5 v5.0.2 h1:lQdPgsAzGDV5f2gdXyd779hGTDwBUUoH2LawWTHO6nQ= -github.com/turbot/steampipe-plugin-sdk/v5 v5.0.2/go.mod h1:HAp8buMmaE2Aa3dF5xejC6l6COAvWxuAyEs2pEaZmPU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE= +github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= +github.com/turbot/go-kit v0.5.0 h1:bulbpYGyOQWt4/qFAULPBdrLis//sf3VFz5mTZelv0k= +github.com/turbot/go-kit v0.5.0/go.mod h1:oP9gLk6bETL4nkEuujZZbOlcv9jnHQlf7DYcI/+Ke8Q= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3 h1:TXjUXnjyJG9h772JqdwaNxrnb6cSpqYGALXVDVu/m0c= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -550,6 +580,7 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= @@ -564,8 +595,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20221109205753-fc8884afc316 h1:FedCSp0+vayF11p3wAQndIgu+JTcW2nLp5M+HSefjlM= -golang.org/x/exp v0.0.0-20221109205753-fc8884afc316/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20221110155412-d0897a79cd37 h1:wKMvZzBFHbOCGvF2OmxR5Fqv/jDlkt7slnPz5ejEU8A= +golang.org/x/exp v0.0.0-20221110155412-d0897a79cd37/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -637,8 +668,9 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -657,6 +689,7 @@ golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/perf v0.0.0-20200318175901-9c9101da8316/go.mod h1:FrqOtQDO3iMDVUtw5nNTDFpR1HUCGh00M3kj2wiSzLQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -668,14 +701,15 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -707,6 +741,7 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -734,15 +769,17 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -773,6 +810,7 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -802,6 +840,7 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200809012840-6f4f008689da/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -820,6 +859,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -916,6 +956,7 @@ google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I= google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -943,8 +984,8 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -959,8 +1000,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -991,6 +1033,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/gotestsum v0.5.2/go.mod h1:hC9TQserDVTWcJuARh76Ydp3ZwuE+pIIWpt2BzDLD6M= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1003,8 +1047,8 @@ k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0= k8s.io/apiextensions-apiserver v0.25.2 h1:8uOQX17RE7XL02ngtnh3TgifY7EhekpK+/piwzQNnBo= k8s.io/apiextensions-apiserver v0.25.2/go.mod h1:iRwwRDlWPfaHhuBfQ0WMa5skdQfrE18QXJaJvIDLvE8= k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= -k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= +k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc= +k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/kubernetes/common_columns.go b/kubernetes/common_columns.go index cc552a4..aeae5d4 100644 --- a/kubernetes/common_columns.go +++ b/kubernetes/common_columns.go @@ -68,7 +68,7 @@ func kubectlConfigColumns() []*plugin.Column { } } -// append the common aws columns for REGIONAL resources onto the column list +// append the common kubernetes columns for REGIONAL resources onto the column list func k8sCommonColumns(columns []*plugin.Column) []*plugin.Column { allColumns := objectMetadataPrimaryColumns() allColumns = append(allColumns, columns...) @@ -80,22 +80,21 @@ func k8sCommonColumns(columns []*plugin.Column) []*plugin.Column { return allColumns } -// Uncomment once aggregator functionality available with dynamic tables - -// func k8sCRDResourceCommonColumns(columns []*plugin.Column) []*plugin.Column { -// allColumns := []*plugin.Column{ -// {Name: "name", Type: proto.ColumnType_STRING, Description: "Name of resource."}, -// {Name: "uid", Type: proto.ColumnType_STRING, Description: "UID is the unique in time and space value for this object.", Transform: transform.FromField("UID")}, -// {Name: "kind", Type: proto.ColumnType_STRING, Description: "Type of resource."}, -// {Name: "api_version", Type: proto.ColumnType_STRING, Description: "The API version of the resource.", Transform: transform.FromField("APIVersion")}, -// {Name: "namespace", Type: proto.ColumnType_STRING, Description: "Namespace defines the space within which each name must be unique."}, -// {Name: "creation_timestamp", Type: proto.ColumnType_TIMESTAMP, Transform: transform.FromGo().Transform(v1TimeToRFC3339), Description: "CreationTimestamp is a timestamp representing the server time when this object was created."}, -// {Name: "labels", Type: proto.ColumnType_JSON, Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services."}, -// } -// allColumns = append(allColumns, columns...) +// append the common kubernetes columns for CRD resources +func k8sCRDResourceCommonColumns(columns []*plugin.Column) []*plugin.Column { + allColumns := []*plugin.Column{ + {Name: "name", Type: proto.ColumnType_STRING, Description: "Name of resource."}, + {Name: "uid", Type: proto.ColumnType_STRING, Description: "UID is the unique in time and space value for this object.", Transform: transform.FromField("UID")}, + {Name: "kind", Type: proto.ColumnType_STRING, Description: "Type of resource."}, + {Name: "api_version", Type: proto.ColumnType_STRING, Description: "The API version of the resource.", Transform: transform.FromField("APIVersion")}, + {Name: "namespace", Type: proto.ColumnType_STRING, Description: "Namespace defines the space within which each name must be unique."}, + {Name: "creation_timestamp", Type: proto.ColumnType_TIMESTAMP, Transform: transform.FromGo().Transform(v1TimeToRFC3339), Description: "CreationTimestamp is a timestamp representing the server time when this object was created."}, + {Name: "labels", Type: proto.ColumnType_JSON, Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services."}, + } + allColumns = append(allColumns, columns...) -// return allColumns -// } + return allColumns +} // append the common kubernetes columns for non-namespaced resources onto the column list func k8sCommonGlobalColumns(columns []*plugin.Column) []*plugin.Column { diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 520e8f9..92c2144 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -8,15 +8,18 @@ package kubernetes import ( "context" + "strings" + "github.com/turbot/steampipe-plugin-sdk/v5/connection" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const pluginName = "steampipe-plugin-kubernetes" -// Uncomment once aggregator functionality available with dynamic tables -// type contextKey string +type contextKey string // Plugin creates this (k8s) plugin func Plugin(ctx context.Context) *plugin.Plugin { @@ -27,8 +30,7 @@ func Plugin(ctx context.Context) *plugin.Plugin { NewInstance: ConfigInstance, Schema: ConfigSchema, }, - // TODO: Change to dynamic, once aggregator functionality available with dynamic tables - SchemaMode: plugin.SchemaModeStatic, + SchemaMode: plugin.SchemaModeDynamic, TableMapFunc: pluginTableDefinitions, } @@ -73,66 +75,63 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } // Fetch available CRDs - // TODO: Re-enable once aggregator functionality works with dynamic tables - // crds, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) - // if err != nil { - // plugin.Logger(ctx).Error("listK8sDynamicCRDs", "crds", err) - // return nil, err - // } - - // for _, crd := range crds { - // ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) - // ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) - // ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) - // for _, version := range crd.Spec.Versions { - // if version.Served { - // ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) - // ctx = context.WithValue(ctx, contextKey("VersionSchema"), version.Schema.OpenAPIV3Schema.Properties["spec"]) - // } - // } - // if tables[crd.Name] == nil { - // tables[crd.Name] = tableKubernetesCustomResource(ctx) - // } - // } + crds, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) + if err != nil { + plugin.Logger(ctx).Error("listK8sDynamicCRDs", "crds", err) + return nil, err + } + + for _, crd := range crds { + ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) + ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) + ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) + for _, version := range crd.Spec.Versions { + if version.Served { + ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) + ctx = context.WithValue(ctx, contextKey("VersionSchema"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + } + } + if tables[crd.Name] == nil { + tables[crd.Name] = tableKubernetesCustomResource(ctx) + } + } return tables, nil } -// Uncomment once aggregator functionality available with dynamic tables - -// func listK8sDynamicCRDs(ctx context.Context, cn *connection.ConnectionCache, c *plugin.Connection) ([]v1.CustomResourceDefinition, error) { -// clientset, err := GetNewClientCRDRaw(ctx, cn, c) -// if err != nil { -// plugin.Logger(ctx).Error("listK8sDynamicCRDs", "GetNewClientCRDRaw", err) -// return nil, err -// } - -// input := metav1.ListOptions{ -// Limit: 500, -// } - -// crds := []v1.CustomResourceDefinition{} - -// pageLeft := true -// for pageLeft { -// response, err := clientset.ApiextensionsV1().CustomResourceDefinitions().List(ctx, input) -// if err != nil { -// // Handle err at the plugin load time if config is not setup properly -// if strings.Contains(err.Error(), "/apis/apiextensions.k8s.io/v1/customresourcedefinitions?limit=500") { -// return nil, nil -// } -// plugin.Logger(ctx).Error("listK8sDynamicCRDs", "list_err", err) -// return nil, err -// } - -// if response.GetContinue() != "" { -// input.Continue = response.Continue -// } else { -// pageLeft = false -// } - -// crds = append(crds, response.Items...) -// } - -// return crds, nil -// } +func listK8sDynamicCRDs(ctx context.Context, cn *connection.ConnectionCache, c *plugin.Connection) ([]v1.CustomResourceDefinition, error) { + clientset, err := GetNewClientCRDRaw(ctx, cn, c) + if err != nil { + plugin.Logger(ctx).Error("listK8sDynamicCRDs", "GetNewClientCRDRaw", err) + return nil, err + } + + input := metav1.ListOptions{ + Limit: 500, + } + + crds := []v1.CustomResourceDefinition{} + + pageLeft := true + for pageLeft { + response, err := clientset.ApiextensionsV1().CustomResourceDefinitions().List(ctx, input) + if err != nil { + // Handle err at the plugin load time if config is not setup properly + if strings.Contains(err.Error(), "/apis/apiextensions.k8s.io/v1/customresourcedefinitions?limit=500") { + return nil, nil + } + plugin.Logger(ctx).Error("listK8sDynamicCRDs", "list_err", err) + return nil, err + } + + if response.GetContinue() != "" { + input.Continue = response.Continue + } else { + pageLeft = false + } + + crds = append(crds, response.Items...) + } + + return crds, nil +} diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index d82c7ba..c4d9aab 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -1,120 +1,131 @@ package kubernetes -// Uncomment once aggregator functionality available with dynamic tables - -// func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { -// crdName := ctx.Value(contextKey("CRDName")).(string) -// resourceName := ctx.Value(contextKey("CustomResourceName")).(string) -// groupName := ctx.Value(contextKey("GroupName")).(string) -// activeVersion := ctx.Value(contextKey("ActiveVersion")).(string) -// versionSchema := ctx.Value(contextKey("VersionSchema")) -// return &plugin.Table{ -// Name: crdName, -// Description: fmt.Sprintf("Custom resource for %s.", crdName), -// List: &plugin.ListConfig{ -// Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), -// }, -// Columns: k8sCRDResourceCommonColumns(getCustomResourcesDynamicColumns(ctx, versionSchema)), -// } -// } - -// func getCustomResourcesDynamicColumns(ctx context.Context, versionSchema interface{}) []*plugin.Column { -// var columns []*plugin.Column - -// schema := versionSchema.(v1.JSONSchemaProps) -// for k, v := range schema.Properties { -// column := &plugin.Column{ -// Name: k, -// Description: v.Description, -// Transform: transform.FromP(extractSpecProperty, k), -// } -// switch v.Type { -// case "string": -// column.Type = proto.ColumnType_STRING -// case "integer": -// column.Type = proto.ColumnType_INT -// case "boolean": -// column.Type = proto.ColumnType_BOOL -// case "date", "dateTime": -// column.Type = proto.ColumnType_TIMESTAMP -// case "double": -// column.Type = proto.ColumnType_DOUBLE -// default: -// column.Type = proto.ColumnType_JSON -// } - -// columns = append(columns, column) -// } - -// return columns -// } - -// type CRDResourceInfo struct { -// Name interface{} -// UID interface{} -// CreationTimestamp interface{} -// Kind interface{} -// APIVersion interface{} -// Namespace interface{} -// Annotations interface{} -// Spec interface{} -// Labels interface{} -// } +import ( + "context" + "fmt" + "strings" + + "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" + "github.com/turbot/steampipe-plugin-sdk/v5/plugin" + "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { + crdName := ctx.Value(contextKey("CRDName")).(string) + resourceName := ctx.Value(contextKey("CustomResourceName")).(string) + groupName := ctx.Value(contextKey("GroupName")).(string) + activeVersion := ctx.Value(contextKey("ActiveVersion")).(string) + versionSchema := ctx.Value(contextKey("VersionSchema")) + return &plugin.Table{ + Name: crdName, + Description: fmt.Sprintf("Custom resource for %s.", crdName), + List: &plugin.ListConfig{ + Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), + }, + Columns: k8sCRDResourceCommonColumns(getCustomResourcesDynamicColumns(ctx, versionSchema)), + } +} + +func getCustomResourcesDynamicColumns(ctx context.Context, versionSchema interface{}) []*plugin.Column { + var columns []*plugin.Column + + schema := versionSchema.(v1.JSONSchemaProps) + for k, v := range schema.Properties { + column := &plugin.Column{ + Name: k, + Description: v.Description, + Transform: transform.FromP(extractSpecProperty, k), + } + switch v.Type { + case "string": + column.Type = proto.ColumnType_STRING + case "integer": + column.Type = proto.ColumnType_INT + case "boolean": + column.Type = proto.ColumnType_BOOL + case "date", "dateTime": + column.Type = proto.ColumnType_TIMESTAMP + case "double": + column.Type = proto.ColumnType_DOUBLE + default: + column.Type = proto.ColumnType_JSON + } + + columns = append(columns, column) + } + + return columns +} + +type CRDResourceInfo struct { + Name interface{} + UID interface{} + CreationTimestamp interface{} + Kind interface{} + APIVersion interface{} + Namespace interface{} + Annotations interface{} + Spec interface{} + Labels interface{} +} // //// HYDRATE FUNCTIONS -// func listK8sCustomResources(ctx context.Context, crdName string, resourceName string, groupName string, activeVersion string) func(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { -// return func(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { -// clientset, err := GetNewClientDynamic(ctx, d) -// if err != nil { -// return nil, err -// } - -// resourceId := schema.GroupVersionResource{ -// Group: groupName, -// Version: activeVersion, -// Resource: resourceName, -// } - -// response, err := clientset.Resource(resourceId).List(ctx, metav1.ListOptions{}) -// if err != nil { -// if strings.Contains(err.Error(), "could not find the requested resource") { -// return nil, nil -// } -// return nil, err -// } - -// for _, crd := range response.Items { -// data := crd.Object -// d.StreamListItem(ctx, &CRDResourceInfo{ -// Name: crd.GetName(), -// UID: crd.GetUID(), -// APIVersion: crd.GetAPIVersion(), -// Kind: crd.GetKind(), -// Namespace: crd.GetNamespace(), -// CreationTimestamp: crd.GetCreationTimestamp(), -// Labels: crd.GetLabels(), -// Spec: data["spec"], -// }) - -// // Context can be cancelled due to manual cancellation or the limit has been hit -// if d.RowsRemaining(ctx) == 0 { -// return nil, nil -// } -// } - -// return nil, nil -// } - -// } - -// func extractSpecProperty(_ context.Context, d *transform.TransformData) (interface{}, error) { -// ob := d.HydrateItem.(*CRDResourceInfo).Spec -// param := d.Param.(string) -// spec := ob.(map[string]interface{}) -// if spec[param] != nil { -// return spec[param], nil -// } - -// return nil, nil -// } +func listK8sCustomResources(ctx context.Context, crdName string, resourceName string, groupName string, activeVersion string) func(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { + return func(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { + clientset, err := GetNewClientDynamic(ctx, d) + if err != nil { + return nil, err + } + + resourceId := schema.GroupVersionResource{ + Group: groupName, + Version: activeVersion, + Resource: resourceName, + } + + response, err := clientset.Resource(resourceId).List(ctx, metav1.ListOptions{}) + if err != nil { + if strings.Contains(err.Error(), "could not find the requested resource") { + return nil, nil + } + return nil, err + } + + for _, crd := range response.Items { + data := crd.Object + d.StreamListItem(ctx, &CRDResourceInfo{ + Name: crd.GetName(), + UID: crd.GetUID(), + APIVersion: crd.GetAPIVersion(), + Kind: crd.GetKind(), + Namespace: crd.GetNamespace(), + CreationTimestamp: crd.GetCreationTimestamp(), + Labels: crd.GetLabels(), + Spec: data["spec"], + }) + + // Context can be cancelled due to manual cancellation or the limit has been hit + if d.RowsRemaining(ctx) == 0 { + return nil, nil + } + } + + return nil, nil + } + +} + +func extractSpecProperty(_ context.Context, d *transform.TransformData) (interface{}, error) { + ob := d.HydrateItem.(*CRDResourceInfo).Spec + param := d.Param.(string) + spec := ob.(map[string]interface{}) + if spec[param] != nil { + return spec[param], nil + } + + return nil, nil +} From 90dca17a0cdc81ae12f93633eed1cbf371ec68fb Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Fri, 3 Feb 2023 12:32:22 +0530 Subject: [PATCH 02/30] Update --- kubernetes/plugin.go | 6 +- .../table_kubernetes_custom_resource.go | 60 +++++++++++++------ 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 92c2144..b7c17eb 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -30,6 +30,7 @@ func Plugin(ctx context.Context) *plugin.Plugin { NewInstance: ConfigInstance, Schema: ConfigSchema, }, + // TODO: Change to dynamic, once aggregator functionality available with dynamic tables SchemaMode: plugin.SchemaModeDynamic, TableMapFunc: pluginTableDefinitions, } @@ -88,9 +89,12 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st for _, version := range crd.Spec.Versions { if version.Served { ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) - ctx = context.WithValue(ctx, contextKey("VersionSchema"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { + ctx = context.WithValue(ctx, contextKey("VersionSchema"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + } } } + if tables[crd.Name] == nil { tables[crd.Name] = tableKubernetesCustomResource(ctx) } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index c4d9aab..2319596 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -32,29 +32,34 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { func getCustomResourcesDynamicColumns(ctx context.Context, versionSchema interface{}) []*plugin.Column { var columns []*plugin.Column + // default metadata columns + allColumns := []string{"name", "uid", "kind", "api_version", "namespace", "creation_timestamp", "labels"} + + flag := 0 schema := versionSchema.(v1.JSONSchemaProps) for k, v := range schema.Properties { - column := &plugin.Column{ - Name: k, - Description: v.Description, - Transform: transform.FromP(extractSpecProperty, k), + for _, specColumn := range allColumns { + if specColumn == k { + flag = 1 + column := &plugin.Column{ + Name: "spec_" + k, + Description: v.Description, + Transform: transform.FromP(extractSpecProperty, k), + } + setDynamicColumns(v, column) + columns = append(columns, column) + } } - switch v.Type { - case "string": - column.Type = proto.ColumnType_STRING - case "integer": - column.Type = proto.ColumnType_INT - case "boolean": - column.Type = proto.ColumnType_BOOL - case "date", "dateTime": - column.Type = proto.ColumnType_TIMESTAMP - case "double": - column.Type = proto.ColumnType_DOUBLE - default: - column.Type = proto.ColumnType_JSON + if flag == 0 { + column := &plugin.Column{ + Name: k, + Description: v.Description, + Transform: transform.FromP(extractSpecProperty, k), + } + allColumns = append(allColumns, k) + setDynamicColumns(v, column) + columns = append(columns, column) } - - columns = append(columns, column) } return columns @@ -129,3 +134,20 @@ func extractSpecProperty(_ context.Context, d *transform.TransformData) (interfa return nil, nil } + +func setDynamicColumns(v v1.JSONSchemaProps, column *plugin.Column) { + switch v.Type { + case "string": + column.Type = proto.ColumnType_STRING + case "integer": + column.Type = proto.ColumnType_INT + case "boolean": + column.Type = proto.ColumnType_BOOL + case "date", "dateTime": + column.Type = proto.ColumnType_TIMESTAMP + case "double": + column.Type = proto.ColumnType_DOUBLE + default: + column.Type = proto.ColumnType_JSON + } +} From e369ed74a11f112e2585c8879d56f82bcdb135a2 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Mon, 6 Feb 2023 12:31:56 +0530 Subject: [PATCH 03/30] Update custom resource table design --- kubernetes/plugin.go | 8 +- .../table_kubernetes_custom_resource.go | 83 +++++++++++++++---- 2 files changed, 72 insertions(+), 19 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index b7c17eb..8b13ef2 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -8,6 +8,7 @@ package kubernetes import ( "context" + "regexp" "strings" "github.com/turbot/steampipe-plugin-sdk/v5/connection" @@ -90,13 +91,16 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st if version.Served { ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { - ctx = context.WithValue(ctx, contextKey("VersionSchema"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) + } } } if tables[crd.Name] == nil { - tables[crd.Name] = tableKubernetesCustomResource(ctx) + re := regexp.MustCompile(`[-.]`) + tables[re.ReplaceAllString(crd.Name, "_")] = tableKubernetesCustomResource(ctx) } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 2319596..7c34cc1 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "github.com/iancoleman/strcase" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" @@ -18,47 +19,81 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { resourceName := ctx.Value(contextKey("CustomResourceName")).(string) groupName := ctx.Value(contextKey("GroupName")).(string) activeVersion := ctx.Value(contextKey("ActiveVersion")).(string) - versionSchema := ctx.Value(contextKey("VersionSchema")) + versionSchemaSpec := ctx.Value(contextKey("VersionSchemaSpec")) + versionSchemaStatus := ctx.Value(contextKey("VersionSchemaStatus")) return &plugin.Table{ Name: crdName, Description: fmt.Sprintf("Custom resource for %s.", crdName), List: &plugin.ListConfig{ Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), }, - Columns: k8sCRDResourceCommonColumns(getCustomResourcesDynamicColumns(ctx, versionSchema)), + Columns: k8sCRDResourceCommonColumns(getCustomResourcesDynamicColumns(ctx, versionSchemaSpec, versionSchemaStatus)), } } -func getCustomResourcesDynamicColumns(ctx context.Context, versionSchema interface{}) []*plugin.Column { +func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec interface{}, versionSchemaStatus interface{}) []*plugin.Column { var columns []*plugin.Column // default metadata columns allColumns := []string{"name", "uid", "kind", "api_version", "namespace", "creation_timestamp", "labels"} + // add the spec columns flag := 0 - schema := versionSchema.(v1.JSONSchemaProps) - for k, v := range schema.Properties { - for _, specColumn := range allColumns { - if specColumn == k { - flag = 1 + schemaSpec := versionSchemaSpec.(v1.JSONSchemaProps) + for k, v := range schemaSpec.Properties { + if !strings.Contains(v.Description, "Deprecated") { + for _, specColumn := range allColumns { + if specColumn == k { + flag = 1 + column := &plugin.Column{ + Name: "spec_" + strcase.ToSnake(k), + Description: v.Description, + Transform: transform.FromP(extractSpecProperty, k), + } + setDynamicColumns(v, column) + columns = append(columns, column) + } + } + if flag == 0 { column := &plugin.Column{ - Name: "spec_" + k, + Name: strcase.ToSnake(k), Description: v.Description, Transform: transform.FromP(extractSpecProperty, k), } + allColumns = append(allColumns, k) setDynamicColumns(v, column) columns = append(columns, column) } } - if flag == 0 { - column := &plugin.Column{ - Name: k, - Description: v.Description, - Transform: transform.FromP(extractSpecProperty, k), + } + + // add the status columns + flag = 0 + schemaStaus := versionSchemaStatus.(v1.JSONSchemaProps) + for k, v := range schemaStaus.Properties { + if !strings.Contains(v.Description, "Deprecated") { + for _, statusColumn := range allColumns { + if statusColumn == k { + flag = 1 + column := &plugin.Column{ + Name: "status_" + strcase.ToSnake(k), + Description: v.Description, + Transform: transform.FromP(extractStatusProperty, k), + } + setDynamicColumns(v, column) + columns = append(columns, column) + } + } + if flag == 0 { + column := &plugin.Column{ + Name: strcase.ToSnake(k), + Description: v.Description, + Transform: transform.FromP(extractStatusProperty, k), + } + allColumns = append(allColumns, k) + setDynamicColumns(v, column) + columns = append(columns, column) } - allColumns = append(allColumns, k) - setDynamicColumns(v, column) - columns = append(columns, column) } } @@ -75,6 +110,7 @@ type CRDResourceInfo struct { Annotations interface{} Spec interface{} Labels interface{} + Status interface{} } // //// HYDRATE FUNCTIONS @@ -102,6 +138,7 @@ func listK8sCustomResources(ctx context.Context, crdName string, resourceName st for _, crd := range response.Items { data := crd.Object + plugin.Logger(ctx).Error("status", data["status"]) d.StreamListItem(ctx, &CRDResourceInfo{ Name: crd.GetName(), UID: crd.GetUID(), @@ -111,6 +148,7 @@ func listK8sCustomResources(ctx context.Context, crdName string, resourceName st CreationTimestamp: crd.GetCreationTimestamp(), Labels: crd.GetLabels(), Spec: data["spec"], + Status: data["status"], }) // Context can be cancelled due to manual cancellation or the limit has been hit @@ -135,6 +173,17 @@ func extractSpecProperty(_ context.Context, d *transform.TransformData) (interfa return nil, nil } +func extractStatusProperty(_ context.Context, d *transform.TransformData) (interface{}, error) { + ob := d.HydrateItem.(*CRDResourceInfo).Status + param := d.Param.(string) + status := ob.(map[string]interface{}) + if status[param] != nil { + return status[param], nil + } + + return nil, nil +} + func setDynamicColumns(v v1.JSONSchemaProps, column *plugin.Column) { switch v.Type { case "string": From 3162821ec6cdf62da3dd0519a26d6ff3500b7da8 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Mon, 6 Feb 2023 13:37:19 +0530 Subject: [PATCH 04/30] Update custom resource doc --- .../{custom_resource_name.group_name}.md | 307 ------------- .../{custom_resource_name_group_name}.md | 413 ++++++++++++++++++ 2 files changed, 413 insertions(+), 307 deletions(-) delete mode 100644 docs/tables/{custom_resource_name.group_name}.md create mode 100644 docs/tables/{custom_resource_name_group_name}.md diff --git a/docs/tables/{custom_resource_name.group_name}.md b/docs/tables/{custom_resource_name.group_name}.md deleted file mode 100644 index f77d3ac..0000000 --- a/docs/tables/{custom_resource_name.group_name}.md +++ /dev/null @@ -1,307 +0,0 @@ -# Table: {custom_resource_name.group_name} - -Query data from the custom resource called `{custom_resource_name.group_name}`, e.g., `certificates.cert-manager.io`, `storeconfigs.crossplane.io`. A table is automatically created to represent each custom resource. - -For instance, given the CRD `certManager.yaml`: - -```yml -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - # Table name of the custom resource - name: certificates.cert-manager.io - labels: - app: cert-manager - app.kubernetes.io/name: cert-manager-crd - # Generated labels {{- include "labels" . | nindent 4 }} -spec: - group: cert-manager.io - names: - kind: Certificate - listKind: CertificateList - plural: certificates - shortNames: - - cert - - certs - singular: certificate - categories: - - cert-manager - scope: Namespaced - versions: - - name: v1 - subresources: - status: {} - schema: - openAPIV3Schema: - description: "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. \n The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`)." - type: object - required: - - spec - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - metadata: - type: object - spec: - description: Desired state of the Certificate resource. - type: object - required: - - secretName - properties: - additionalOutputFormats: - description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. - type: array - items: - description: CertificateAdditionalOutputFormat defines an additional output format of a Certificate resource. These contain supplementary data formats of the signed certificate chain and paired private key. - type: object - required: - - type - properties: - type: - description: Type is the name of the format type that should be written to the Certificate's target Secret. - type: string - enum: - - DER - - CombinedPEM - commonName: - description: "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4" - type: string - dnsNames: - description: DNSNames is a list of DNS subjectAltNames to be set on the Certificate. - type: array - items: - type: string - duration: - description: The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration - type: string - emailAddresses: - description: EmailAddresses is a list of email subjectAltNames to be set on the Certificate. - type: array - items: - type: string - encodeUsagesInRequest: - description: EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest - type: boolean - ipAddresses: - description: IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. - type: array - items: - type: string - isCA: - description: IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`. - type: boolean - literalSubject: - description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. - type: string - privateKey: - description: Options to control private keys used for the Certificate. - type: object - properties: - algorithm: - description: Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either `RSA`,`Ed25519` or `ECDSA` If `algorithm` is specified and `size` is not provided, key size of 256 will be used for `ECDSA` key algorithm and key size of 2048 will be used for `RSA` key algorithm. key size is ignored when using the `Ed25519` key algorithm. - type: string - enum: - - RSA - - ECDSA - - Ed25519 - encoding: - description: The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1 and PKCS#8, respectively. Defaults to `PKCS1` if not specified. - type: string - enum: - - PKCS1 - - PKCS8 - rotationPolicy: - description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility. - type: string - enum: - - Never - - Always - size: - description: Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. If `algorithm` is set to `Ed25519`, Size is ignored. No other values are allowed. - type: integer - renewBefore: - description: How long before the currently issued certificate's expiry cert-manager should renew the certificate. The default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration - type: string - revisionHistoryLimit: - description: revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. - type: integer - format: int32 - secretName: - description: SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer. - type: string - secretTemplate: - description: SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotations on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplate annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager sets on the Certificate's Secret. - type: object - properties: - annotations: - description: Annotations is a key value map to be copied to the target Kubernetes Secret. - type: object - additionalProperties: - type: string - labels: - description: Labels is a key value map to be copied to the target Kubernetes Secret. - type: object - additionalProperties: - type: string - usages: - description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. - type: array - items: - description: "KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 \n Valid KeyUsage values are as follows: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\"" - type: string - served: true - storage: true -``` - -And the custom resource `spCloudCertificate.yaml`: - -```yml -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: temporal-w-spcloud123456 - labels: - workspace-id: w_spcloud123456 - identity-id: o_spcloud123456 - region: apse1 - shard: "0001" - workspace-pluginset: "202203170111114" - app.kubernetes.io/component: steampipe-workspace-db - app.kubernetes.io/managed-by: steampipe-api - app.kubernetes.io/part-of: steampipe-cloud - app.kubernetes.io/instance: w-spcloud123456 - app.kubernetes.io/version: 0.13.3-workspace-spcloud.20220317010004 -spec: - secretName: temporal-w-spcloud123456-tls - duration: 87600h # 10 years - dnsNames: - - w-spcloud123456 -``` - -This plugin will automatically create a table called `certificates.cert-manager.io`: - -``` -> select name, uid, kind, api_version, namespace from "certificates.cert-manager.io"; -+------------------------------------+--------------------------------------+-------------+--------------------+-----------+ -| name | uid | kind | api_version | namespace | -+------------------------------------+--------------------------------------+-------------+--------------------+-----------+ -| temporal-w-spcloudt6t6sk7toegg-tls | 5ccd69be-6e73-4edc-8c1d-bccd6a1e6e38 | Certificate | cert-manager.io/v1 | default | -+------------------------------------+--------------------------------------+-------------+--------------------+-----------+ -``` - -## Examples - -### Inspect the table structure - -List all tables: - -```sql -.inspect kubernetes; -+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| table | description | -+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| certificates.cert-manager.io | Represents Custom resource certificates.cert-manager.io. | -| kubernetes_cluster_role | ClusterRole contains rules that represent a set of permissions. | -| kubernetes_cluster_role_binding | A ClusterRoleBinding grants the permissions defined in a cluster role to a user or set of users. Access granted by ClusterRoleBinding is cluster-wide. | -| ... | ... | -+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -``` - -To get details of a specific custom resource table, inspect it by name: - -```sql -select column_name, data_type from INFORMATION_SCHEMA.COLUMNS where table_name like 'certificates.cert-manager.io'; -+-------------------------+--------------------------+ -| column_name | data_type | -+-------------------------+--------------------------+ -| _ctx | jsonb | -| additionalOutputFormats | jsonb | -| emailAddresses | jsonb | -| ipAddresses | jsonb | -| subject | jsonb | -| isCA | boolean | -| issuerRef | jsonb | -| revisionHistoryLimit | bigint | -| dnsNames | jsonb | -| encodeUsagesInRequest | boolean | -| secretTemplate | jsonb | -| creation_timestamp | timestamp with time zone | -| labels | jsonb | -| keystores | jsonb | -| privateKey | jsonb | -| uris | jsonb | -| usages | jsonb | -| uid | text | -| kind | text | -| api_version | text | -| namespace | text | -| secretName | text | -| commonName | text | -| duration | text | -| name | text | -| renewBefore | text | -| literalSubject | text | -+-------------------------+--------------------------+ -``` - -### List all certificates - -```sql -select - name, - uid, - namespace, - creation_timestamp, - api_version -from - "certificates.cert-manager.io"; -``` - -### List certificates added in the last 24 hours - -```sql -select - name, - uid, - namespace, - creation_timestamp, - api_version -from - "certificates.cert-manager.io" -where - creation_timestamp = now() - interval '24 hrs'; -``` - -### List ISCA certificates - -```sql -select - name, - uid, - namespace, - creation_timestamp, - api_version -from - "certificates.cert-manager.io" -where - "isCA"; -``` - -### List expired certificates - -```sql -select - name, - uid, - namespace, - creation_timestamp, - api_version -from - "certificates.cert - manager.io" -where - now() > creation_timestamp + (interval '1 hour' * nullif(left("renewbefore", length("renewbefore") - 1), '')::int); -``` diff --git a/docs/tables/{custom_resource_name_group_name}.md b/docs/tables/{custom_resource_name_group_name}.md new file mode 100644 index 0000000..ac2b902 --- /dev/null +++ b/docs/tables/{custom_resource_name_group_name}.md @@ -0,0 +1,413 @@ +# Table: {custom_resource_name_group_name} + +Query data from the custom resource called `{custom_resource_name_group_name}`, e.g., `certificates_cert_manager_io`, `storeconfigs_crossplane_io`. A table is automatically created to represent each custom resource. + +For instance, given the CRD `certManager.yaml`: + +```yml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + # Table name of the custom resource + name: certificates.cert-manager.io + labels: + app: cert-manager + app.kubernetes.io/name: cert-manager-crd + # Generated labels {{- include "labels" . | nindent 4 }} +spec: + group: cert-manager.io + names: + kind: Certificate + listKind: CertificateList + plural: certificates + shortNames: + - cert + - certs + singular: certificate + categories: + - cert-manager + scope: Namespaced + versions: + - name: v1 + subresources: + status: {} + schema: + openAPIV3Schema: + description: "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. \n The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`)." + type: object + required: + - spec + properties: + apiVersion: + description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: Desired state of the Certificate resource. + type: object + required: + - secretName + properties: + additionalOutputFormats: + description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. + type: array + items: + description: CertificateAdditionalOutputFormat defines an additional output format of a Certificate resource. These contain supplementary data formats of the signed certificate chain and paired private key. + type: object + required: + - type + properties: + type: + description: Type is the name of the format type that should be written to the Certificate's target Secret. + type: string + enum: + - DER + - CombinedPEM + commonName: + description: "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4" + type: string + dnsNames: + description: DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + type: array + items: + type: string + duration: + description: The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + emailAddresses: + description: EmailAddresses is a list of email subjectAltNames to be set on the Certificate. + type: array + items: + type: string + encodeUsagesInRequest: + description: EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest + type: boolean + ipAddresses: + description: IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + type: array + items: + type: string + isCA: + description: IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`. + type: boolean + literalSubject: + description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. + type: string + privateKey: + description: Options to control private keys used for the Certificate. + type: object + properties: + algorithm: + description: Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either `RSA`,`Ed25519` or `ECDSA` If `algorithm` is specified and `size` is not provided, key size of 256 will be used for `ECDSA` key algorithm and key size of 2048 will be used for `RSA` key algorithm. key size is ignored when using the `Ed25519` key algorithm. + type: string + enum: + - RSA + - ECDSA + - Ed25519 + encoding: + description: The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1 and PKCS#8, respectively. Defaults to `PKCS1` if not specified. + type: string + enum: + - PKCS1 + - PKCS8 + rotationPolicy: + description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility. + type: string + enum: + - Never + - Always + size: + description: Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. If `algorithm` is set to `Ed25519`, Size is ignored. No other values are allowed. + type: integer + renewBefore: + description: How long before the currently issued certificate's expiry cert-manager should renew the certificate. The default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + revisionHistoryLimit: + description: revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. + type: integer + format: int32 + secretName: + description: SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer. + type: string + secretTemplate: + description: SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotations on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplate annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager sets on the Certificate's Secret. + type: object + properties: + annotations: + description: Annotations is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + labels: + description: Labels is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + usages: + description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. + type: array + items: + description: "KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 \n Valid KeyUsage values are as follows: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\"" + type: string + status: + description: Status of the Certificate. This is set and managed automatically. + type: object + properties: + conditions: + description: List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`. + type: array + items: + description: CertificateCondition contains condition information for an Certificate. + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: LastTransitionTime is the timestamp corresponding to the last status change of this condition. + type: string + format: date-time + message: + description: Message is a human readable description of the details of the last transition, complementing reason. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate. + type: integer + format: int64 + reason: + description: Reason is a brief machine readable explanation for the condition's last transition. + type: string + status: + description: Status of the condition, one of (`True`, `False`, `Unknown`). + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: Type of the condition, known values are (`Ready`, `Issuing`). + type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + failedIssuanceAttempts: + description: The number of continuous failed issuance attempts up till now. This field gets removed (if set) on a successful issuance and gets set to 1 if unset and an issuance has failed. If an issuance has failed, the delay till the next issuance will be calculated using formula time.Hour * 2 ^ (failedIssuanceAttempts - 1). + type: integer + lastFailureTime: + description: LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time. + type: string + format: date-time + nextPrivateKeySecretName: + description: The name of the Secret resource containing the private key to be used for the next certificate iteration. The keymanager controller will automatically set this field if the `Issuing` condition is set to `True`. It will automatically unset this field when the Issuing condition is not set or False. + type: string + notAfter: + description: The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. + type: string + format: date-time + notBefore: + description: The time after which the certificate stored in the secret named by this resource in spec.secretName is valid. + type: string + format: date-time + renewalTime: + description: RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled. + type: string + format: date-time + revision: + description: "The current 'revision' of the certificate as issued. \n When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` set to one greater than the current value of this field. \n Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource used to issue the certificate. \n Persisting the value on the CertificateRequest resource allows the certificates controller to know whether a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking if the revision value in the annotation is greater than this field." + type: integer + served: true + storage: true +``` + +And the custom resource `spCloudCertificate.yaml`: + +```yml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: temporal-w-spcloud123456 + labels: + workspace-id: w_spcloud123456 + identity-id: o_spcloud123456 + region: apse1 + shard: "0001" + workspace-pluginset: "202203170111114" + app.kubernetes.io/component: steampipe-workspace-db + app.kubernetes.io/managed-by: steampipe-api + app.kubernetes.io/part-of: steampipe-cloud + app.kubernetes.io/instance: w-spcloud123456 + app.kubernetes.io/version: 0.13.3-workspace-spcloud.20220317010004 +spec: + secretName: temporal-w-spcloud123456-tls + duration: 87600h # 10 years + dnsNames: + - w-spcloud123456 +``` + +This plugin will automatically create a table called `certificates_cert_manager_io`: + +``` +> select name, uid, kind, api_version, namespace from certificates_cert_manager_io; ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| name | uid | kind | api_version | namespace | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| temporal-w-spcloudt6t6sk7toegg-tls | 5ccd69be-6e73-4edc-8c1d-bccd6a1e6e38 | Certificate | cert-manager.io/v1 | default | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +``` + +## Examples + +### Inspect the table structure + +List all tables: + +```sql +.inspect kubernetes; ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| table | description | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| certificates_cert_manager_io | Represents Custom resource certificates.cert-manager.io. | +| kubernetes_cluster_role | ClusterRole contains rules that represent a set of permissions. | +| kubernetes_cluster_role_binding | A ClusterRoleBinding grants the permissions defined in a cluster role to a user or set of users. Access granted by ClusterRoleBinding is cluster-wide. | +| ... | ... | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +``` + +To get details of a specific custom resource table, inspect it by name: + +```sql +.inspect certificates_cert_manager_io; ++------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ +| column | type | description | ++------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ +| _ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | +| api_version | text | The API version of the resource. | +| common_name | text | CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 cha | +| | | racters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject | +| | | alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4 | +| conditions | jsonb | List of status conditions to indicate the status of certificates. Known condition types are `Ready` and | +| | | `Issuing`. | +| creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. | +| dns_names | jsonb | DNSNames is a list of DNS subjectAltNames to be set on the Certificate. | +| duration | text | The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by so | +| | | me issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its d | +| | | uration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 ho | +| | | ur. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| email_addresses | jsonb | EmailAddresses is a list of email subjectAltNames to be set on the Certificate. | +| encode_usages_in_request | boolean | EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest | +| ip_addresses | jsonb | IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. | +| is_ca | boolean | IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert | +| | | sign` usage to the list of `usages`. | +| issuer_ref | jsonb | IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to ` | +| | | Issuer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. I | +| | | f the `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The ` | +| | | name` field in this stanza is required at all times. | +| keystores | jsonb | Keystores configures additional keystore output formats stored in the `secretName` Secret resource. | +| kind | text | Type of resource. | +| labels | jsonb | Map of string keys and values that can be used to organize and categorize (scope and select) objects. Ma | +| | | y match selectors of replication controllers and services. | +| last_failure_time | text | LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to comp | +| | | lete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request anothe | +| | | r Certificate until 1 hour has elapsed from this time. | +| name | text | Name of resource. | +| namespace | text | Namespace defines the space within which each name must be unique. | +| next_private_key_secret_name | text | The name of the Secret resource containing the private key to be used for the next certificate iteration | +| | | . The keymanager controller will automatically set this field if the `Issuing` condition is set to `True | +| | | `. It will automatically unset this field when the Issuing condition is not set or False. | +| not_after | text | The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. | +| not_before | text | The time after which the certificate stored in the secret named by this resource in spec.secretName is v | +| | | alid. | +| private_key | jsonb | Options to control private keys used for the Certificate. | +| renew_before | text | How long before the currently issued certificate's expiry cert-manager should renew the certificate. The | +| | | default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be | +| | | in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| renewal_time | text | RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal i | +| | | s scheduled. | +| revision | bigint | The current 'revision' of the certificate as issued. | +| | | When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` | +| | | set to one greater than the current value of this field. | +| | | Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource | +| | | used to issue the certificate. | +| | | Persisting the value on the CertificateRequest resource allows the certificates controller to know whet | +| | | her a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking | +| | | if the revision value in the annotation is greater than this field. | +| revision_history_limit | bigint | revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Ce | +| | | rtificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, | +| | | either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if | +| | | the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or grea | +| | | ter. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. | +| secret_name | text | SecretName is the name of the secret resource that will be automatically created and managed by this Cer | +| | | tificate resource. It will be populated with a private key and certificate, signed by the denoted issuer | +| | | . | +| secret_template | jsonb | SecretTemplate defines annotations and labels to be propagated to the Kubernetes Secret when it is creat | +| | | ed or updated. Once created, labels and annotations are not yet removed from the Secret when they are re | +| | | moved from the template. See https://github.com/jetstack/cert-manager/issues/4292 | +| subject | jsonb | Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). | +| uid | text | UID is the unique in time and space value for this object. | +| uris | jsonb | URIs is a list of URI subjectAltNames to be set on the Certificate. | +| usages | jsonb | Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` | +| | | and `key encipherment` if not specified. | ++------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ +``` + +### List all certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + certificates_cert_manager_io; +``` + +### List certificates added in the last 24 hours + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + certificates_cert_manager_io +where + creation_timestamp = now() - interval '24 hrs'; +``` + +### List ISCA certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + certificates_cert_manager_io +where + is_ca; +``` + +### List expired certificates + +```sql +select + name, + uid, + namespace, + creation_timestamp, + api_version +from + certificates_cert_manager_io +where + now() > to_timestamp(not_after,'YYYY-MM-DD'); +``` From 33f14b37c83f1cbf535f30a36263b59231855eff Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Mon, 6 Feb 2023 14:42:15 +0530 Subject: [PATCH 05/30] update --- .../{custom_resource_name_group_name}.md | 292 ++++++++++-------- 1 file changed, 161 insertions(+), 131 deletions(-) diff --git a/docs/tables/{custom_resource_name_group_name}.md b/docs/tables/{custom_resource_name_group_name}.md index ac2b902..39fcf3b 100644 --- a/docs/tables/{custom_resource_name_group_name}.md +++ b/docs/tables/{custom_resource_name_group_name}.md @@ -8,7 +8,6 @@ For instance, given the CRD `certManager.yaml`: apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - # Table name of the custom resource name: certificates.cert-manager.io labels: app: cert-manager @@ -31,6 +30,25 @@ spec: - name: v1 subresources: status: {} + additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .spec.secretName + name: Secret + type: string + - jsonPath: .spec.issuerRef.name + name: Issuer + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - jsonPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + name: Age + type: date schema: openAPIV3Schema: description: "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. \n The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`)." @@ -50,6 +68,7 @@ spec: description: Desired state of the Certificate resource. type: object required: + - issuerRef - secretName properties: additionalOutputFormats: @@ -94,6 +113,24 @@ spec: isCA: description: IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`. type: boolean + issuerRef: + description: IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to `Issuer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. If the `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The `name` field in this stanza is required at all times. + type: object + required: + - name + properties: + group: + description: Group of the resource being referred to. + type: string + kind: + description: Kind of the resource being referred to. + type: string + name: + description: Name of the resource being referred to. + type: string + keystores: + description: Keystores configures additional keystore output formats stored in the `secretName` Secret resource. + type: object literalSubject: description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. type: string @@ -147,78 +184,74 @@ spec: type: object additionalProperties: type: string + uris: + description: URIs is a list of URI subjectAltNames to be set on the Certificate. + type: array + items: + type: string usages: description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. type: array items: description: "KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 \n Valid KeyUsage values are as follows: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\"" type: string - status: - description: Status of the Certificate. This is set and managed automatically. - type: object - properties: - conditions: - description: List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`. - type: array - items: - description: CertificateCondition contains condition information for an Certificate. + status: + description: Status of the Certificate. This is set and managed automatically. type: object - required: - - status - - type properties: - lastTransitionTime: - description: LastTransitionTime is the timestamp corresponding to the last status change of this condition. + conditions: + description: List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`. + type: array + items: + description: CertificateCondition contains condition information for an Certificate. + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: LastTransitionTime is the timestamp corresponding to the last status change of this condition. + type: string + format: date-time + message: + description: Message is a human readable description of the details of the last transition, complementing reason. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate. + type: integer + format: int64 + reason: + description: Reason is a brief machine readable explanation for the condition's last transition. + type: string + status: + description: Status of the condition, one of (`True`, `False`, `Unknown`). + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: Type of the condition, known values are (`Ready`, `Issuing`). + type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastFailureTime: + description: LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time. type: string format: date-time - message: - description: Message is a human readable description of the details of the last transition, complementing reason. - type: string - observedGeneration: - description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate. - type: integer - format: int64 - reason: - description: Reason is a brief machine readable explanation for the condition's last transition. + notAfter: + description: The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. type: string - status: - description: Status of the condition, one of (`True`, `False`, `Unknown`). + format: date-time + notBefore: + description: The time after which the certificate stored in the secret named by this resource in spec.secretName is valid. type: string - enum: - - "True" - - "False" - - Unknown - type: - description: Type of the condition, known values are (`Ready`, `Issuing`). + format: date-time + renewalTime: + description: RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled. type: string - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - failedIssuanceAttempts: - description: The number of continuous failed issuance attempts up till now. This field gets removed (if set) on a successful issuance and gets set to 1 if unset and an issuance has failed. If an issuance has failed, the delay till the next issuance will be calculated using formula time.Hour * 2 ^ (failedIssuanceAttempts - 1). - type: integer - lastFailureTime: - description: LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time. - type: string - format: date-time - nextPrivateKeySecretName: - description: The name of the Secret resource containing the private key to be used for the next certificate iteration. The keymanager controller will automatically set this field if the `Issuing` condition is set to `True`. It will automatically unset this field when the Issuing condition is not set or False. - type: string - notAfter: - description: The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. - type: string - format: date-time - notBefore: - description: The time after which the certificate stored in the secret named by this resource in spec.secretName is valid. - type: string - format: date-time - renewalTime: - description: RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled. - type: string - format: date-time - revision: - description: "The current 'revision' of the certificate as issued. \n When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` set to one greater than the current value of this field. \n Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource used to issue the certificate. \n Persisting the value on the CertificateRequest resource allows the certificates controller to know whether a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking if the revision value in the annotation is greater than this field." - type: integer + format: date-time served: true storage: true ``` @@ -281,77 +314,74 @@ To get details of a specific custom resource table, inspect it by name: ```sql .inspect certificates_cert_manager_io; -+------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ -| column | type | description | -+------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ -| _ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | -| api_version | text | The API version of the resource. | -| common_name | text | CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 cha | -| | | racters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject | -| | | alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4 | -| conditions | jsonb | List of status conditions to indicate the status of certificates. Known condition types are `Ready` and | -| | | `Issuing`. | -| creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. | -| dns_names | jsonb | DNSNames is a list of DNS subjectAltNames to be set on the Certificate. | -| duration | text | The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by so | -| | | me issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its d | -| | | uration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 ho | -| | | ur. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | -| email_addresses | jsonb | EmailAddresses is a list of email subjectAltNames to be set on the Certificate. | -| encode_usages_in_request | boolean | EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest | -| ip_addresses | jsonb | IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. | -| is_ca | boolean | IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert | -| | | sign` usage to the list of `usages`. | -| issuer_ref | jsonb | IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to ` | -| | | Issuer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. I | -| | | f the `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The ` | -| | | name` field in this stanza is required at all times. | -| keystores | jsonb | Keystores configures additional keystore output formats stored in the `secretName` Secret resource. | -| kind | text | Type of resource. | -| labels | jsonb | Map of string keys and values that can be used to organize and categorize (scope and select) objects. Ma | -| | | y match selectors of replication controllers and services. | -| last_failure_time | text | LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to comp | -| | | lete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request anothe | -| | | r Certificate until 1 hour has elapsed from this time. | -| name | text | Name of resource. | -| namespace | text | Namespace defines the space within which each name must be unique. | -| next_private_key_secret_name | text | The name of the Secret resource containing the private key to be used for the next certificate iteration | -| | | . The keymanager controller will automatically set this field if the `Issuing` condition is set to `True | -| | | `. It will automatically unset this field when the Issuing condition is not set or False. | -| not_after | text | The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. | -| not_before | text | The time after which the certificate stored in the secret named by this resource in spec.secretName is v | -| | | alid. | -| private_key | jsonb | Options to control private keys used for the Certificate. | -| renew_before | text | How long before the currently issued certificate's expiry cert-manager should renew the certificate. The | -| | | default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be | -| | | in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | -| renewal_time | text | RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal i | -| | | s scheduled. | -| revision | bigint | The current 'revision' of the certificate as issued. | -| | | When a CertificateRequest resource is created, it will have the `cert-manager.io/certificate-revision` | -| | | set to one greater than the current value of this field. | -| | | Upon issuance, this field will be set to the value of the annotation on the CertificateRequest resource | -| | | used to issue the certificate. | -| | | Persisting the value on the CertificateRequest resource allows the certificates controller to know whet | -| | | her a request is part of an old issuance or if it is part of the ongoing revision's issuance by checking | -| | | if the revision value in the annotation is greater than this field. | -| revision_history_limit | bigint | revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Ce | -| | | rtificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, | -| | | either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if | -| | | the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or grea | -| | | ter. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. | -| secret_name | text | SecretName is the name of the secret resource that will be automatically created and managed by this Cer | -| | | tificate resource. It will be populated with a private key and certificate, signed by the denoted issuer | -| | | . | -| secret_template | jsonb | SecretTemplate defines annotations and labels to be propagated to the Kubernetes Secret when it is creat | -| | | ed or updated. Once created, labels and annotations are not yet removed from the Secret when they are re | -| | | moved from the template. See https://github.com/jetstack/cert-manager/issues/4292 | -| subject | jsonb | Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name). | -| uid | text | UID is the unique in time and space value for this object. | -| uris | jsonb | URIs is a list of URI subjectAltNames to be set on the Certificate. | -| usages | jsonb | Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` | -| | | and `key encipherment` if not specified. | -+------------------------------+--------------------------+----------------------------------------------------------------------------------------------------------+ ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ +| column | type | description | ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ +| _ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | +| additional_output_formats | jsonb | AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be | +| | | written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--featu | +| | | re-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. | +| api_version | text | The API version of the resource. | +| common_name | text | CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 charac | +| | | ters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt n | +| | | ame is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4 | +| conditions | jsonb | List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Is | +| | | suing`. | +| creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. | +| dns_names | jsonb | DNSNames is a list of DNS subjectAltNames to be set on the Certificate. | +| duration | text | The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some | +| | | issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duratio | +| | | n or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value | +| | | must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| email_addresses | jsonb | EmailAddresses is a list of email subjectAltNames to be set on the Certificate. | +| encode_usages_in_request | boolean | EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest | +| ip_addresses | jsonb | IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. | +| is_ca | boolean | IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sig | +| | | n` usage to the list of `usages`. | +| issuer_ref | jsonb | IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to `Iss | +| | | uer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. If the | +| | | `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The `name` fie | +| | | ld in this stanza is required at all times. | +| keystores | jsonb | Keystores configures additional keystore output formats stored in the `secretName` Secret resource. | +| kind | text | Type of resource. | +| labels | jsonb | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May m | +| | | atch selectors of replication controllers and services. | +| last_failure_time | text | LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complet | +| | | e a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Cert | +| | | ificate until 1 hour has elapsed from this time. | +| literal_subject | text | LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ie | +| | | tf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the | +| | | correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://gith | +| | | ub.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. Thi | +| | | s field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject | +| | | feature gate is enabled on both cert-manager controller and webhook. | +| name | text | Name of resource. | +| namespace | text | Namespace defines the space within which each name must be unique. | +| not_after | text | The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. | +| not_before | text | The time after which the certificate stored in the secret named by this resource in spec.secretName is vali | +| | | d. | +| private_key | jsonb | Options to control private keys used for the Certificate. | +| renew_before | text | How long before the currently issued certificate's expiry cert-manager should renew the certificate. The de | +| | | fault is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in un | +| | | its accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| renewal_time | text | RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is s | +| | | cheduled. | +| revision_history_limit | bigint | revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certi | +| | | ficate's history. Each revision represents a single `CertificateRequest` created by this Certificate, eithe | +| | | r when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the numbe | +| | | r of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unse | +| | | t (`nil`), revisions will not be garbage collected. Default value is `nil`. | +| secret_name | text | SecretName is the name of the secret resource that will be automatically created and managed by this Certif | +| | | icate resource. It will be populated with a private key and certificate, signed by the denoted issuer. | +| secret_template | jsonb | SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotati | +| | | ons on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplat | +| | | e annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager | +| | | sets on the Certificate's Secret. | +| uid | text | UID is the unique in time and space value for this object. | +| uris | jsonb | URIs is a list of URI subjectAltNames to be set on the Certificate. | +| usages | jsonb | Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` an | +| | | d `key encipherment` if not specified. | ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ ``` ### List all certificates From 1bc2730abc7cafb55f3d1525e79e6b5d6aa4b049 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Mon, 6 Feb 2023 14:49:01 +0530 Subject: [PATCH 06/30] update --- kubernetes/table_kubernetes_custom_resource.go | 1 - 1 file changed, 1 deletion(-) diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 7c34cc1..a322dcb 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -138,7 +138,6 @@ func listK8sCustomResources(ctx context.Context, crdName string, resourceName st for _, crd := range response.Items { data := crd.Object - plugin.Logger(ctx).Error("status", data["status"]) d.StreamListItem(ctx, &CRDResourceInfo{ Name: crd.GetName(), UID: crd.GetUID(), From 14df11b3a4d1ea6f74c70e1ca14ed61ad24d77b7 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Mon, 6 Feb 2023 20:37:59 +0530 Subject: [PATCH 07/30] Update --- .../table_kubernetes_custom_resource.go | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index a322dcb..ccfbb29 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -41,60 +41,57 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int flag := 0 schemaSpec := versionSchemaSpec.(v1.JSONSchemaProps) for k, v := range schemaSpec.Properties { - if !strings.Contains(v.Description, "Deprecated") { - for _, specColumn := range allColumns { - if specColumn == k { - flag = 1 - column := &plugin.Column{ - Name: "spec_" + strcase.ToSnake(k), - Description: v.Description, - Transform: transform.FromP(extractSpecProperty, k), - } - setDynamicColumns(v, column) - columns = append(columns, column) - } - } - if flag == 0 { + for _, specColumn := range allColumns { + if specColumn == strcase.ToSnake(k) { + flag = 1 column := &plugin.Column{ - Name: strcase.ToSnake(k), + Name: "spec_" + strcase.ToSnake(k), Description: v.Description, Transform: transform.FromP(extractSpecProperty, k), } - allColumns = append(allColumns, k) setDynamicColumns(v, column) columns = append(columns, column) } } + // remove any conflicting column if it is deprecated + if flag == 0 && !strings.Contains(v.Description, "Deprecated") { + column := &plugin.Column{ + Name: strcase.ToSnake(k), + Description: v.Description, + Transform: transform.FromP(extractSpecProperty, k), + } + allColumns = append(allColumns, strcase.ToSnake(k)) + setDynamicColumns(v, column) + columns = append(columns, column) + } } // add the status columns flag = 0 schemaStaus := versionSchemaStatus.(v1.JSONSchemaProps) for k, v := range schemaStaus.Properties { - if !strings.Contains(v.Description, "Deprecated") { - for _, statusColumn := range allColumns { - if statusColumn == k { - flag = 1 - column := &plugin.Column{ - Name: "status_" + strcase.ToSnake(k), - Description: v.Description, - Transform: transform.FromP(extractStatusProperty, k), - } - setDynamicColumns(v, column) - columns = append(columns, column) - } - } - if flag == 0 { + for _, statusColumn := range allColumns { + if statusColumn == k { + flag = 1 column := &plugin.Column{ - Name: strcase.ToSnake(k), + Name: "status_" + strcase.ToSnake(k), Description: v.Description, Transform: transform.FromP(extractStatusProperty, k), } - allColumns = append(allColumns, k) setDynamicColumns(v, column) columns = append(columns, column) } } + if flag == 0 { + column := &plugin.Column{ + Name: strcase.ToSnake(k), + Description: v.Description, + Transform: transform.FromP(extractStatusProperty, k), + } + allColumns = append(allColumns, k) + setDynamicColumns(v, column) + columns = append(columns, column) + } } return columns From 8bbf0812cecd9a9203d2de422a47f5c66c917d12 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Tue, 7 Feb 2023 16:59:01 +0530 Subject: [PATCH 08/30] update --- go.mod | 4 ++-- go.sum | 4 ++-- kubernetes/plugin.go | 4 ++-- kubernetes/table_kubernetes_custom_resource.go | 12 +++++------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index fa491d1..a6c938d 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,9 @@ module github.com/turbot/steampipe-plugin-kubernetes go 1.19 require ( + github.com/iancoleman/strcase v0.2.0 github.com/mitchellh/go-homedir v1.1.0 - github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3 + github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4 k8s.io/api v0.25.2 k8s.io/apiextensions-apiserver v0.25.2 k8s.io/apimachinery v0.25.3 @@ -71,7 +72,6 @@ require ( github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl/v2 v2.15.0 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/iancoleman/strcase v0.2.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/go.sum b/go.sum index 0cb806e..ce29c7f 100644 --- a/go.sum +++ b/go.sum @@ -528,8 +528,8 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/turbot/go-kit v0.5.0 h1:bulbpYGyOQWt4/qFAULPBdrLis//sf3VFz5mTZelv0k= github.com/turbot/go-kit v0.5.0/go.mod h1:oP9gLk6bETL4nkEuujZZbOlcv9jnHQlf7DYcI/+Ke8Q= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3 h1:TXjUXnjyJG9h772JqdwaNxrnb6cSpqYGALXVDVu/m0c= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.3/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4 h1:+jBUL7ykAQQXxajpa1AH0meztvbU/TDlDQsP+FC5nY4= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 8b13ef2..da753f2 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -31,7 +31,6 @@ func Plugin(ctx context.Context) *plugin.Plugin { NewInstance: ConfigInstance, Schema: ConfigSchema, }, - // TODO: Change to dynamic, once aggregator functionality available with dynamic tables SchemaMode: plugin.SchemaModeDynamic, TableMapFunc: pluginTableDefinitions, } @@ -98,8 +97,9 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } } + // add the tables in sneak case + re := regexp.MustCompile(`[-.]`) if tables[crd.Name] == nil { - re := regexp.MustCompile(`[-.]`) tables[re.ReplaceAllString(crd.Name, "_")] = tableKubernetesCustomResource(ctx) } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index ccfbb29..00e961e 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -32,7 +32,7 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { } func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec interface{}, versionSchemaStatus interface{}) []*plugin.Column { - var columns []*plugin.Column + columns := []*plugin.Column{} // default metadata columns allColumns := []string{"name", "uid", "kind", "api_version", "namespace", "creation_timestamp", "labels"} @@ -53,8 +53,7 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int columns = append(columns, column) } } - // remove any conflicting column if it is deprecated - if flag == 0 && !strings.Contains(v.Description, "Deprecated") { + if flag == 0 { column := &plugin.Column{ Name: strcase.ToSnake(k), Description: v.Description, @@ -68,10 +67,10 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int // add the status columns flag = 0 - schemaStaus := versionSchemaStatus.(v1.JSONSchemaProps) - for k, v := range schemaStaus.Properties { + schemaStatus := versionSchemaStatus.(v1.JSONSchemaProps) + for k, v := range schemaStatus.Properties { for _, statusColumn := range allColumns { - if statusColumn == k { + if statusColumn == strcase.ToSnake(k) { flag = 1 column := &plugin.Column{ Name: "status_" + strcase.ToSnake(k), @@ -88,7 +87,6 @@ func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec int Description: v.Description, Transform: transform.FromP(extractStatusProperty, k), } - allColumns = append(allColumns, k) setDynamicColumns(v, column) columns = append(columns, column) } From e3d96fe67c454474122622039c8feeeea247eaef Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Tue, 7 Feb 2023 19:10:21 +0530 Subject: [PATCH 09/30] Update --- kubernetes/table_kubernetes_custom_resource_definition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/table_kubernetes_custom_resource_definition.go b/kubernetes/table_kubernetes_custom_resource_definition.go index 394f070..74121b0 100644 --- a/kubernetes/table_kubernetes_custom_resource_definition.go +++ b/kubernetes/table_kubernetes_custom_resource_definition.go @@ -103,7 +103,7 @@ func getK8sCustomResourceDefinition(ctx context.Context, d *plugin.QueryData, _ } response, err := clientset.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{}) - if err != nil { + if err != nil && !isNotFoundError(err) { plugin.Logger(ctx).Error("getK8sCustomResourceDefinition", "api_err", err) return nil, err } From 3f139b46c544fe2cf58e62b3c79efe9f84301730 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 16 Feb 2023 13:34:58 +0530 Subject: [PATCH 10/30] Update --- kubernetes/plugin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index da753f2..f025072 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -11,6 +11,7 @@ import ( "regexp" "strings" + "github.com/turbot/go-kit/types" "github.com/turbot/steampipe-plugin-sdk/v5/connection" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" @@ -115,7 +116,8 @@ func listK8sDynamicCRDs(ctx context.Context, cn *connection.ConnectionCache, c * } input := metav1.ListOptions{ - Limit: 500, + Limit: 500, + TimeoutSeconds: types.Int64(10), } crds := []v1.CustomResourceDefinition{} From c33f631118edab385672d11c541a718c823048dc Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 22 Feb 2023 16:56:50 +0530 Subject: [PATCH 11/30] Update SDK --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a6c938d..010c470 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,8 @@ go 1.19 require ( github.com/iancoleman/strcase v0.2.0 github.com/mitchellh/go-homedir v1.1.0 - github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4 + github.com/turbot/go-kit v0.5.0 + github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1 k8s.io/api v0.25.2 k8s.io/apiextensions-apiserver v0.25.2 k8s.io/apimachinery v0.25.3 @@ -103,7 +104,6 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stevenle/topsort v0.0.0-20130922064739-8130c1d7596b // indirect github.com/tkrajina/go-reflector v0.5.6 // indirect - github.com/turbot/go-kit v0.5.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zclconf/go-cty v1.12.1 // indirect go.opencensus.io v0.23.0 // indirect diff --git a/go.sum b/go.sum index ce29c7f..5555906 100644 --- a/go.sum +++ b/go.sum @@ -528,8 +528,8 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/turbot/go-kit v0.5.0 h1:bulbpYGyOQWt4/qFAULPBdrLis//sf3VFz5mTZelv0k= github.com/turbot/go-kit v0.5.0/go.mod h1:oP9gLk6bETL4nkEuujZZbOlcv9jnHQlf7DYcI/+Ke8Q= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4 h1:+jBUL7ykAQQXxajpa1AH0meztvbU/TDlDQsP+FC5nY4= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.4/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= +github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1 h1:qwBb2qvgO3LGmfK8AAnGk20jSNO9l98sHWn2N47cxzw= +github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 39f8eaf02af335ad66353a169a86cf6e04c2be09 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 22 Feb 2023 20:29:22 +0530 Subject: [PATCH 12/30] Update SDK --- go.mod | 3 +-- go.sum | 41 ++--------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index 010c470..3085f8c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/iancoleman/strcase v0.2.0 github.com/mitchellh/go-homedir v1.1.0 github.com/turbot/go-kit v0.5.0 - github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1 + github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8 k8s.io/api v0.25.2 k8s.io/apiextensions-apiserver v0.25.2 k8s.io/apimachinery v0.25.3 @@ -47,7 +47,6 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gertd/go-pluralize v0.2.1 // indirect - github.com/gertd/wild v0.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/go.sum b/go.sum index 5555906..b43c202 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.0.0-20170206221025-ce650573d812/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -65,7 +64,6 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -78,11 +76,8 @@ github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2 h1:pami0o github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2/go.mod h1:jNIx5ykW1MroBuaTja9+VpglmaJOUzezumfhLlER3oY= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= -github.com/aclements/go-moremath v0.0.0-20161014184102-0ff62e0875ff/go.mod h1:idZL3yvz4kzx1dsBOAC+oYv6L92P1oFEhUXUB1A/lwQ= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/ajstarks/svgo v0.0.0-20200725142600-7a3c8b57fecb/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -166,7 +161,6 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -177,8 +171,6 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= -github.com/gertd/wild v0.0.1 h1:GIS4NSMcOgS80515QP7ZY8CeJ1BX3hEvwMEPyO00C0U= -github.com/gertd/wild v0.0.1/go.mod h1:x60mlQynht6enk2xcruLToNem4cd/2zh+xN7eTUkKo4= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -214,7 +206,6 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -263,11 +254,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc= -github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg= -github.com/gonum/internal v0.0.0-20181124074243-f884aa714029/go.mod h1:Pu4dmpkhSyOzRwuXkOgAvijx4o+4YMUJJo9OvPYMkks= -github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9/go.mod h1:XA3DeT6rxh2EAE789SSiSJNqxPaC0aE9J8NTOI0Jo/A= -github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9/go.mod h1:0EXg4mc1CNP0HCqCz+K4ts155PXIlUywf0wqN+GfPZw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= @@ -312,10 +298,8 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= @@ -354,8 +338,6 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -393,15 +375,10 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -409,7 +386,6 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v0.0.0-20161215041557-2d44decb4941/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -506,7 +482,6 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stevenle/topsort v0.0.0-20130922064739-8130c1d7596b h1:wJSBFlabo96ySlmSX0a02WAPyGxagzTo9c5sk3sHP3E= @@ -528,8 +503,8 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/turbot/go-kit v0.5.0 h1:bulbpYGyOQWt4/qFAULPBdrLis//sf3VFz5mTZelv0k= github.com/turbot/go-kit v0.5.0/go.mod h1:oP9gLk6bETL4nkEuujZZbOlcv9jnHQlf7DYcI/+Ke8Q= -github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1 h1:qwBb2qvgO3LGmfK8AAnGk20jSNO9l98sHWn2N47cxzw= -github.com/turbot/steampipe-plugin-sdk/v5 v5.3.0-alpha.1/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8 h1:AyEJj/hji+uaLO7T1v29xjKaZF67onjpvBytmYjZazI= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -580,7 +555,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= @@ -670,7 +644,6 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -689,7 +662,6 @@ golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/perf v0.0.0-20200318175901-9c9101da8316/go.mod h1:FrqOtQDO3iMDVUtw5nNTDFpR1HUCGh00M3kj2wiSzLQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -709,7 +681,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -721,7 +692,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -741,7 +711,6 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -810,7 +779,6 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -840,7 +808,6 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200809012840-6f4f008689da/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -859,7 +826,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -956,7 +922,6 @@ google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I= google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1033,8 +998,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/gotestsum v0.5.2/go.mod h1:hC9TQserDVTWcJuARh76Ydp3ZwuE+pIIWpt2BzDLD6M= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 63c10106057b75be9b130ee7c2f1edd427c20dc3 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 23 Feb 2023 17:12:43 +0530 Subject: [PATCH 13/30] Update --- kubernetes/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index f025072..8d7cecb 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -117,7 +117,7 @@ func listK8sDynamicCRDs(ctx context.Context, cn *connection.ConnectionCache, c * input := metav1.ListOptions{ Limit: 500, - TimeoutSeconds: types.Int64(10), + TimeoutSeconds: types.Int64(5), } crds := []v1.CustomResourceDefinition{} From 765d524297bb5f2c2993aa04ec62c1a4d3c9c13a Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 23 Feb 2023 20:43:36 +0530 Subject: [PATCH 14/30] Update --- kubernetes/plugin.go | 6 ++++-- kubernetes/table_kubernetes_custom_resource.go | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 8d7cecb..2731eb3 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -100,8 +100,10 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st // add the tables in sneak case re := regexp.MustCompile(`[-.]`) - if tables[crd.Name] == nil { - tables[re.ReplaceAllString(crd.Name, "_")] = tableKubernetesCustomResource(ctx) + if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) + } else { + tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 00e961e..8190bdf 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -158,6 +158,9 @@ func listK8sCustomResources(ctx context.Context, crdName string, resourceName st func extractSpecProperty(_ context.Context, d *transform.TransformData) (interface{}, error) { ob := d.HydrateItem.(*CRDResourceInfo).Spec + if ob == nil { + return nil, nil + } param := d.Param.(string) spec := ob.(map[string]interface{}) if spec[param] != nil { @@ -169,6 +172,9 @@ func extractSpecProperty(_ context.Context, d *transform.TransformData) (interfa func extractStatusProperty(_ context.Context, d *transform.TransformData) (interface{}, error) { ob := d.HydrateItem.(*CRDResourceInfo).Status + if ob == nil { + return nil, nil + } param := d.Param.(string) status := ob.(map[string]interface{}) if status[param] != nil { From 6ac181f84b2143b55e4f7a2b8e480f44665fe9d2 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 23 Feb 2023 22:33:57 +0530 Subject: [PATCH 15/30] update table desc --- kubernetes/plugin.go | 2 +- kubernetes/table_kubernetes_custom_resource.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 2731eb3..302cdf5 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -93,7 +93,7 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) - + ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), version.Schema.OpenAPIV3Schema.Description) } } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 8190bdf..b80373c 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -2,7 +2,6 @@ package kubernetes import ( "context" - "fmt" "strings" "github.com/iancoleman/strcase" @@ -21,9 +20,10 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { activeVersion := ctx.Value(contextKey("ActiveVersion")).(string) versionSchemaSpec := ctx.Value(contextKey("VersionSchemaSpec")) versionSchemaStatus := ctx.Value(contextKey("VersionSchemaStatus")) + VersionSchemaDescription := ctx.Value(contextKey("VersionSchemaDescription")).(string) return &plugin.Table{ Name: crdName, - Description: fmt.Sprintf("Custom resource for %s.", crdName), + Description: VersionSchemaDescription + "Custom resource for " + crdName + ".", List: &plugin.ListConfig{ Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), }, From 9f393abfc716e9f1395cf8bdbe4a806a8ccb8c60 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Fri, 24 Feb 2023 18:31:03 +0530 Subject: [PATCH 16/30] Update doc --- ...d => kubernetes_{custom_resource_name}.md} | 21 ++++++++++--------- kubernetes/plugin.go | 6 +++++- .../table_kubernetes_custom_resource.go | 5 +++-- 3 files changed, 19 insertions(+), 13 deletions(-) rename docs/tables/{{custom_resource_name_group_name}.md => kubernetes_{custom_resource_name}.md} (97%) diff --git a/docs/tables/{custom_resource_name_group_name}.md b/docs/tables/kubernetes_{custom_resource_name}.md similarity index 97% rename from docs/tables/{custom_resource_name_group_name}.md rename to docs/tables/kubernetes_{custom_resource_name}.md index 39fcf3b..819d1c0 100644 --- a/docs/tables/{custom_resource_name_group_name}.md +++ b/docs/tables/kubernetes_{custom_resource_name}.md @@ -1,6 +1,6 @@ -# Table: {custom_resource_name_group_name} +# Table: kubernetes\_{custom_resource_name} -Query data from the custom resource called `{custom_resource_name_group_name}`, e.g., `certificates_cert_manager_io`, `storeconfigs_crossplane_io`. A table is automatically created to represent each custom resource. +Query data from the custom resource called `kubernetes_{custom_resource_singular_name}`, e.g., `kubernetes_certificate`, `kubernetes_capacityrequest`. A table is automatically created to represent each custom resource. For instance, given the CRD `certManager.yaml`: @@ -22,6 +22,7 @@ spec: shortNames: - cert - certs + # table name - kubernetes_certificate singular: certificate categories: - cert-manager @@ -281,10 +282,10 @@ spec: - w-spcloud123456 ``` -This plugin will automatically create a table called `certificates_cert_manager_io`: +This plugin will automatically create a table called `kubernetes_certificate`: ``` -> select name, uid, kind, api_version, namespace from certificates_cert_manager_io; +> select name, uid, kind, api_version, namespace from kubernetes_certificate; +------------------------------------+--------------------------------------+-------------+--------------------+-----------+ | name | uid | kind | api_version | namespace | +------------------------------------+--------------------------------------+-------------+--------------------+-----------+ @@ -303,7 +304,7 @@ List all tables: +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | table | description | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| certificates_cert_manager_io | Represents Custom resource certificates.cert-manager.io. | +| kubernetes_certificate | A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`).Custom resource for certificates.cert-manager.io. | | kubernetes_cluster_role | ClusterRole contains rules that represent a set of permissions. | | kubernetes_cluster_role_binding | A ClusterRoleBinding grants the permissions defined in a cluster role to a user or set of users. Access granted by ClusterRoleBinding is cluster-wide. | | ... | ... | @@ -313,7 +314,7 @@ List all tables: To get details of a specific custom resource table, inspect it by name: ```sql -.inspect certificates_cert_manager_io; +.inspect kubernetes_certificate; +---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ | column | type | description | +---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ @@ -394,7 +395,7 @@ select creation_timestamp, api_version from - certificates_cert_manager_io; + kubernetes_certificate; ``` ### List certificates added in the last 24 hours @@ -407,7 +408,7 @@ select creation_timestamp, api_version from - certificates_cert_manager_io + kubernetes_certificate where creation_timestamp = now() - interval '24 hrs'; ``` @@ -422,7 +423,7 @@ select creation_timestamp, api_version from - certificates_cert_manager_io + kubernetes_certificate where is_ca; ``` @@ -437,7 +438,7 @@ select creation_timestamp, api_version from - certificates_cert_manager_io + kubernetes_certificate where now() > to_timestamp(not_after,'YYYY-MM-DD'); ``` diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 302cdf5..2451418 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -93,7 +93,9 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) - ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), version.Schema.OpenAPIV3Schema.Description) + if len(version.Schema.OpenAPIV3Schema.Description) > 0 { + ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), strings.TrimSuffix(version.Schema.OpenAPIV3Schema.Description, ".")+".") + } } } } @@ -101,8 +103,10 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st // add the tables in sneak case re := regexp.MustCompile(`[-.]`) if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) } else { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index b80373c..45c5567 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -21,8 +21,9 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { versionSchemaSpec := ctx.Value(contextKey("VersionSchemaSpec")) versionSchemaStatus := ctx.Value(contextKey("VersionSchemaStatus")) VersionSchemaDescription := ctx.Value(contextKey("VersionSchemaDescription")).(string) + tableName := ctx.Value(contextKey("TableName")).(string) return &plugin.Table{ - Name: crdName, + Name: tableName, Description: VersionSchemaDescription + "Custom resource for " + crdName + ".", List: &plugin.ListConfig{ Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), @@ -31,7 +32,7 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { } } -func getCustomResourcesDynamicColumns(ctx context.Context, versionSchemaSpec interface{}, versionSchemaStatus interface{}) []*plugin.Column { +func getCustomResourcesDynamicColumns(_ context.Context, versionSchemaSpec interface{}, versionSchemaStatus interface{}) []*plugin.Column { columns := []*plugin.Column{} // default metadata columns From dfbf382642d0394090c57739a20f6dce8ce891cc Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Mar 2023 00:00:20 +0530 Subject: [PATCH 17/30] update --- kubernetes/plugin.go | 57 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 2451418..730fb3a 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -8,7 +8,6 @@ package kubernetes import ( "context" - "regexp" "strings" "github.com/turbot/go-kit/types" @@ -77,39 +76,39 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } // Fetch available CRDs - crds, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) + _, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) if err != nil { plugin.Logger(ctx).Error("listK8sDynamicCRDs", "crds", err) return nil, err } - for _, crd := range crds { - ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) - ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) - ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) - for _, version := range crd.Spec.Versions { - if version.Served { - ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) - if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { - ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) - ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) - if len(version.Schema.OpenAPIV3Schema.Description) > 0 { - ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), strings.TrimSuffix(version.Schema.OpenAPIV3Schema.Description, ".")+".") - } - } - } - } - - // add the tables in sneak case - re := regexp.MustCompile(`[-.]`) - if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) - tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) - } else { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) - tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) - } - } + // for _, crd := range crds { + // ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) + // ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) + // ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) + // for _, version := range crd.Spec.Versions { + // if version.Served { + // ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) + // if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { + // ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + // ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) + // if len(version.Schema.OpenAPIV3Schema.Description) > 0 { + // ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), strings.TrimSuffix(version.Schema.OpenAPIV3Schema.Description, ".")+".") + // } + // } + // } + // } + + // // add the tables in sneak case + // re := regexp.MustCompile(`[-.]`) + // if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) + // tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) + // } else { + // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) + // tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) + // } + // } return tables, nil } From 4fb1a2b5be6de9f5cf3f95b984f369864d262249 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Mar 2023 00:10:19 +0530 Subject: [PATCH 18/30] update --- kubernetes/plugin.go | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 730fb3a..ce6b7bc 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -76,39 +76,39 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } // Fetch available CRDs - _, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) + crds, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) if err != nil { plugin.Logger(ctx).Error("listK8sDynamicCRDs", "crds", err) return nil, err } - // for _, crd := range crds { - // ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) - // ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) - // ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) - // for _, version := range crd.Spec.Versions { - // if version.Served { - // ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) - // if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { - // ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) - // ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) - // if len(version.Schema.OpenAPIV3Schema.Description) > 0 { - // ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), strings.TrimSuffix(version.Schema.OpenAPIV3Schema.Description, ".")+".") - // } - // } - // } - // } - - // // add the tables in sneak case - // re := regexp.MustCompile(`[-.]`) - // if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { - // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) - // tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) - // } else { - // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) - // tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) - // } - // } + for _, crd := range crds { + ctx = context.WithValue(ctx, contextKey("CRDName"), crd.Name) + ctx = context.WithValue(ctx, contextKey("CustomResourceName"), crd.Spec.Names.Plural) + ctx = context.WithValue(ctx, contextKey("GroupName"), crd.Spec.Group) + for _, version := range crd.Spec.Versions { + if version.Served { + ctx = context.WithValue(ctx, contextKey("ActiveVersion"), version.Name) + if version.Schema != nil && version.Schema.OpenAPIV3Schema != nil { + ctx = context.WithValue(ctx, contextKey("VersionSchemaSpec"), version.Schema.OpenAPIV3Schema.Properties["spec"]) + ctx = context.WithValue(ctx, contextKey("VersionSchemaStatus"), version.Schema.OpenAPIV3Schema.Properties["status"]) + if len(version.Schema.OpenAPIV3Schema.Description) > 0 { + ctx = context.WithValue(ctx, contextKey("VersionSchemaDescription"), strings.TrimSuffix(version.Schema.OpenAPIV3Schema.Description, ".")+".") + } + } + } + } + + // add the tables in sneak case + // re := regexp.MustCompile(`[-.]`) + // if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) + // tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) + // } else { + // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) + // tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) + // } + } return tables, nil } From 7140545f979b620b51109693e90347a86f23bb4b Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Mar 2023 00:17:26 +0530 Subject: [PATCH 19/30] update --- kubernetes/plugin.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index ce6b7bc..df1a7c1 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -8,6 +8,7 @@ package kubernetes import ( "context" + "regexp" "strings" "github.com/turbot/go-kit/types" @@ -100,14 +101,15 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } // add the tables in sneak case - // re := regexp.MustCompile(`[-.]`) - // if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { - // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) - // tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) - // } else { - // ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) - // tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) - // } + re := regexp.MustCompile(`[-.]`) + plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names", crd.Spec.Names) + if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) + tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) + } else { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) + tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) + } } return tables, nil From c73c99fc037f01879b779ba094200c038c506c33 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Mar 2023 00:41:10 +0530 Subject: [PATCH 20/30] update --- kubernetes/plugin.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index df1a7c1..0eec4fd 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -102,13 +102,16 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st // add the tables in sneak case re := regexp.MustCompile(`[-.]`) - plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names", crd.Spec.Names) - if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) - tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) + // if crd.Spec.Names == nil { + // plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names_crd.Name", crd.Name) + // plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names2", crd.Spec.Names.Plural) + // } + if tables["kubernetes_"+crd.Spec.Names.Plural] == nil { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Plural) + tables["kubernetes_"+crd.Spec.Names.Plural] = tableKubernetesCustomResource(ctx) } else { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) - tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Plural+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) + tables["kubernetes_"+crd.Spec.Names.Plural+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) } } From f905a6407631564c5aeb119e4fdab6d3d09f3be6 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Wed, 1 Mar 2023 22:56:20 +0530 Subject: [PATCH 21/30] Update --- kubernetes/plugin.go | 14 +++++--------- kubernetes/table_kubernetes_custom_resource.go | 9 +++++++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 0eec4fd..2451418 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -102,16 +102,12 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st // add the tables in sneak case re := regexp.MustCompile(`[-.]`) - // if crd.Spec.Names == nil { - // plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names_crd.Name", crd.Name) - // plugin.Logger(ctx).Error("listK8sDynamicCRDs", "spec_names2", crd.Spec.Names.Plural) - // } - if tables["kubernetes_"+crd.Spec.Names.Plural] == nil { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Plural) - tables["kubernetes_"+crd.Spec.Names.Plural] = tableKubernetesCustomResource(ctx) + if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) + tables["kubernetes_"+crd.Spec.Names.Singular] = tableKubernetesCustomResource(ctx) } else { - ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Plural+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) - tables["kubernetes_"+crd.Spec.Names.Plural+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) + ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")) + tables["kubernetes_"+crd.Spec.Names.Singular+"_"+re.ReplaceAllString(crd.Spec.Group, "_")] = tableKubernetesCustomResource(ctx) } } diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 45c5567..030f5c4 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -20,11 +20,16 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { activeVersion := ctx.Value(contextKey("ActiveVersion")).(string) versionSchemaSpec := ctx.Value(contextKey("VersionSchemaSpec")) versionSchemaStatus := ctx.Value(contextKey("VersionSchemaStatus")) - VersionSchemaDescription := ctx.Value(contextKey("VersionSchemaDescription")).(string) tableName := ctx.Value(contextKey("TableName")).(string) + var description string + if ctx.Value(contextKey("VersionSchemaDescription")) == nil { + description = "Custom resource for " + crdName + "." + } else { + description = ctx.Value(contextKey("VersionSchemaDescription")).(string) + " Custom resource for " + crdName + "." + } return &plugin.Table{ Name: tableName, - Description: VersionSchemaDescription + "Custom resource for " + crdName + ".", + Description: description, List: &plugin.ListConfig{ Hydrate: listK8sCustomResources(ctx, crdName, resourceName, groupName, activeVersion), }, From 5e725de9708524467f2a39a080108d5bc7f6d980 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 11:30:48 +0530 Subject: [PATCH 22/30] Update doc --- ...name}.md => kubernetes_{custom_resource_singular_name}.md} | 4 +++- kubernetes/table_kubernetes_custom_resource.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) rename docs/tables/{kubernetes_{custom_resource_name}.md => kubernetes_{custom_resource_singular_name}.md} (99%) diff --git a/docs/tables/kubernetes_{custom_resource_name}.md b/docs/tables/kubernetes_{custom_resource_singular_name}.md similarity index 99% rename from docs/tables/kubernetes_{custom_resource_name}.md rename to docs/tables/kubernetes_{custom_resource_singular_name}.md index 819d1c0..f103bdb 100644 --- a/docs/tables/kubernetes_{custom_resource_name}.md +++ b/docs/tables/kubernetes_{custom_resource_singular_name}.md @@ -1,7 +1,9 @@ -# Table: kubernetes\_{custom_resource_name} +# Table: kubernetes\_{custom_resource_singular_name} Query data from the custom resource called `kubernetes_{custom_resource_singular_name}`, e.g., `kubernetes_certificate`, `kubernetes_capacityrequest`. A table is automatically created to represent each custom resource. +If the table name is already created in the above format and exist in the table list, then the subsequent ones will have the fully qualified name `kubernetes_{custom_resource_singular_name}_{custom_resource_group_name}`, e.g., `kubernetes_certificate_cert_manager_io`. + For instance, given the CRD `certManager.yaml`: ```yml diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 030f5c4..65a6701 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -21,6 +21,7 @@ func tableKubernetesCustomResource(ctx context.Context) *plugin.Table { versionSchemaSpec := ctx.Value(contextKey("VersionSchemaSpec")) versionSchemaStatus := ctx.Value(contextKey("VersionSchemaStatus")) tableName := ctx.Value(contextKey("TableName")).(string) + var description string if ctx.Value(contextKey("VersionSchemaDescription")) == nil { description = "Custom resource for " + crdName + "." From d823d8a98b7151722989f3e5e558042c4162c02e Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 11:31:26 +0530 Subject: [PATCH 23/30] Update doc --- docs/tables/kubernetes_{custom_resource_singular_name}.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tables/kubernetes_{custom_resource_singular_name}.md b/docs/tables/kubernetes_{custom_resource_singular_name}.md index f103bdb..009e9ac 100644 --- a/docs/tables/kubernetes_{custom_resource_singular_name}.md +++ b/docs/tables/kubernetes_{custom_resource_singular_name}.md @@ -1,4 +1,4 @@ -# Table: kubernetes\_{custom_resource_singular_name} +# Table: kubernetes_{custom_resource_singular_name} Query data from the custom resource called `kubernetes_{custom_resource_singular_name}`, e.g., `kubernetes_certificate`, `kubernetes_capacityrequest`. A table is automatically created to represent each custom resource. From 11fc4844b581eaea5d6ced2aa2996e24ce5c7176 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 13:14:52 +0530 Subject: [PATCH 24/30] Update --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 3085f8c..114a420 100644 --- a/go.mod +++ b/go.mod @@ -144,5 +144,3 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.2.0 // indirect ) - -// replace github.com/turbot/steampipe-plugin-sdk => /Users/lalitbhardwaj/Turbot/prod/steampipe-plugin-sdk From a9ac5f1bf774c3d1f85ff78468ec2f0ea8ad63a3 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 17:30:31 +0530 Subject: [PATCH 25/30] update --- docs/tables/kubernetes_{custom_resource_singular_name}.md | 7 +++---- kubernetes/plugin.go | 2 +- kubernetes/table_kubernetes_custom_resource.go | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/tables/kubernetes_{custom_resource_singular_name}.md b/docs/tables/kubernetes_{custom_resource_singular_name}.md index 009e9ac..9c3c192 100644 --- a/docs/tables/kubernetes_{custom_resource_singular_name}.md +++ b/docs/tables/kubernetes_{custom_resource_singular_name}.md @@ -1,8 +1,8 @@ -# Table: kubernetes_{custom_resource_singular_name} +# Table: kubernetes\_{custom_resource_singular_name} Query data from the custom resource called `kubernetes_{custom_resource_singular_name}`, e.g., `kubernetes_certificate`, `kubernetes_capacityrequest`. A table is automatically created to represent each custom resource. -If the table name is already created in the above format and exist in the table list, then the subsequent ones will have the fully qualified name `kubernetes_{custom_resource_singular_name}_{custom_resource_group_name}`, e.g., `kubernetes_certificate_cert_manager_io`. +If the table name is already created in the above format and exists in the table list, then the subsequent ones will have the fully qualified name `kubernetes_{custom_resource_singular_name}_{custom_resource_group_name}`, e.g., `kubernetes_certificate_cert_manager_io`. For instance, given the CRD `certManager.yaml`: @@ -14,7 +14,6 @@ metadata: labels: app: cert-manager app.kubernetes.io/name: cert-manager-crd - # Generated labels {{- include "labels" . | nindent 4 }} spec: group: cert-manager.io names: @@ -206,7 +205,7 @@ spec: description: List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`. type: array items: - description: CertificateCondition contains condition information for an Certificate. + description: CertificateCondition contains condition information for a Certificate. type: object required: - status diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 2451418..7f5e92d 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -100,7 +100,7 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } } - // add the tables in sneak case + // add the tables in snake case re := regexp.MustCompile(`[-.]`) if tables["kubernetes_"+crd.Spec.Names.Singular] == nil { ctx = context.WithValue(ctx, contextKey("TableName"), "kubernetes_"+crd.Spec.Names.Singular) diff --git a/kubernetes/table_kubernetes_custom_resource.go b/kubernetes/table_kubernetes_custom_resource.go index 65a6701..0e04652 100644 --- a/kubernetes/table_kubernetes_custom_resource.go +++ b/kubernetes/table_kubernetes_custom_resource.go @@ -132,6 +132,7 @@ func listK8sCustomResources(ctx context.Context, crdName string, resourceName st response, err := clientset.Resource(resourceId).List(ctx, metav1.ListOptions{}) if err != nil { + // Handle not found error code if strings.Contains(err.Error(), "could not find the requested resource") { return nil, nil } From 653d83bc5cbdf395f327441a1ba221222a23b024 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 17:36:41 +0530 Subject: [PATCH 26/30] update --- kubernetes/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 7f5e92d..2eda7f2 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -132,7 +132,7 @@ func listK8sDynamicCRDs(ctx context.Context, cn *connection.ConnectionCache, c * for pageLeft { response, err := clientset.ApiextensionsV1().CustomResourceDefinitions().List(ctx, input) if err != nil { - // Handle err at the plugin load time if config is not setup properly + // At the plugin load time, if the config is not setup properly, return nil if strings.Contains(err.Error(), "/apis/apiextensions.k8s.io/v1/customresourcedefinitions?limit=500") { return nil, nil } From 2f9136fd801199eb3ef6452fba5b19d124ca7aa5 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 17:50:14 +0530 Subject: [PATCH 27/30] update --- .../kubernetes_{custom_resource_singular_name}.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/tables/kubernetes_{custom_resource_singular_name}.md b/docs/tables/kubernetes_{custom_resource_singular_name}.md index 9c3c192..b609ef3 100644 --- a/docs/tables/kubernetes_{custom_resource_singular_name}.md +++ b/docs/tables/kubernetes_{custom_resource_singular_name}.md @@ -1,4 +1,4 @@ -# Table: kubernetes\_{custom_resource_singular_name} +# Table: kubernetes_{custom_resource_singular_name} Query data from the custom resource called `kubernetes_{custom_resource_singular_name}`, e.g., `kubernetes_certificate`, `kubernetes_capacityrequest`. A table is automatically created to represent each custom resource. @@ -154,7 +154,7 @@ spec: - PKCS1 - PKCS8 rotationPolicy: - description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exists but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. Default is 'Never' for backward compatibility. + description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exist but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. The Default is 'Never' for backward compatibility. type: string enum: - Never @@ -233,7 +233,7 @@ spec: - "False" - Unknown type: - description: Type of the condition, known values are (`Ready`, `Issuing`). + description: Type of the condition, known values are `Ready` and `Issuing`. type: string x-kubernetes-list-map-keys: - type @@ -285,7 +285,7 @@ spec: This plugin will automatically create a table called `kubernetes_certificate`: -``` +```bash > select name, uid, kind, api_version, namespace from kubernetes_certificate; +------------------------------------+--------------------------------------+-------------+--------------------+-----------+ | name | uid | kind | api_version | namespace | @@ -300,7 +300,7 @@ This plugin will automatically create a table called `kubernetes_certificate`: List all tables: -```sql +```bash .inspect kubernetes; +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | table | description | @@ -314,7 +314,7 @@ List all tables: To get details of a specific custom resource table, inspect it by name: -```sql +```bash .inspect kubernetes_certificate; +---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ | column | type | description | From 14dbc26e6131c92075511e93dff16b5e5b4d4f40 Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 20:01:33 +0530 Subject: [PATCH 28/30] update sdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 114a420..2a29ece 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/iancoleman/strcase v0.2.0 github.com/mitchellh/go-homedir v1.1.0 github.com/turbot/go-kit v0.5.0 - github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8 + github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0 k8s.io/api v0.25.2 k8s.io/apiextensions-apiserver v0.25.2 k8s.io/apimachinery v0.25.3 diff --git a/go.sum b/go.sum index b43c202..9b76c84 100644 --- a/go.sum +++ b/go.sum @@ -503,8 +503,8 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/turbot/go-kit v0.5.0 h1:bulbpYGyOQWt4/qFAULPBdrLis//sf3VFz5mTZelv0k= github.com/turbot/go-kit v0.5.0/go.mod h1:oP9gLk6bETL4nkEuujZZbOlcv9jnHQlf7DYcI/+Ke8Q= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8 h1:AyEJj/hji+uaLO7T1v29xjKaZF67onjpvBytmYjZazI= -github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0-rc.8/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0 h1:0ZtmYd4Tfiamt8h/33+dWyz2MqbxIMZo9YiHzNgeQnk= +github.com/turbot/steampipe-plugin-sdk/v5 v5.2.0/go.mod h1:bfvdKaLwemr13EPOMbnr7/hOQOO7m4oM7HnVMdNotgY= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 6c566fb2b60f169dc6cbe33738ad7afe5a2f14be Mon Sep 17 00:00:00 2001 From: sourav chakraborty Date: Thu, 2 Mar 2023 20:03:15 +0530 Subject: [PATCH 29/30] update --- kubernetes/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/plugin.go b/kubernetes/plugin.go index 2eda7f2..6535a0b 100644 --- a/kubernetes/plugin.go +++ b/kubernetes/plugin.go @@ -77,7 +77,7 @@ func pluginTableDefinitions(ctx context.Context, d *plugin.TableMapData) (map[st } // Fetch available CRDs - crds, err := listK8sDynamicCRDs(ctx, d.ConectionCache, d.Connection) + crds, err := listK8sDynamicCRDs(ctx, d.ConnectionCache, d.Connection) if err != nil { plugin.Logger(ctx).Error("listK8sDynamicCRDs", "crds", err) return nil, err From c4f9d5ec5357074f1468a6b1faedf221cb0ec421 Mon Sep 17 00:00:00 2001 From: Ved misra <47312748+misraved@users.noreply.github.com> Date: Thu, 2 Mar 2023 22:32:08 +0530 Subject: [PATCH 30/30] Update docs/index.md file to include custom resource definition information and examples (#114) --- docs/index.md | 379 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 378 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 289587f..443fdd7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -89,7 +89,384 @@ You can also set the kubeconfig file path and context with the `config_path` and This plugin supports querying Kubernetes clusters using [OpenID Connect](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#openid-connect-tokens) (OIDC) authentication. No extra configuration is required to query clusters using OIDC. -If no kubeconfig file is found, then the plugin will [attempt to access the API from within a pod](https://kubernetes.io/docs/tasks/run-application/access-api-from-pod/#accessing-the-api-from-within-a-pod) using the service account Kubernetes gives to pods. +If no kubeconfig file is found, then the plugin will [attempt to access the API from within a pod](https://kubernetes.io/docs/tasks/run-application/access-api-from-pod/#accessing-the-api-from-within-a-pod) using the service account Kubernetes gives to pods. + +## Custom Resource Definitions + +Kubernetes also supports creating [Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) with a name and schema that you specify which allows you to extend Kubernetes capabilities by adding any kind of API object useful for your application. + +For instance, given the CRD `certManager.yaml`: + +```yml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: certificates.cert-manager.io + labels: + app: cert-manager + app.kubernetes.io/name: cert-manager-crd +spec: + group: cert-manager.io + names: + kind: Certificate + listKind: CertificateList + plural: certificates + shortNames: + - cert + - certs + # table name - kubernetes_certificate + singular: certificate + categories: + - cert-manager + scope: Namespaced + versions: + - name: v1 + subresources: + status: {} + additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .spec.secretName + name: Secret + type: string + - jsonPath: .spec.issuerRef.name + name: Issuer + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - jsonPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + name: Age + type: date + schema: + openAPIV3Schema: + description: "A Certificate resource should be created to ensure an up to date and signed x509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`. \n The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`)." + type: object + required: + - spec + properties: + apiVersion: + description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: Desired state of the Certificate resource. + type: object + required: + - issuerRef + - secretName + properties: + additionalOutputFormats: + description: AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--feature-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. + type: array + items: + description: CertificateAdditionalOutputFormat defines an additional output format of a Certificate resource. These contain supplementary data formats of the signed certificate chain and paired private key. + type: object + required: + - type + properties: + type: + description: Type is the name of the format type that should be written to the Certificate's target Secret. + type: string + enum: + - DER + - CombinedPEM + commonName: + description: "CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4" + type: string + dnsNames: + description: DNSNames is a list of DNS subjectAltNames to be set on the Certificate. + type: array + items: + type: string + duration: + description: The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duration or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + emailAddresses: + description: EmailAddresses is a list of email subjectAltNames to be set on the Certificate. + type: array + items: + type: string + encodeUsagesInRequest: + description: EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest + type: boolean + ipAddresses: + description: IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. + type: array + items: + type: string + isCA: + description: IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`. + type: boolean + issuerRef: + description: IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to `Issuer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. If the `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The `name` field in this stanza is required at all times. + type: object + required: + - name + properties: + group: + description: Group of the resource being referred to. + type: string + kind: + description: Kind of the resource being referred to. + type: string + name: + description: Name of the resource being referred to. + type: string + keystores: + description: Keystores configures additional keystore output formats stored in the `secretName` Secret resource. + type: object + literalSubject: + description: LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://github.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. This field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject feature gate is enabled on both cert-manager controller and webhook. + type: string + privateKey: + description: Options to control private keys used for the Certificate. + type: object + properties: + algorithm: + description: Algorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either `RSA`,`Ed25519` or `ECDSA` If `algorithm` is specified and `size` is not provided, key size of 256 will be used for `ECDSA` key algorithm and key size of 2048 will be used for `RSA` key algorithm. key size is ignored when using the `Ed25519` key algorithm. + type: string + enum: + - RSA + - ECDSA + - Ed25519 + encoding: + description: The private key cryptography standards (PKCS) encoding for this certificate's private key to be encoded in. If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1 and PKCS#8, respectively. Defaults to `PKCS1` if not specified. + type: string + enum: + - PKCS1 + - PKCS8 + rotationPolicy: + description: RotationPolicy controls how private keys should be regenerated when a re-issuance is being processed. If set to Never, a private key will only be generated if one does not already exist in the target `spec.secretName`. If one does exist but it does not have the correct algorithm or size, a warning will be raised to await user intervention. If set to Always, a private key matching the specified requirements will be generated whenever a re-issuance occurs. The Default is 'Never' for backward compatibility. + type: string + enum: + - Never + - Always + size: + description: Size is the key bit size of the corresponding private key for this certificate. If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. If `algorithm` is set to `Ed25519`, Size is ignored. No other values are allowed. + type: integer + renewBefore: + description: How long before the currently issued certificate's expiry cert-manager should renew the certificate. The default is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration + type: string + revisionHistoryLimit: + description: revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certificate's history. Each revision represents a single `CertificateRequest` created by this Certificate, either when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the number of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unset (`nil`), revisions will not be garbage collected. Default value is `nil`. + type: integer + format: int32 + secretName: + description: SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer. + type: string + secretTemplate: + description: SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotations on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplate annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager sets on the Certificate's Secret. + type: object + properties: + annotations: + description: Annotations is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + labels: + description: Labels is a key value map to be copied to the target Kubernetes Secret. + type: object + additionalProperties: + type: string + uris: + description: URIs is a list of URI subjectAltNames to be set on the Certificate. + type: array + items: + type: string + usages: + description: Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` and `key encipherment` if not specified. + type: array + items: + description: "KeyUsage specifies valid usage contexts for keys. See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 https://tools.ietf.org/html/rfc5280#section-4.2.1.12 \n Valid KeyUsage values are as follows: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\"" + type: string + status: + description: Status of the Certificate. This is set and managed automatically. + type: object + properties: + conditions: + description: List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Issuing`. + type: array + items: + description: CertificateCondition contains condition information for a Certificate. + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: LastTransitionTime is the timestamp corresponding to the last status change of this condition. + type: string + format: date-time + message: + description: Message is a human readable description of the details of the last transition, complementing reason. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the Certificate. + type: integer + format: int64 + reason: + description: Reason is a brief machine readable explanation for the condition's last transition. + type: string + status: + description: Status of the condition, one of (`True`, `False`, `Unknown`). + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: Type of the condition, known values are `Ready` and `Issuing`. + type: string + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastFailureTime: + description: LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complete a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Certificate until 1 hour has elapsed from this time. + type: string + format: date-time + notAfter: + description: The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. + type: string + format: date-time + notBefore: + description: The time after which the certificate stored in the secret named by this resource in spec.secretName is valid. + type: string + format: date-time + renewalTime: + description: RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is scheduled. + type: string + format: date-time + served: true + storage: true +``` + +And the custom resource `spCloudCertificate.yaml`: + +```yml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: temporal-w-spcloud123456 + labels: + workspace-id: w_spcloud123456 + identity-id: o_spcloud123456 + region: apse1 + shard: "0001" + workspace-pluginset: "202203170111114" + app.kubernetes.io/component: steampipe-workspace-db + app.kubernetes.io/managed-by: steampipe-api + app.kubernetes.io/part-of: steampipe-cloud + app.kubernetes.io/instance: w-spcloud123456 + app.kubernetes.io/version: 0.13.3-workspace-spcloud.20220317010004 +spec: + secretName: temporal-w-spcloud123456-tls + duration: 87600h # 10 years + dnsNames: + - w-spcloud123456 +``` + +This plugin will automatically create a table called `kubernetes_certificate`: + +```bash +> select name, uid, kind, api_version, namespace from kubernetes_certificate; ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| name | uid | kind | api_version | namespace | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +| temporal-w-spcloudt6t6sk7toegg-tls | 5ccd69be-6e73-4edc-8c1d-bccd6a1e6e38 | Certificate | cert-manager.io/v1 | default | ++------------------------------------+--------------------------------------+-------------+--------------------+-----------+ +``` + +To get details of a specific custom resource table, inspect it by name: + +```bash +.inspect kubernetes_certificate; ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ +| column | type | description | ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ +| _ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | +| additional_output_formats | jsonb | AdditionalOutputFormats defines extra output formats of the private key and signed certificate chain to be | +| | | written to this Certificate's target Secret. This is an Alpha Feature and is only enabled with the `--featu | +| | | re-gates=AdditionalCertificateOutputFormats=true` option on both the controller and webhook components. | +| api_version | text | The API version of the resource. | +| common_name | text | CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 charac | +| | | ters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt n | +| | | ame is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4 | +| conditions | jsonb | List of status conditions to indicate the status of certificates. Known condition types are `Ready` and `Is | +| | | suing`. | +| creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. | +| dns_names | jsonb | DNSNames is a list of DNS subjectAltNames to be set on the Certificate. | +| duration | text | The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some | +| | | issuer types. If unset this defaults to 90 days. Certificate will be renewed either 2/3 through its duratio | +| | |n or `renewBefore` period before its expiry, whichever is later. Minimum accepted duration is 1 hour. Value | +| | | must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| email_addresses | jsonb | EmailAddresses is a list of email subjectAltNames to be set on the Certificate. | +| encode_usages_in_request | boolean | EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest | +| ip_addresses | jsonb | IPAddresses is a list of IP address subjectAltNames to be set on the Certificate. | +| is_ca | boolean | IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sig | +| | | n` usage to the list of `usages`. | +| issuer_ref | jsonb | IssuerRef is a reference to the issuer for this certificate. If the `kind` field is not set, or set to `Iss | +| | | uer`, an Issuer resource with the given name in the same namespace as the Certificate will be used. If the | +| | | `kind` field is set to `ClusterIssuer`, a ClusterIssuer with the provided name will be used. The `name` fie | +| | | ld in this stanza is required at all times. | +| keystores | jsonb | Keystores configures additional keystore output formats stored in the `secretName` Secret resource. | +| kind | text | Type of resource. | +| labels | jsonb | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May m | +| | | atch selectors of replication controllers and services. | +| last_failure_time | text | LastFailureTime is the time as recorded by the Certificate controller of the most recent failure to complet | +| | | e a CertificateRequest for this Certificate resource. If set, cert-manager will not re-request another Cert | +| | | ificate until 1 hour has elapsed from this time. | +| literal_subject | text | LiteralSubject is an LDAP formatted string that represents the [X.509 Subject field](https://datatracker.ie | +| | | tf.org/doc/html/rfc5280#section-4.1.2.6). Use this *instead* of the Subject field if you need to ensure the | +| | | correct ordering of the RDN sequence, such as when issuing certs for LDAP authentication. See https://gith | +| | | ub.com/cert-manager/cert-manager/issues/3203, https://github.com/cert-manager/cert-manager/issues/4424. Thi | +| | | s field is alpha level and is only supported by cert-manager installations where LiteralCertificateSubject | +| | | feature gate is enabled on both cert-manager controller and webhook. | +| name | text | Name of resource. | +| namespace | text | Namespace defines the space within which each name must be unique. | +| not_after | text | The expiration time of the certificate stored in the secret named by this resource in `spec.secretName`. | +| not_before | text | The time after which the certificate stored in the secret named by this resource in spec.secretName is vali | +| | | d. | +| private_key | jsonb | Options to control private keys used for the Certificate. | +| renew_before | text | How long before the currently issued certificate's expiry cert-manager should renew the certificate. The de | +| | | fault is 2/3 of the issued certificate's duration. Minimum accepted value is 5 minutes. Value must be in un | +| | | its accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration | +| renewal_time | text | RenewalTime is the time at which the certificate will be next renewed. If not set, no upcoming renewal is s | +| | | cheduled. | +| revision_history_limit | bigint | revisionHistoryLimit is the maximum number of CertificateRequest revisions that are maintained in the Certi | +| | | ficate's history. Each revision represents a single `CertificateRequest` created by this Certificate, eithe | +| | | r when it was created, renewed, or Spec was changed. Revisions will be removed by oldest first if the numbe | +| | | r of revisions exceeds this number. If set, revisionHistoryLimit must be a value of `1` or greater. If unse | +| | | t (`nil`), revisions will not be garbage collected. Default value is `nil`. | +| secret_name | text | SecretName is the name of the secret resource that will be automatically created and managed by this Certif | +| | | icate resource. It will be populated with a private key and certificate, signed by the denoted issuer. | +| secret_template | jsonb | SecretTemplate defines annotations and labels to be copied to the Certificate's Secret. Labels and annotati | +| | | ons on the Secret will be changed as they appear on the SecretTemplate when added or removed. SecretTemplat | +| | | e annotations are added in conjunction with, and cannot overwrite, the base set of annotations cert-manager | +| | | sets on the Certificate's Secret. | +| uid | text | UID is the unique in time and space value for this object. | +| uris | jsonb | URIs is a list of URI subjectAltNames to be set on the Certificate. | +| usages | jsonb | Usages is the set of x509 usages that are requested for the certificate. Defaults to `digital signature` an | +| | | d `key encipherment` if not specified. | ++---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------+ +``` + +This table can also be queried like other tables: + +```sql +select + * +from + kubernetes_certificate; +``` ## Get involved