From f76e9d27f0ae57234a53d1d68d4e7622432b371a Mon Sep 17 00:00:00 2001 From: Matt Conway Date: Wed, 16 Jun 2021 11:39:35 -0400 Subject: [PATCH] Major refactoring to allow using a template for the entire kuberenetes resources (ConfigMaps/Secrets/others) created for each project. --- Dockerfile | 18 +- Gemfile.lock | 42 +- README.md | 138 ++- exe/kubetruth | 1 + helm/helmv2/templates/projectmapping.yaml | 27 +- helm/kubetruth/crds/projectmapping.yaml | 27 +- helm/kubetruth/templates/clusterrole.yaml | 4 +- helm/kubetruth/values.yaml | 38 +- lib/kubetruth.rb | 11 +- lib/kubetruth/cli.rb | 14 +- lib/kubetruth/config.rb | 76 +- lib/kubetruth/ctapi.rb | 3 +- lib/kubetruth/etl.rb | 255 ++-- lib/kubetruth/kubeapi.rb | 88 +- lib/kubetruth/logging.rb | 6 +- lib/kubetruth/parameter.rb | 4 +- lib/kubetruth/project.rb | 142 +++ lib/kubetruth/template.rb | 51 +- lib/kubetruth/version.rb | 2 +- .../creates_a_resource_from_hash.yml | 129 ++ ...ates_a_resource_using_client_namespace.yml | 129 ++ ...es_a_resource_with_supplied_namespace.yml} | 150 ++- .../creates_other_types_of_resources.yml | 129 ++ ...up_management_when_creating_a_resource.yml | 129 ++ .../configmaps/can_crud_config_maps.yml | 417 ------- ...se_multiple_namespaces_for_config_maps.yml | 1001 ---------------- .../sets_labels_when_creating_config_maps.yml | 170 --- .../can_get_project_mappings.yml | 47 +- .../creates_namespace_if_not_present.yml | 130 +-- .../sets_labels_when_creating_namespace.yml | 68 +- .../gets_existing_resource.yml} | 179 +-- .../raise_when_resource_doesn_t_exist.yml | 45 + .../secrets/can_crud_secrets.yml | 415 ------- ...an_use_multiple_namespaces_for_secrets.yml | 1037 ----------------- .../sets_labels_when_creating_secrets.yml | 168 --- spec/kubetruth/cli_spec.rb | 21 +- spec/kubetruth/config_spec.rb | 76 +- spec/kubetruth/etl_spec.rb | 629 ++++------ spec/kubetruth/kubeapi_spec.rb | 214 ++-- spec/kubetruth/logging_spec.rb | 4 +- spec/kubetruth/parameter_spec.rb | 18 + spec/kubetruth/project_spec.rb | 275 +++++ spec/kubetruth/template_spec.rb | 73 ++ spec/spec_helper.rb | 3 - 44 files changed, 2019 insertions(+), 4584 deletions(-) create mode 100644 lib/kubetruth/project.rb create mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_from_hash.yml create mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_using_client_namespace.yml rename spec/fixtures/vcr/Kubetruth_KubeApi/{configmaps/sets_labels_when_updating_config_maps.yml => apply_resource/creates_a_resource_with_supplied_namespace.yml} (63%) create mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_other_types_of_resources.yml create mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/sets_up_management_when_creating_a_resource.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_crud_config_maps.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_use_multiple_namespaces_for_config_maps.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_creating_config_maps.yml rename spec/fixtures/vcr/Kubetruth_KubeApi/{secrets/sets_labels_when_updating_secrets.yml => get_resource/gets_existing_resource.yml} (54%) create mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/raise_when_resource_doesn_t_exist.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_crud_secrets.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_use_multiple_namespaces_for_secrets.yml delete mode 100644 spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_creating_secrets.yml create mode 100644 spec/kubetruth/parameter_spec.rb create mode 100644 spec/kubetruth/project_spec.rb diff --git a/Dockerfile b/Dockerfile index 9920e13..495492c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,16 +23,16 @@ FROM base as build COPY Gemfile* *.gemspec $APP_DIR/ COPY lib/kubetruth/version.rb $APP_DIR/lib/kubetruth/ -RUN apk --update upgrade && \ - apk add \ +RUN apk add --no-cache \ --virtual app \ $APP_PACKAGES && \ - apk add \ + apk add --no-cache \ --virtual build_deps \ $BUILD_PACKAGES && \ bundle install && \ - apk del build_deps && \ - rm -rf /var/cache/apk/* + apk del build_deps + +RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing kubectl COPY . $APP_DIR/ RUN bundle config set deployment 'true' && \ @@ -41,11 +41,11 @@ RUN bundle config set deployment 'true' && \ FROM base AS release -RUN apk --update upgrade && \ - apk add \ +RUN apk add --no-cache \ --virtual app \ - $RELEASE_PACKAGES && \ - rm -rf /var/cache/apk/* + $RELEASE_PACKAGES + +RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing kubectl COPY --from=build $BUNDLE_PATH $BUNDLE_PATH COPY --from=build $APP_DIR $APP_DIR diff --git a/Gemfile.lock b/Gemfile.lock index 5bdb946..1c518f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,19 +26,20 @@ GEM codecov (0.5.2) simplecov (>= 0.15, < 0.22) coderay (1.1.3) - concurrent-ruby (1.1.8) - crack (0.4.4) + concurrent-ruby (1.1.9) + crack (0.4.5) + rexml diff-lcs (1.4.4) - docile (1.3.2) + docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - ffi (1.15.0) + ffi (1.15.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake gem_logger (0.3.0) activesupport - graphql (1.12.10) + graphql (1.12.12) graphql-client (0.16.0) activesupport (>= 3.0) graphql (~> 1.8) @@ -49,17 +50,16 @@ GEM http-form_data (~> 2.2) http-parser (~> 1.2.0) http-accept (1.7.0) - http-cookie (1.0.3) + http-cookie (1.0.4) domain_name (~> 0.5) http-form_data (2.3.0) http-parser (1.2.3) ffi-compiler (>= 1.0, < 2.0) i18n (1.8.10) concurrent-ruby (~> 1.0) - json (2.3.1) jsonpath (1.1.0) multi_json - kubeclient (4.9.1) + kubeclient (4.9.2) http (>= 3.0, < 5.0) jsonpath (~> 1.0) recursive-open-struct (~> 1.1, >= 1.1.1) @@ -76,12 +76,12 @@ GEM minitest (5.14.4) multi_json (1.15.0) netrc (0.11.0) - pry (0.13.1) + pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.9.0) + pry-byebug (3.8.0) byebug (~> 11.0) - pry (~> 0.13.0) + pry (~> 0.10) public_suffix (4.0.6) rake (12.3.3) recursive-open-struct (1.1.3) @@ -90,31 +90,33 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rexml (3.2.5) rspec (3.10.0) rspec-core (~> 3.10.0) rspec-expectations (~> 3.10.0) rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) + rspec-core (3.10.1) rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-support (3.10.0) - simplecov (0.16.1) + rspec-support (3.10.2) + simplecov (0.21.2) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.3) tzinfo (2.0.4) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.7.7) vcr (6.0.0) - webmock (3.10.0) + webmock (3.13.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/README.md b/README.md index 24eb146..234d52a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ [![Build Status](https://github.com/cloudtruth/kubetruth/workflows/CD/badge.svg)](https://github.com/cloudtruth/kubetruth/actions) [![Coverage Status](https://codecov.io/gh/cloudtruth/kubetruth/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudtruth/kubetruth) +[![Configured by CloudTruth](https://img.shields.io/badge/configured--by-CloudTruth-blue.svg?style=plastic&labelColor=384047&color=00A6C0&link=https://cloudtruth.com)](https://cloudtruth.com) # Kubetruth The CloudTruth integration for kubernetes that pushes parameter updates into -kubernetes config maps and secrets. The goal is to provide you a mechanism that -is as hands off as possible, using naming conventions to automate the delivery -of configuration so that you don't have to jump through setup hoops for each -app/service/etc that you would like to configure with cloudtruth +kubernetes resources (usually config maps and secrets). The goal is to provide +you a mechanism that is as hands off as possible, using naming conventions to +automate the delivery of configuration so that you don't have to jump through +setup hoops for each app/service/etc that you would like to configure with +CloudTruth ## Installation @@ -37,26 +39,22 @@ Parameterize the helm install with `--set appSettings.**` to control how kubetru | Parameter | Description | Type | Default | Required | |-----------|-------------|------|---------|:--------:| -| appSettings.apiKey | The cloudtruth api key. Read only access is sufficient | string | n/a | yes | -| appSettings.environment | The cloudtruth environment to lookup parameter values for. Use a separate helm install for each environment | string | `default` | yes | -| appSettings.pollingInterval | Interval to poll cloudtruth api for changes | integer | 300 | no | -| appSettings.noMetadata | Do not write cloudtruth metadata (e.g. param value origins) to kubernetes resources | flag | false | no | -| appSettings.debug | Debug logging | flag | false | no | +| appSettings.apiKey | The CloudTruth api key. Read only access is sufficient | string | n/a | yes | +| appSettings.environment | The CloudTruth environment to lookup parameter values for. Use a separate helm install for each environment | string | `default` | yes | +| appSettings.pollingInterval | Interval to poll CloudTruth api for changes | integer | 300 | no | +| appSettings.debug | Debug logging and behavior | flag | false | no | | projectMappings.root.project_selector | A regexp to limit the projects acted against (client-side). Supplies any named matches for template evaluation | string | "" | no | | projectMappings.root.key_selector | A regexp to limit the keys acted against (client-side). Supplies any named matches for template evaluation | string | "" | no | -| projectMappings.root.key_filter | Limits the keys fetched to contain the given substring (server-side, api search param) | string | "" | no | -| projectMappings.root.configmap_name_template | The template to use in generating ConfigMap names | string | "{{project \| dns_safe}}" | no | -| projectMappings.root.secret_name_template | The template to use in generating Secret names | string | "{{project \| dns_safe}}" | no | -| projectMappings.root.namespace_template | The template to use in generating namespace names | string | "" | no | -| projectMappings.root.key_template | The template to use in generating key names | string | "{{key}}" | no | | projectMappings.root.skip | Skips the generation of resources for the selected projects | flag | false | no | | projectMappings.root.skip_secrets | Prevent transfer of secrets to kubernetes Secrets | flag | false | no | -| projectMappings.root.included_projects | Include the parameters from other projects into the selected ones. This is non-recursive, so if A imports B and B imports C, then A will only get B's parameters. For key conflicts, if A includes [B, C], then the precendence is A overrides C overrides B. | list | [] | no | +| projectMappings.root.included_projects | Include the parameters from other projects into the selected ones. This can be recursive in a depth first fashion, so if A imports B and B imports C, then A will get B's and C's parameters. For key conflicts, if A includes B and B includes C, then the precendence is A overrides B overrides C. If A includes \[B, C], then the precendence is A overrides C overrides B. | list | [] | no | +| projectMappings.root.configmap_template | The template to use in generating a kubernetes resource (ConfigMap) for non-secret parameters | string | [default](helm/kubetruth/values.yaml#L94-L108) | no | +| projectMappings.root.secret_template | The template to use in generating a kubernetes resource (Secret) for secret parameters | string | [default](helm/kubetruth/values.yaml#L110-L124) | no | | projectMappings..* | Define override mappings to override settings from the root selector for specific projects. When doing this on the command-line (e.g. for `helm install`), it may be more convenient to use `--values ` instead of `--set` for large data sets | map | {} | no | By default, Kubetruth maps the parameters from CloudTruth Projects into ConfigMaps and Secrets of the same names as the Projects. Kubetruth will not -overwrite any existing ConfigMaps and Secrets that do not have the label +overwrite any existing kubernetes resources that do not have the label `app.kubernetes.io/managed-by: kubetruth`. If you have some that you want kubetruth to manage, then either add the label or delete them manually. @@ -119,8 +117,8 @@ To use them as files on disk in a pod: Note that config map updates don't get seen by a running pod. You can use something like [Reloader](https://github.com/stakater/Reloader) to automate -this, or read config from mounted volumes for configmaps/secrets, which do get -updated automatically in a running pod. +restarting the pod on a ConfigMap change, or read config from mounted volumes +for configmaps/secrets, which do get updated automatically in a running pod. ## Additional configuration @@ -131,34 +129,47 @@ by the `scope` property, the `root` scope and the `override` scope. The `root` scope is required, and there can be only one. It sets up the global behavior for mapping the CloudTruth projects to kubernetes resources. You can edit it in the standard ways, e.g. `kubectl edit projectmapping kubetruth-root`. The -`override` scope allows you to override the root scope's behavior by matching -its `project_selector` pattern against the CloudTruth project names already -selected by the root `project_selector`. +`override` scope allows you to override the root scope's behavior for those +CloudTruth projects whose names match its `project_selector` pattern. Note that Kubetruth watches for changes to ProjectMappings, so touching any of them wakes it up from a polling sleep. This makes it quick and easy to test out configuration changes without having a short polling interval. -To customize how things are named, edit the `*_template` properties in the +To customize how the kubernetes resources are generated, edit the `*_template` properties in the ProjectMappings. These templates are processed using the [Liquid template -language](https://shopify.github.io/liquid/), and can reference the `project` -the `key` or any other named references from the `_selector` regexes. In -addition to the built in liquid filters, kubetruth also define a few custom -ones: +language](https://shopify.github.io/liquid/), and can reference the following liquid variables: + + * `project` - The project name + * `project_heirarchy` - The `included_projects` tree this project includes (useful to debug when using complex `included_projects`) + * `parameters` - The CloudTruth parameters from the project + * `parameter_origins` - The projects each parameter originates from (useful to debug when using complex `included_projects`) + * `debug` - Indicates if kubetruth is operating in debug (logging) mode. - * dns_safe - ensures the string is safe for use as a kubernetes resource name (i.e. Namespace/ConfigMap/Secret names) - * env_safe - ensures the string is safe for setting as a shell environment variable +In addition to the built in liquid filters, kubetruth also define a few custom +ones: -By default, kubetruth will add the `cloudtruth_metadata` key to each ConfigMap -and Secret under management. This can be disabled with the `noMetadata` helm -setting at install time. The data contained by this key helps to illustrate how -project inclusion affects the project the resources were written for. It -currently shows the project heirarchy and the project each parameter originates -from, for example an entry like `timeout: myService (commonService -> common)` -indicates that the timeout parameter is getting its value from the `myService` -project, and if you removed it from there, it would then get it from the -`commonService` project, and if you removed that, it would then get it from the -`common` project. + * `dns_safe` - Ensures the string is safe for use as a kubernetes resource name (i.e. Namespace/ConfigMap/Secret names) + * `env_safe` - Ensures the string is safe for setting as a shell environment variable + * `indent: count` - Indents each line in the argument by count spaces + * `nindent: count` - Adds a leading newline, then indents each line in the argument by count spaces + * `stringify` - Converts argument to a staring safe to use in yaml (escapes quotes and surrounds with the quote character) + * `to_yaml` - Converts argument to a yaml representation + * `to_json` - Converts argument to a json representation + * `encode64` - The argument bas64 encoded + * `decode64` - The argument bas64 decoded + * `sha256` - The sha256 digest of the argument + +The default `*_template`s add the `parameter_origins` and `project_heirarchy` +key as annotations on each kubernetes resource under management. This can be +disabled by removing them from the template, or wrapping them in a test for +`debug`. The data produced by these help to illustrate how project inclusion +affects the project the resources were written for. It currently shows the +project heirarchy and the project each parameter originates from, for example an +entry like `timeout: myService (commonService -> common)` indicates that the +timeout parameter is getting its value from the `myService` project, and if you +removed it from there, it would then get it from the `commonService` project, +and if you removed that, it would then get it from the `common` project. ### Example Config @@ -168,15 +179,29 @@ The `projectmapping` resource has a shortname of `pm` for convenience when using To create kubernetes Resources in namespaces named after each Project: ``` -kubectl patch pm kubetruth-root --type json --patch '[{"op": "replace", "path": "/spec/namespace_template", "value": "{{project | dns_safe}}"}]' +kubectl edit pm kubetruth-root +``` +and add the metadata.namespace field to configmap_template and secret_template like so: +```yaml +spec: + configmap_template: | + apiVersion: v1 + kind: ConfigMap + metadata: + namespace: {{ project | dns_safe }} ``` #### Share common data To include the parameters from a Project named `Base` into all other projects, without creating Resources for `Base` itself: ``` +# Set the included_project in the root mapping kubectl patch pm kubetruth-root --type json --patch '[{"op": "replace", "path": "/spec/included_projects", "value": ["Base"]}]' +# Either exclude the Base project from being matched in the root mapping: +kubectl patch pm kubetruth-root --type json --patch '[{"op": "replace", "path": "/spec/project_selector", "value": "^(?!Base)"}]' + +# OR exclude the Base project by creating an override mapping that skips it: kubectl apply -f - < + secret_template: | + apiVersion: v1 + kind: Secret + metadata: + namespace: notSoFunkyNamespace + name: notSoFunkySecret + EOF ``` @@ -243,21 +277,21 @@ Annotations: ... API Version: kubetruth.cloudtruth.com/v1 Kind: ProjectMapping Metadata: - ... + Spec: - configmap_name_template: {{project}} + configmap_template: | + + secret_template: | + included_projects: - key_filter: key_selector: - key_template: {{key}} - namespace_template: project_selector: - Scope: root - secret_name_template: {{project}} - Skip: false + scope: root + skip: false skip_secrets: false Events: ``` + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. diff --git a/exe/kubetruth b/exe/kubetruth index 83473cf..0823abf 100755 --- a/exe/kubetruth +++ b/exe/kubetruth @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +require_relative "../lib/kubetruth" require_relative '../lib/kubetruth/cli' Kubetruth::CLI.run diff --git a/helm/helmv2/templates/projectmapping.yaml b/helm/helmv2/templates/projectmapping.yaml index bec7263..f08d6fc 100644 --- a/helm/helmv2/templates/projectmapping.yaml +++ b/helm/helmv2/templates/projectmapping.yaml @@ -20,25 +20,10 @@ spec: enum: ["root", "override"] project_selector: type: string - description: A regexp to limit the projects acted against (client-side). Supplies any named matches for template evaluation + description: A regexp to limit the projects acted against key_selector: type: string - description: A regexp to limit the keys acted against (client-side). Supplies any named matches for template evaluation - key_filter: - type: string - description: Limits the keys fetched to contain the given substring (server-side, api search param) - configmap_name_template: - type: string - description: The template to use in generating ConfigMap names - secret_name_template: - type: string - description: The template to use in generating Secret names - namespace_template: - type: string - description: The template to use in generating namespace names - key_template: - type: string - description: The template to use in generating key names + description: A regexp to limit the keys acted against skip: type: boolean description: Skips the generation of resources for the selected projects. Useful for excluding projects that should only be included into others. @@ -49,7 +34,13 @@ spec: type: array items: type: string - description: Include the parameters from other projects into the selected ones + description: Include the parameters from other projects into the selected ones. This can be recursive in a depth first fashion, so if A imports B and B imports C, then A will get B's and C's parameters. For key conflicts, if A includes B and B includes C, then the precendence is A overrides B overrides C. If A includes [B, C], then the precendence is A overrides C overrides B. + configmap_template: + type: string + description: The template to use in generating a kubernetes resource (ConfigMap) for non-secret parameters + secret_template: + type: string + description: The template to use in generating a kubernetes resource (Secret) for secret parameters additionalPrinterColumns: - name: Scope type: string diff --git a/helm/kubetruth/crds/projectmapping.yaml b/helm/kubetruth/crds/projectmapping.yaml index 4b0d858..df95369 100644 --- a/helm/kubetruth/crds/projectmapping.yaml +++ b/helm/kubetruth/crds/projectmapping.yaml @@ -22,25 +22,10 @@ spec: default: "override" project_selector: type: string - description: A regexp to limit the projects acted against (client-side). Supplies any named matches for template evaluation + description: A regexp to limit the projects acted against key_selector: type: string - description: A regexp to limit the keys acted against (client-side). Supplies any named matches for template evaluation - key_filter: - type: string - description: Limits the keys fetched to contain the given substring (server-side, api search param) - configmap_name_template: - type: string - description: The template to use in generating ConfigMap names - secret_name_template: - type: string - description: The template to use in generating Secret names - namespace_template: - type: string - description: The template to use in generating namespace names - key_template: - type: string - description: The template to use in generating key names + description: A regexp to limit the keys acted against skip: type: boolean description: Skips the generation of resources for the selected projects @@ -51,7 +36,13 @@ spec: type: array items: type: string - description: Include the parameters from other projects into the selected ones. This is non-recursive, so if A imports B and B imports C, then A will only get B's parameters. For key conflicts, if A includes [B, C], then the precendence is A overrides C overrides B. + description: Include the parameters from other projects into the selected ones. This can be recursive in a depth first fashion, so if A imports B and B imports C, then A will get B's and C's parameters. For key conflicts, if A includes B and B includes C, then the precendence is A overrides B overrides C. If A includes [B, C], then the precendence is A overrides C overrides B. + configmap_template: + type: string + description: The template to use in generating a kubernetes resource (ConfigMap) for non-secret parameters + secret_template: + type: string + description: The template to use in generating a kubernetes resource (Secret) for secret parameters required: - scope additionalPrinterColumns: diff --git a/helm/kubetruth/templates/clusterrole.yaml b/helm/kubetruth/templates/clusterrole.yaml index f0fd29f..7e83e47 100644 --- a/helm/kubetruth/templates/clusterrole.yaml +++ b/helm/kubetruth/templates/clusterrole.yaml @@ -6,10 +6,10 @@ metadata: rules: - apiGroups: [""] resources: ["configmaps"] - verbs: ["get", "list", "create", "update", "delete"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: [""] resources: ["secrets"] - verbs: ["get", "list", "create", "update", "delete"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: [""] resources: ["namespaces"] verbs: ["get", "list", "create"] diff --git a/helm/kubetruth/values.yaml b/helm/kubetruth/values.yaml index 02c5244..6399024 100644 --- a/helm/kubetruth/values.yaml +++ b/helm/kubetruth/values.yaml @@ -69,7 +69,6 @@ affinity: {} appSettings: apiKey: environment: - noMetadata: false pollingInterval: debug: false @@ -88,11 +87,38 @@ projectMappings: scope: "root" project_selector: "" key_selector: "" - key_filter: "" - configmap_name_template: "{{project | dns_safe}}" - secret_name_template: "{{project | dns_safe}}" - namespace_template: "" - key_template: "{{key}}" skip: false skip_secrets: false included_projects: [] + configmap_template: | + apiVersion: v1 + kind: ConfigMap + metadata: + name: "{{ project | dns_safe }}" + labels: + version: "{{ parameters | sort | to_json | sha256 | slice: 0, 7 }}" + annotations: + kubetruth/project_heirarchy: | + {{ project_heirarchy | to_yaml | indent: 6 | lstrip }} + kubtruth/parameter_origins: | + {{ parameter_origins | to_yaml | indent: 6 | lstrip }} + data: + {% for parameter in parameters %} + {{ parameter[0] | stringify }}: {{ parameter[1] | stringify }} + {% endfor %} + secret_template: | + apiVersion: v1 + kind: Secret + metadata: + name: "{{ project | dns_safe }}" + labels: + version: "{{ parameters | sort | to_json | sha256 | slice: 0, 7 }}" + annotations: + kubetruth/project_heirarchy: | + {{ project_heirarchy | to_yaml | indent: 6 | lstrip }} + kubtruth/parameter_origins: | + {{ parameter_origins | to_yaml | indent: 6 | lstrip }} + data: + {% for parameter in parameters %} + {{ parameter[0] | stringify }}: {{ parameter[1] | encode64 | stringify }} + {% endfor %} diff --git a/lib/kubetruth.rb b/lib/kubetruth.rb index 1570631..d146c1f 100644 --- a/lib/kubetruth.rb +++ b/lib/kubetruth.rb @@ -1,4 +1,13 @@ -require "kubetruth/version" +require 'active_support/core_ext/hash/keys' +require 'active_support/core_ext/string/inflections' +# prevent our use of ActiveSupport causing an error with json adapters +require 'active_support/json' + +require_relative 'kubetruth/logging' +# Need to setup logging before loading any other files +Kubetruth::Logging.setup_logging(level: :info, color: false) + +require_relative "kubetruth/version" module Kubetruth class Error < StandardError; end diff --git a/lib/kubetruth/cli.rb b/lib/kubetruth/cli.rb index 1419e8a..fa684d8 100755 --- a/lib/kubetruth/cli.rb +++ b/lib/kubetruth/cli.rb @@ -1,9 +1,6 @@ -require_relative 'logging' -# Need to setup logging before loading any other files -Kubetruth::Logging.setup_logging(level: :info, color: false) - -require_relative 'etl' require 'clamp' +require_relative 'project' +require_relative 'etl' module Kubetruth class CLI < Clamp::Command @@ -42,10 +39,6 @@ class CLI < Clamp::Command Integer(a) end - option "--[no-]metadata", - :flag, "Saves additional cloudtruth metadata in the kubernetes resources, e.g. the project origin for param values after inclusions/overrides are applied", - default: true - option ["-n", "--dry-run"], :flag, "Perform a dry run", default: false @@ -96,7 +89,8 @@ def execute api_url: kube_url } - etl = ETL.new(ct_context: ct_context, kube_context: kube_context, dry_run: dry_run?, metadata: metadata?) + Project.ctapi_context = ct_context + etl = ETL.new(kube_context: kube_context, dry_run: dry_run?) etl.with_polling(polling_interval) do etl.apply diff --git a/lib/kubetruth/config.rb b/lib/kubetruth/config.rb index 28c500c..ab856f3 100644 --- a/lib/kubetruth/config.rb +++ b/lib/kubetruth/config.rb @@ -1,4 +1,3 @@ -require_relative 'logging' require_relative 'template' module Kubetruth @@ -6,52 +5,55 @@ class Config include GemLogger::LoggerSupport + class DuplicateSelection < Kubetruth::Error; end + ProjectSpec = Struct.new( :scope, :project_selector, :key_selector, - :key_filter, - :configmap_name_template, - :secret_name_template, - :namespace_template, - :key_template, :skip, :skip_secrets, :included_projects, + :configmap_template, + :secret_template, keyword_init: true - ) + ) do + + def initialize(*args, **kwargs) + super(*args, **convert_types(kwargs)) + end + + def convert_types(hash) + selector_key_pattern = /_selector$/ + template_key_pattern = /_template$/ + hash.merge(hash) do |k, v| + case k + when selector_key_pattern + Regexp.new(v) + when template_key_pattern + Kubetruth::Template.new(v) + else + v + end + end + end + + end DEFAULT_SPEC = { scope: 'override', project_selector: '', key_selector: '', - key_filter: '', - configmap_name_template: '{{project | dns_safe}}', - secret_name_template: '{{project | dns_safe}}', - namespace_template: '', - key_template: '{{key}}', skip: false, skip_secrets: false, - included_projects: [] + included_projects: [], + configmap_template: "", + secret_template: "" }.freeze def initialize(project_mapping_crds) @project_mapping_crds = project_mapping_crds - end - - def convert_types(hash) - selector_key_pattern = /_selector$/ - template_key_pattern = /_template$/ - hash.merge(hash) do |k, v| - case k - when selector_key_pattern - Regexp.new(v) - when template_key_pattern - Kubetruth::Template.new(v) - else - v - end - end + @spec_mapping = {} end def load @@ -63,8 +65,8 @@ def load overrides = parts["override"] || [] config = DEFAULT_SPEC.merge(root_mapping) - @root_spec = ProjectSpec.new(**convert_types(config)) - @override_specs = overrides.collect { |o| ProjectSpec.new(**convert_types(config.merge(o))) } + @root_spec = ProjectSpec.new(**config) + @override_specs = overrides.collect { |o| ProjectSpec.new(**config.merge(o)) } config end end @@ -80,18 +82,24 @@ def override_specs end def spec_for_project(project_name) - spec = nil + spec = @spec_mapping[project_name] + return spec unless spec.nil? + specs = override_specs.find_all { |o| project_name =~ o.project_selector } case specs.size when 0 spec = root_spec + logger.debug {"Using root spec for project '#{project_name}'"} when 1 spec = specs.first + logger.debug {"Using override spec '#{spec.project_selector}' for project '#{project_name}'"} else - logger.warn "Multiple configuration specs match the project '#{project_name}', using first: #{specs.collect(&:project_selector).inspect}" - spec = specs.first + dupes = specs.collect {|s| "'#{s.project_selector}'" } + raise DuplicateSelection, "Multiple configuration specs (#{dupes.inspect}) match the project '#{project_name}': }" end - spec + + @spec_mapping[project_name] = spec + return spec end end diff --git a/lib/kubetruth/ctapi.rb b/lib/kubetruth/ctapi.rb index 28e888a..eeea68c 100644 --- a/lib/kubetruth/ctapi.rb +++ b/lib/kubetruth/ctapi.rb @@ -1,7 +1,6 @@ -require_relative 'logging' -require_relative 'parameter' require "graphql/client" require "graphql/client/http" +require_relative 'parameter' module Kubetruth diff --git a/lib/kubetruth/etl.rb b/lib/kubetruth/etl.rb index 8efb446..982612b 100644 --- a/lib/kubetruth/etl.rb +++ b/lib/kubetruth/etl.rb @@ -1,33 +1,20 @@ -require_relative 'logging' +require 'benchmark' require_relative 'config' require_relative 'ctapi' require_relative 'kubeapi' -require 'active_support/core_ext/hash/keys' -require 'benchmark' +require_relative 'project' module Kubetruth class ETL include GemLogger::LoggerSupport - def initialize(ct_context:, kube_context:, dry_run: false, metadata: true) - @ct_context = ct_context + def initialize(kube_context:, dry_run: false) @kube_context = kube_context @dry_run = dry_run - @metadata = metadata - @kubeapis = {} end - def ctapi - @ctapi ||= begin - ctx = @ct_context.dup - @ctapi_class = Kubetruth::CtApi(api_key: ctx.delete(:api_key), api_url: ctx.delete(:api_url)) - @ctapi_class.new(**ctx) - end - end - - def kubeapi(namespace) - namespace = namespace.present? ? namespace : nil - @kubeapis[namespace] ||= KubeApi.new(**@kube_context.merge(namespace: namespace)) + def kubeapi + @kubeapi ||= KubeApi.new(**@kube_context) end def interruptible_sleep(interval) @@ -43,7 +30,7 @@ def with_polling(interval, &block) while true begin - watcher = kubeapi(@kube_context[:namespace]).watch_project_mappings + watcher = kubeapi.watch_project_mappings begin thr = Thread.new do @@ -82,208 +69,116 @@ def with_polling(interval, &block) end def load_config - mappings = kubeapi(@kube_context[:namespace]).get_project_mappings + mappings = kubeapi.get_project_mappings Kubetruth::Config.new(mappings) end def apply logger.warn("Performing dry-run") if @dry_run + Project.reset config = load_config - projects = ctapi.project_names - project_data = {} - - projects.each do |project| - - project_spec = config.spec_for_project(project) - - match = project.match(config.root_spec.project_selector) - if match.nil? - logger.info "Project '#{project}' does not match root selector #{config.root_spec.project_selector.inspect}" - next - else - logger.info "Project '#{project}' matches root selector #{config.root_spec.project_selector.inspect}" + # Load all projects that are used + all_specs = [config.root_spec] + config.override_specs + project_selectors = all_specs.collect(&:project_selector) + included_projects = all_specs.collect(&:included_projects).flatten.uniq + + Project.names.each do |project_name| + active = included_projects.any? {|p| p == project_name } + active ||= project_selectors.any? {|s| s =~ project_name } + if active + project_spec = config.spec_for_project(project_name) + Project.create(name: project_name, spec: project_spec) end - matches_hash = match.named_captures.symbolize_keys - - # Add in matches from project specific selector, the match will always - # succeed as the spec is either the root spec, or its project_selector - # has already matched - match = project.match(project_spec.project_selector) - matches_hash = matches_hash.merge(match.named_captures.symbolize_keys) - matches_hash[:project] = project unless matches_hash.has_key?(:project) - - project_data[project] ||= {} - project_data[project][:namespace] = project_spec.namespace_template.render(**matches_hash) - project_data[project][:configmap_name] = project_spec.configmap_name_template.render(**matches_hash) - project_data[project][:secret_name] = project_spec.secret_name_template.render(**matches_hash) - - params = get_params(project, project_spec, template_matches: matches_hash) - project_data[project][:params] = params - logger.debug { "Parameters selected for #{project}: #{params.collect {|p| "#{p.original_key} => #{p.key}"}.inspect}" } end - project_data.each do |project, data| + Project.all.values.each do |project| - project_spec = config.spec_for_project(project) - if project_spec.skip - logger.info "Skipping project '#{project}'" + match = project.name.match(project.spec.project_selector) + if match.nil? + logger.info "Skipping project '#{project.name}' as it does not match any selectors" next end - param_origins = {} - - # TODO: make project inclusion recursive? - included_params = [] - project_spec.included_projects.each do |included_project| - if included_project == project - logger.warn("Skipping project's import of itself, included_projects for '#{project}' are: #{project_spec.included_projects.inspect}") - next - end - included_data = project_data[included_project] - if included_data.nil? - logger.warn "Skipping the included project not selected by root selector: #{included_project}" - next - end - - included_data[:params].each do |p| - param_origins[p.key] ||= [] - param_origins[p.key] << included_project - end - - included_params.concat(included_data[:params]) - end - - data[:params].each do |p| - param_origins[p.key] ||= [] - param_origins[p.key] << project + if project.spec.skip + logger.info "Skipping project '#{project.name}'" + next end # constructing the hash will cause any overrides to happen in the right # order (includer wins over last included over first included) - params = included_params + data[:params] + params = project.all_parameters parts = params.group_by(&:secret) config_params, secret_params = (parts[false] || []), (parts[true] || []) config_param_hash = params_to_hash(config_params) secret_param_hash = params_to_hash(secret_params) - if @metadata - metadata = {} - metadata["project_heirarchy"] = (project_spec.included_projects + [project]).reverse.join(" -> ") - - param_origins.merge!(param_origins) do |_, v| - origin = "#{v.pop}" - if v.length > 0 - origin << " (#{v.reverse.join(" -> ")})" - end - origin - end - - param_origins_parts = param_origins.group_by {|k, v| config_param_hash.has_key?(k) } - config_origins = Hash[param_origins_parts[true] || []] - secret_origins = Hash[param_origins_parts[false] || []] - - config_param_hash[:cloudtruth_metadata] = metadata.merge({ "parameter_origins" => config_origins }).to_yaml - secret_param_hash[:cloudtruth_metadata] = metadata.merge({ "parameter_origins" => secret_origins }).to_yaml - end - - apply_config_map(namespace: data[:namespace], name: data[:configmap_name], param_hash: config_param_hash) - - if ! project_spec.skip_secrets - apply_secret(namespace: data[:namespace], name: data[:secret_name], param_hash: secret_param_hash) + parameter_origins = project.parameter_origins + param_origins_parts = parameter_origins.group_by {|k, v| config_param_hash.has_key?(k) } + config_origins = Hash[param_origins_parts[true] || []] + secret_origins = Hash[param_origins_parts[false] || []] + + template_vars = { + project: project.name, + project_heirarchy: project.heirarchy, + debug: logger.debug? + } + + configmap_yml = project.spec.configmap_template.render( + **template_vars.merge( + parameters: config_param_hash, + parameter_origins: config_origins + ) + ) + secret_yml = project.spec.secret_template.render( + **template_vars.merge( + parameters: secret_param_hash, + parameter_origins: secret_origins + ) + ) + + kube_apply(configmap_yml) + + if ! project.spec.skip_secrets + kube_apply(secret_yml) end - end - end - - def get_params(project, project_spec, template_matches: {}) - result = [] - - # First search for all the selected parameters - # - params = ctapi.parameters(searchTerm: project_spec.key_filter, project: project) - logger.debug do - cleaned = params.deep_dup - cleaned.each {|p| p.value = "" if p.secret} - "Filtered params: #{cleaned.inspect}" - end - - logger.debug {"Looking for key pattern matches to '#{project_spec.key_selector.inspect}'"} - - params.each do |param| - if matches = param.key.match(project_spec.key_selector) - matches_hash = matches.named_captures.symbolize_keys - matches_hash[:key] = param.key unless matches_hash.has_key?(:key) - matches_hash = template_matches.merge(matches_hash) - - logger.debug {"Pattern matches '#{param.key}' with: #{matches_hash}"} - key = project_spec.key_template.render(**matches_hash) - param.original_key, param.key = param.key, key - - result << param - else - logger.debug {"Pattern does not match '#{param.key}'"} - end end - result end def params_to_hash(param_list) Hash[param_list.collect {|param| [param.key, param.value]}] end - def apply_config_map(namespace:, name:, param_hash:) - logger.info("Applying config map #{namespace}:#{name}") - logger.debug { " with params: #{param_hash.keys.inspect}}" } - - kapi = kubeapi(namespace) - kapi.ensure_namespace unless @dry_run - logger.debug { "Existing config maps (ns=#{kapi.namespace}): #{kapi.get_config_map_names}" } - - begin - resource = kapi.get_config_map(name) - data = resource.data.to_h - logger.debug { "Existing config map for '#{name}': #{data.inspect}" } - if ! kapi.under_management?(resource) - logger.warn "Skipping config map '#{name}' as it doesn't have a label indicating it is under kubetruth management" - elsif param_hash != data.transform_keys! {|k| k.to_s } - logger.info "Updating config map '#{name}'" - kapi.update_config_map(name, param_hash) unless @dry_run - else - logger.info "No changes needed for config map '#{name}'" - end - rescue Kubeclient::ResourceNotFoundError - logger.info "Creating config map '#{name}'" - kapi.create_config_map(name, param_hash) unless @dry_run - end - end + def kube_apply(yml) + parsed_yml = YAML.load(yml) + logger.debug parsed_yml + kind = parsed_yml["kind"] + namespace = parsed_yml["metadata"]["namespace"] || kubeapi.namespace + name = parsed_yml["metadata"]["name"] - def apply_secret(namespace:, name:, param_hash:) - logger.info("Applying secrets #{namespace}:#{name}") - logger.debug { " with params: #{param_hash.keys.inspect}" } + ident = "'#{namespace}:#{kind}:#{name}'" + logger.info("Applying kubernetes resource #{ident}") - kapi = kubeapi(namespace) - kapi.ensure_namespace unless @dry_run - logger.debug { "Existing secrets (ns=#{kapi.namespace}): #{kapi.get_secret_names}" } + kubeapi.ensure_namespace(namespace) unless @dry_run begin - logger.debug { "Namespace '#{kapi.namespace}'" } - resource = kapi.get_secret(name) - data = kapi.secret_hash(resource) - logger.debug { "Existing Secret for '#{name}': #{data.transform_keys! {|k| k.to_s }}" } - if ! kapi.under_management?(resource) - logger.warn "Skipping secret '#{name}' as it doesn't have a label indicating it is under kubetruth management" - elsif param_hash != data.transform_keys! {|k| k.to_s } - logger.info "Updating secret '#{name}'" - kapi.update_secret(name, param_hash) unless @dry_run + resource = kubeapi.get_resource(kind.downcase.pluralize, name, namespace) + if ! kubeapi.under_management?(resource) + logger.warn "Skipping #{ident} as it doesn't have a label indicating it is under kubetruth management" else - logger.info "No changes needed for secret '#{name}'" + if resource.to_h.deep_stringify_keys == parsed_yml + logger.info "Skipping update for identical kubernetes resource #{ident}" + else + logger.info "Updating kubernetes resource #{ident}" + kubeapi.apply_resource(parsed_yml) unless @dry_run + end end rescue Kubeclient::ResourceNotFoundError - logger.info "Creating secret '#{name}'" - kapi.create_secret(name, param_hash) unless @dry_run + logger.info "Creating kubernetes resource #{ident}" + kubeapi.apply_resource(parsed_yml) unless @dry_run end end diff --git a/lib/kubetruth/kubeapi.rb b/lib/kubetruth/kubeapi.rb index 6882ec2..abf01fa 100644 --- a/lib/kubetruth/kubeapi.rb +++ b/lib/kubetruth/kubeapi.rb @@ -1,6 +1,4 @@ -require_relative 'logging' require 'kubeclient' -require 'base64' module Kubetruth class KubeApi @@ -53,85 +51,39 @@ def crdclient ) end - def ensure_namespace + def ensure_namespace(ns = namespace) begin - client.get_namespace(namespace) + client.get_namespace(ns) rescue Kubeclient::ResourceNotFoundError - ns = Kubeclient::Resource.new - ns.metadata = {} - ns.metadata.name = namespace - ns.metadata.labels = @labels - client.create_namespace(ns) + newns = Kubeclient::Resource.new + newns.metadata = {} + newns.metadata.name = namespace + set_managed(newns) + client.create_namespace(newns) end end def under_management?(resource) - labels = resource.try(:metadata).try(:labels) + labels = resource&.metadata&.labels labels.nil? ? false : resource.metadata.labels[MANAGED_LABEL_KEY] == MANAGED_LABEL_VALUE end - def get_config_map_names - client.get_config_maps(namespace: namespace).collect(&:metadata).collect(&:name) + def set_managed(resource) + resource.metadata ||= {} + resource.metadata.labels ||= {} + resource.metadata.labels[MANAGED_LABEL_KEY] = MANAGED_LABEL_VALUE end - def get_config_map(name) - resource = client.get_config_map(name, namespace) - resource + def get_resource(resource_name, name, namespace=nil) + client.get_entity(resource_name, name, namespace || self.namespace) end - def create_config_map(name, data) - resource = Kubeclient::Resource.new - resource.metadata = {} - resource.metadata.name = name - resource.metadata.namespace = @namespace - resource.metadata.labels = @labels - resource.data = data - client.create_config_map(resource) - end - - def update_config_map(name, data) - resource = client.get_config_map(name, namespace) - resource.metadata.labels = resource.metadata.labels.to_h.merge(@labels) - resource.data = data - client.update_config_map(resource) - end - - def delete_config_map(name) - client.delete_config_map(name, namespace) - end - - def get_secret_names - client.get_secrets(namespace: namespace).collect(&:metadata).collect(&:name) - end - - def secret_hash(resource) - Hash[resource.data.to_h.collect {|k, v| [k, Base64.decode64(v)]}] - end - - def get_secret(name) - resource = client.get_secret(name, namespace) - resource - end - - def create_secret(name, data) - resource = Kubeclient::Resource.new - resource.metadata = {} - resource.metadata.name = name - resource.metadata.namespace = @namespace - resource.metadata.labels = @labels - resource.stringData = data - client.create_secret(resource) - end - - def update_secret(name, data) - resource = client.get_secret(name, namespace) - resource.metadata.labels = resource.metadata.labels.to_h.merge(@labels) - resource.stringData = data - client.update_secret(resource) - end - - def delete_secret(name) - client.delete_secret(name, namespace) + def apply_resource(resource) + resource = Kubeclient::Resource.new(resource) if resource.is_a? Hash + set_managed(resource) + resource_name = resource.kind.downcase.pluralize + resource.metadata.namespace ||= self.namespace + client.apply_entity(resource_name, resource, field_manager: "kubetruth") end def get_project_mappings diff --git a/lib/kubetruth/logging.rb b/lib/kubetruth/logging.rb index 9c18717..f8c23ea 100644 --- a/lib/kubetruth/logging.rb +++ b/lib/kubetruth/logging.rb @@ -1,7 +1,5 @@ require 'logging' require 'gem_logger' -# prevent our use of ActiveSupport causing an error with json adapters -require 'active_support/json' module Kubetruth module Logging @@ -62,11 +60,11 @@ def self.sio end def self.contents - sio.try(:sio).try(:to_s) + sio&.sio&.to_s end def self.clear - sio.try(:clear) + sio&.clear end def self.setup_logging(level: :info, color: true) diff --git a/lib/kubetruth/parameter.rb b/lib/kubetruth/parameter.rb index 8f4b4cb..9a7ea85 100644 --- a/lib/kubetruth/parameter.rb +++ b/lib/kubetruth/parameter.rb @@ -1,5 +1,3 @@ -require_relative 'logging' - module Kubetruth - Parameter = Struct.new(:key, :value, :secret, :original_key, keyword_init: true) + Parameter = Struct.new(:key, :value, :secret, keyword_init: true) end diff --git a/lib/kubetruth/project.rb b/lib/kubetruth/project.rb new file mode 100644 index 0000000..12d9c23 --- /dev/null +++ b/lib/kubetruth/project.rb @@ -0,0 +1,142 @@ +module Kubetruth + Project = Struct.new(:name, :spec, keyword_init: true) do + + include GemLogger::LoggerSupport + + cattr_accessor :ctapi_context + + def self.ctapi + @ctapi ||= begin + ctx = ctapi_context.dup + @ctapi_class = Kubetruth::CtApi(api_key: ctx.delete(:api_key), api_url: ctx.delete(:api_url)) + @ctapi_class.new(**ctx) + end + end + + def ctapi + self.class.ctapi + end + + def self.names + ctapi.project_names + end + + def self.reset + @all = nil + end + + def self.all + @all ||= {} + end + + def self.create(*args, **kwargs) + project = new(*args, **kwargs) + all[project.name] = project + end + + def parameters + @parameters ||= begin + result = [] + + # First search for all the selected parameters + # + searchTerm = "" + if spec.key_selector.source =~ /^[\w\.\-]*$/ + logger.debug {"Simple key_selector '#{spec.key_selector.source}', using as search filter to fetch parameters"} + searchTerm = spec.key_selector.source + else + logger.debug {"Complex key_selector '#{spec.key_selector.source}', using as client-side regexp match against parameters"} + end + + params = ctapi.parameters(searchTerm: searchTerm, project: name) + logger.debug do + cleaned = params.deep_dup + cleaned.each {|p| p.value = "" if p.secret} + "Params fetched from cloudtruth: #{cleaned.inspect}" + end + + if searchTerm.blank? && spec.key_selector.source.present? + logger.debug {"Looking for key pattern matches to '#{spec.key_selector.inspect}'"} + params = params.select do |param| + if param.key.match(spec.key_selector) + logger.debug {"Pattern matches '#{param.key}'"} + true + else + logger.debug {"Pattern does not match '#{param.key}'"} + false + end + end + end + + logger.debug { "Parameters selected for #{name}: #{params.collect {|p| p.key }.inspect}" } + + params + end + end + + # Yields each project to the optional block in a DFS fashion + def included_projects(seen: [], &block) + result = {} + seen = seen + [name] + + spec.included_projects.each do |included_project_name| + if seen.include?(included_project_name) + logger.info "Breaking circular dependency in included project: #{(seen + [included_project_name]).join(' -> ')}" + next + end + + project = self.class.all[included_project_name] + if project.nil? + # should never get here as ETL preloads all referenced projects + logger.warn "Skipping unknown project '#{included_project_name}' included by project '#{name}'" + next + end + + result[project.name] = project.included_projects(seen: seen, &block) + yield project if block + end + + result + end + + def all_parameters + params = [] + included_projects do |project| + params.concat(project.parameters) + end + params.concat(parameters) + params + end + + def parameter_origins + origins = {} + + included_projects do |project| + project.parameters.each do |p| + origins[p.key] ||= [] + origins[p.key] << project.name + end + end + + parameters.each do |p| + origins[p.key] ||= [] + origins[p.key] << name + end + + origins.merge!(origins) do |_, v| + origin = "#{v.pop}" + if v.length > 0 + origin << " (#{v.reverse.join(" -> ")})" + end + origin + end + + origins + end + + def heirarchy + {self.name => included_projects} + end + + end +end diff --git a/lib/kubetruth/template.rb b/lib/kubetruth/template.rb index dc613e4..bfdf111 100644 --- a/lib/kubetruth/template.rb +++ b/lib/kubetruth/template.rb @@ -1,5 +1,6 @@ -require_relative 'logging' require 'liquid' +require 'digest' +require 'base64' module Kubetruth class Template @@ -31,6 +32,42 @@ def env_safe(str) result end + def indent(str, count) + result = "" + str.lines.each do |l| + result << (" " * count) << l + end + result + end + + def nindent(str, count) + indent("\n" + str, count) + end + + def stringify(str) + str.to_s.to_json + end + + def to_yaml(str) + str.to_yaml + end + + def to_json(str) + str.to_json + end + + def sha256(data) + Digest::SHA256.hexdigest(data) + end + + def encode64(str) + Base64.strict_encode64(str) + end + + def decode64(str) + Base64.strict_decode64(str) + end + end Liquid::Template.register_filter(CustomLiquidFilters) @@ -51,9 +88,15 @@ def render(**kwargs) logger.debug { "Evaluating template '#{@source}' with context: #{kwargs.inspect}" } @liquid.render!(kwargs.stringify_keys, strict_variables: true, strict_filters: true) rescue Liquid::Error => e - msg = "Invalid template '#{@source}': #{e.message}" - msg << ", context: #{kwargs.inspect}" if e.is_a?(Liquid::UndefinedVariable) - raise Error.new(msg) + indent = " " + msg = "Template failed to render:\n" + @source.lines.each {|l| msg << (indent * 2) << l } + msg << indent << "with error message:\n" << (indent * 2) << "#{e.message}" + if e.is_a?(Liquid::UndefinedVariable) + msg << "\n" << indent << "and variable context:\n" + msg << (indent * 2) << kwargs.inspect + end + raise Error, msg end end diff --git a/lib/kubetruth/version.rb b/lib/kubetruth/version.rb index 094bb20..0b6c4dd 100644 --- a/lib/kubetruth/version.rb +++ b/lib/kubetruth/version.rb @@ -1,3 +1,3 @@ module Kubetruth - VERSION = "0.4.1" + VERSION = "0.5.0" end diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_from_hash.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_from_hash.yml new file mode 100644 index 0000000..6ec5601 --- /dev/null +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_from_hash.yml @@ -0,0 +1,129 @@ +--- +http_interactions: +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 404 + message: Not Found + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '336' + body: + encoding: UTF-8 + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash","kind":"configmaps"},"code":404} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +- request: + method: patch + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash?fieldManager=kubetruth&force=true + body: + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"namespace":"kubetruth-test-ns"},"data":{"bar":"baz"}}' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Content-Type: + - application/apply-patch+yaml + Authorization: + - Bearer + Content-Length: + - '246' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '594' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash","namespace":"kubetruth-test-ns","uid":"9abd8480-f16d-4164-b103-7ae45361fc2b","resourceVersion":"45393","creationTimestamp":"2021-06-16T15:28:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '594' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-from-hash","namespace":"kubetruth-test-ns","uid":"9abd8480-f16d-4164-b103-7ae45361fc2b","resourceVersion":"45393","creationTimestamp":"2021-06-16T15:28:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_using_client_namespace.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_using_client_namespace.yml new file mode 100644 index 0000000..3b911f8 --- /dev/null +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_using_client_namespace.yml @@ -0,0 +1,129 @@ +--- +http_interactions: +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 404 + message: Not Found + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:45 GMT + Content-Length: + - '362' + body: + encoding: UTF-8 + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace","kind":"configmaps"},"code":404} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT +- request: + method: patch + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace?fieldManager=kubetruth&force=true + body: + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"namespace":"kubetruth-test-ns"},"data":{"bar":"baz"}}' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Content-Type: + - application/apply-patch+yaml + Authorization: + - Bearer + Content-Length: + - '259' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:45 GMT + Content-Length: + - '607' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace","namespace":"kubetruth-test-ns","uid":"3be7a3ea-60e8-4912-93d8-fe633875c4e6","resourceVersion":"45386","creationTimestamp":"2021-06-16T15:28:45Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:45 GMT + Content-Length: + - '607' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-using-client-namespace","namespace":"kubetruth-test-ns","uid":"3be7a3ea-60e8-4912-93d8-fe633875c4e6","resourceVersion":"45386","creationTimestamp":"2021-06-16T15:28:45Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_updating_config_maps.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_with_supplied_namespace.yml similarity index 63% rename from spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_updating_config_maps.yml rename to spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_with_supplied_namespace.yml index 223d145..c9f965b 100644 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_updating_config_maps.yml +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_a_resource_with_supplied_namespace.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://127.0.0.1:55028/api/v1 + uri: https://127.0.0.1:60761/api/v1 body: encoding: US-ASCII string: '' @@ -10,13 +10,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 200 @@ -27,11 +27,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Transfer-Encoding: - chunked body: @@ -39,10 +39,10 @@ http_interactions: string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT - request: method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/baz + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-arns body: encoding: US-ASCII string: '' @@ -50,13 +50,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 404 @@ -67,41 +67,41 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Content-Length: - - '186' + - '224' body: encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"baz\" not found","reason":"NotFound","details":{"name":"baz","kind":"configmaps"},"code":404} + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces + \"kubetruth-test-ns-arns\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-arns","kind":"namespaces"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT - request: method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps + uri: https://127.0.0.1:60761/api/v1/namespaces body: encoding: UTF-8 - string: '{"metadata":{"name":"baz","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' + string: '{"metadata":{"name":"kubetruth-test-ns-arns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Content-Type: - application/json Authorization: - Bearer Content-Length: - - '171' + - '137' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 201 @@ -112,124 +112,122 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Content-Length: - - '535' + - '564' body: encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9174","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-arns","uid":"5e2e32e8-efd2-4925-8577-95dc3d14f7f7","resourceVersion":"45387","creationTimestamp":"2021-06-16T15:28:46Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:46Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT - request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/baz + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-arns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9174","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}}' + encoding: US-ASCII + string: '' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer - Content-Length: - - '510' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: - code: 200 - message: OK + code: 404 + message: Not Found headers: Cache-Control: - no-cache, private Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Content-Length: - - '493' + - '364' body: encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9175","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}}}}]},"data":{"bar":"baz"}} + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace","kind":"configmaps"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT - request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/baz + method: patch + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-arns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace?fieldManager=kubetruth&force=true body: - encoding: US-ASCII - string: '' + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"ConfigMap","metadata":{"namespace":"kubetruth-test-ns-arns","name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"}}' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Content-Type: + - application/apply-patch+yaml Authorization: - Bearer + Content-Length: + - '265' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: - code: 200 - message: OK + code: 201 + message: Created headers: Cache-Control: - no-cache, private Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Content-Length: - - '493' + - '613' body: encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9175","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}}}}]},"data":{"bar":"baz"}} + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace","namespace":"kubetruth-test-ns-arns","uid":"cf52d7da-83ff-402d-8945-539e524b104d","resourceVersion":"45392","creationTimestamp":"2021-06-16T15:28:46Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:46Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT - request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/baz + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-arns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9175","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"otherlabel":"set","app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}}}}]},"data":{"bum":"boo"}}' + encoding: US-ASCII + string: '' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer - Content-Length: - - '535' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 200 @@ -240,17 +238,17 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:49 GMT + - Wed, 16 Jun 2021 15:28:46 GMT Content-Length: - - '572' + - '613' body: encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"1baee920-b958-4fb9-84ad-0df4dafcd12a","resourceVersion":"9176","creationTimestamp":"2021-02-24T19:27:49Z","labels":{"app.kubernetes.io/managed-by":"kubetruth","otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bum":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{},"f:otherlabel":{}}}}}]},"data":{"bum":"boo"}} + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-a-resource-with-supplied-namespace","namespace":"kubetruth-test-ns-arns","uid":"cf52d7da-83ff-402d-8945-539e524b104d","resourceVersion":"45392","creationTimestamp":"2021-06-16T15:28:46Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:46Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} ' - recorded_at: Wed, 24 Feb 2021 19:27:49 GMT + recorded_at: Wed, 16 Jun 2021 15:28:46 GMT recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_other_types_of_resources.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_other_types_of_resources.yml new file mode 100644 index 0000000..ebb3c69 --- /dev/null +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/creates_other_types_of_resources.yml @@ -0,0 +1,129 @@ +--- +http_interactions: +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/secrets/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 404 + message: Not Found + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:48 GMT + Content-Length: + - '338' + body: + encoding: UTF-8 + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets + \"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources","kind":"secrets"},"code":404} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:48 GMT +- request: + method: patch + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/secrets/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources?fieldManager=kubetruth&force=true + body: + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"Secret","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"namespace":"kubetruth-test-ns"},"data":{"bar":"YmF6"}}' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Content-Type: + - application/apply-patch+yaml + Authorization: + - Bearer + Content-Length: + - '248' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:48 GMT + Content-Length: + - '612' + body: + encoding: UTF-8 + string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources","namespace":"kubetruth-test-ns","uid":"c11e95db-3d86-442e-9e9b-14390ccb8500","resourceVersion":"45396","creationTimestamp":"2021-06-16T15:28:48Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:48Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:48 GMT +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/secrets/rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:48 GMT + Content-Length: + - '612' + body: + encoding: UTF-8 + string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcecreates-other-types-of-resources","namespace":"kubetruth-test-ns","uid":"c11e95db-3d86-442e-9e9b-14390ccb8500","resourceVersion":"45396","creationTimestamp":"2021-06-16T15:28:48Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:48Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:48 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/sets_up_management_when_creating_a_resource.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/sets_up_management_when_creating_a_resource.yml new file mode 100644 index 0000000..614b1b2 --- /dev/null +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/apply_resource/sets_up_management_when_creating_a_resource.yml @@ -0,0 +1,129 @@ +--- +http_interactions: +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 404 + message: Not Found + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '366' + body: + encoding: UTF-8 + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource","kind":"configmaps"},"code":404} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +- request: + method: patch + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource?fieldManager=kubetruth&force=true + body: + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"namespace":"kubetruth-test-ns"},"data":{"bar":"baz"}}' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Content-Type: + - application/apply-patch+yaml + Authorization: + - Bearer + Content-Length: + - '261' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '609' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource","namespace":"kubetruth-test-ns","uid":"46e1618f-9ff8-46b0-a890-d1e1f589fb88","resourceVersion":"45395","creationTimestamp":"2021-06-16T15:28:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:47 GMT + Content-Length: + - '609' + body: + encoding: UTF-8 + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-applyresourcesets-up-management-when-creating-a-resource","namespace":"kubetruth-test-ns","uid":"46e1618f-9ff8-46b0-a890-d1e1f589fb88","resourceVersion":"45395","creationTimestamp":"2021-06-16T15:28:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"kubetruth","operation":"Apply","apiVersion":"v1","time":"2021-06-16T15:28:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{"f:bar":{}},"f:metadata":{"f:labels":{"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:47 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_crud_config_maps.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_crud_config_maps.yml deleted file mode 100644 index d326574..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_crud_config_maps.yml +++ /dev/null @@ -1,417 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55028/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '171' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9165","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"ConfigMapList","apiVersion":"v1","metadata":{"resourceVersion":"9165"},"items":[{"metadata":{"name":"app","namespace":"kubetruth-test-ns","uid":"f2f08311-2611-4ff1-aa01-6a7f052f37c7","resourceVersion":"9157","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:background_color":{},"f:live_config_tid":{},"f:polling_interval":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"background_color":"white","live_config_tid":"9e5e462a-5548-4230-b0ba-2e23684d590d","polling_interval":"15000"}},{"metadata":{"name":"db-sizing","namespace":"kubetruth-test-ns","uid":"930a1d9f-fa76-43b2-a0fe-761bed791c96","resourceVersion":"9151","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:some-rds.count":{},"f:some-rds.type":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"some-rds.count":"0","some-rds.type":"db.t2.micro"}},{"metadata":{"name":"demo","namespace":"kubetruth-test-ns","uid":"eb87eb5f-18ab-4d5c-8afa-bee173589dda","resourceVersion":"9148","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:active":{},"f:color0":{},"f:color1":{},"f:color2":{},"f:delay":{},"f:enable_logging":{},"f:height":{},"f:label0":{},"f:label1":{},"f:label2":{},"f:max_cpu":{},"f:max_instances":{},"f:max_retries":{},"f:min_cpu":{},"f:num_frames":{},"f:num_retries":{},"f:region":{},"f:series0":{},"f:series1":{},"f:series2":{},"f:timeout":{},"f:width":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"active":"true","color0":"#111111","color1":"#CC9900","color2":"#CC7755","delay":"200","enable_logging":"true","height":"150","label0":"Hammers","label1":"Anvils","label2":"Rockets","max_cpu":"512","max_instances":"5","max_retries":"6","min_cpu":"4","num_frames":"80","num_retries":"3","region":"us_east","series0":"78","series1":"73","series2":"67","timeout":"5000","width":"762"}},{"metadata":{"name":"demo1","namespace":"kubetruth-test-ns","uid":"5ea4399f-f649-48d0-a802-ca71c3a89576","resourceVersion":"9154","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:live_config_tid":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"live_config_tid":"90ba456b-6251-4242-8242-c4b7e935ef02"}},{"metadata":{"name":"demo2","namespace":"kubetruth-test-ns","uid":"fc26eb33-7e00-40ba-8f34-c679aab20010","resourceVersion":"9155","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:limit":{},"f:min":{},"f:other":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"limit":"7","min":"2","other":"newdata"}},{"metadata":{"name":"demo3","namespace":"kubetruth-test-ns","uid":"c9dda293-4bc1-4cc1-a561-eec29a3241f6","resourceVersion":"9156","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:foo":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"foo":"bar"}},{"metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9165","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}},{"metadata":{"name":"kube-root-ca.crt","namespace":"kubetruth-test-ns","uid":"43920884-8c00-4a90-aacf-11c1fe630281","resourceVersion":"9112","creationTimestamp":"2021-02-24T19:27:28Z","managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{}}}}]},"data":{"ca.crt":"-----BEGIN - CERTIFICATE-----\nMIIDBjCCAe6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5p\na3ViZUNBMB4XDTIxMDIyMzE2MTcwMFoXDTMxMDIyMjE2MTcwMFowFTETMBEGA1UE\nAxMKbWluaWt1YmVDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKZM\n9pTWabY7FgKajk5MBitZSOu112pTHCtpeWafgQf150YAlpZJQieGy7YvX8aunJ2w\ncMVgLvfL7EVsV2wyOviYVCmBfKfFr207bkqhZZ5JuGW4X6F4HtlRLzuoxAp8E+jJ\nrsBmLFRMl+nDb2O+8BaUjaUCXO5ugU8TUn4our7hu2SXNXU6oj5YoTuea8I141L2\n5AhE7qTQjM6B7/lB79R5fmj9fH9iPSBc9rj4FXgwLkYnTVAye/nkvjh3zh0lmdIZ\n67IFhkMqt8ELTe0G80xH/3HFs90kJ6KplsXaswB0HW+YKy9WNQS9kfwJNvWeNDMC\neu65qxB5nBEUiwFB0WcCAwEAAaNhMF8wDgYDVR0PAQH/BAQDAgKkMB0GA1UdJQQW\nMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW\nBBTfQwSvbsoNaxiXRrUyYPrMX+CqMTANBgkqhkiG9w0BAQsFAAOCAQEAUp0jYEv2\nYReLTupF9SXOVBsX+iZS4I0l7bcNlyUH01mCpnS5ez2okUVuXxZj6hMnsNB4uDKd\nP1RabfUn2CMfVIQGGV/Gdn53nie2FNGAIuNk6lEfjCoQaWzM0ukM/R/epRq6/WxS\n3uv2Wm/0kbBai2Y55VYJD17N30HMnIUQzREO0TZ+iASU98u6iTgPN1OR5aKZRIfZ\n0hfqT0JopxHUXLK/gNIBcY1rnKqWNsxrcYfJWulZZJSlVN9CEGkOqWCdX/wmsoWx\nD6M9bN/Wn40JsLcl/bWHsGj9glgXrKNppGVgTpYOV5seo2pjjXy5y8i+LA5w5Lh9\nKKblyjscCcgdeQ==\n-----END - CERTIFICATE-----\n"}},{"metadata":{"name":"service-sizing","namespace":"kubetruth-test-ns","uid":"87125fda-bbb6-4f7d-893b-d14ccbe447aa","resourceVersion":"9152","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bigboy.cpu":{},"f:bigboy.max_capacity":{},"f:bigboy.memory":{},"f:bigboy.min_capacity":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bigboy.cpu":"512","bigboy.max_capacity":"1","bigboy.memory":"1024","bigboy.min_capacity":"1"}},{"metadata":{"name":"service-sizing-default","namespace":"kubetruth-test-ns","uid":"631d0de6-6b62-4b3c-928d-165f4e0b7462","resourceVersion":"9153","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:cpu":{},"f:max_capacity":{},"f:memory":{},"f:min_capacity":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"cpu":"256","max_capacity":"1","memory":"512","min_capacity":"1"}},{"metadata":{"name":"services","namespace":"kubetruth-test-ns","uid":"de75337d-4cf4-4992-970a-53a7422a6e3f","resourceVersion":"9149","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:kubecfg":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"kubecfg":""}}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9165","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9165","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9165","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '534' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9166","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7","resourceVersion":"9166","creationTimestamp":"2021-02-24T19:27:43Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: delete - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '159' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"configmaps","uid":"3a27eb4b-ef06-471a-b8ea-f3ff7102dbf7"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:43 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:43 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_use_multiple_namespaces_for_config_maps.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_use_multiple_namespaces_for_config_maps.yml deleted file mode 100644 index a2511db..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/can_use_multiple_namespaces_for_config_maps.yml +++ /dev/null @@ -1,1001 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55032/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '226' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces - \"kubetruth-test-ns-cmns1\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-cmns1","kind":"namespaces"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces - body: - encoding: UTF-8 - string: '{"metadata":{"name":"kubetruth-test-ns-cmns1","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '138' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '565' - body: - encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-cmns1","uid":"ae3912ca-067a-4136-b543-21eea20d9d22","resourceVersion":"10442","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '226' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces - \"kubetruth-test-ns-cmns2\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-cmns2","kind":"namespaces"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces - body: - encoding: UTF-8 - string: '{"metadata":{"name":"kubetruth-test-ns-cmns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '138' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '565' - body: - encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-cmns2","uid":"150e9f04-4f56-4a73-960f-80d9e22c53a5","resourceVersion":"10447","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '177' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10452","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"ConfigMapList","apiVersion":"v1","metadata":{"resourceVersion":"10452"},"items":[{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10452","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}},{"metadata":{"name":"kube-root-ca.crt","namespace":"kubetruth-test-ns-cmns1","uid":"666d86f9-a621-4d27-a015-91b765b86e4e","resourceVersion":"10444","creationTimestamp":"2021-02-24T19:41:15Z","managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{}}}}]},"data":{"ca.crt":"-----BEGIN - CERTIFICATE-----\nMIIDBjCCAe6gAwIBAgIBATANBgkqhkiG9w0BAQsFAD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021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10452","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10452","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: put - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10452","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '541' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10453","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns1","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0","resourceVersion":"10453","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: delete - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '159' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"configmaps","uid":"35cfa75b-1451-4c68-ad41-c78efc2a56c0"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns1/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '177' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10455","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"ConfigMapList","apiVersion":"v1","metadata":{"resourceVersion":"10455"},"items":[{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10455","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}},{"metadata":{"name":"kube-root-ca.crt","namespace":"kubetruth-test-ns-cmns2","uid":"5a0da880-0430-4d64-88fc-fac635be5fee","resourceVersion":"10448","creationTimestamp":"2021-02-24T19:41:15Z","managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{}}}}]},"data":{"ca.crt":"-----BEGIN - CERTIFICATE-----\nMIIDBjCCAe6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5p\na3ViZUNBMB4XDTIxMDIyMzE2MTcwMFoXDTMxMDIyMjE2MTcwMFowFTETMBEGA1UE\nAxMKbWluaWt1YmVDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKZM\n9pTWabY7FgKajk5MBitZSOu112pTHCtpeWafgQf150YAlpZJQieGy7YvX8aunJ2w\ncMVgLvfL7EVsV2wyOviYVCmBfKfFr207bkqhZZ5JuGW4X6F4HtlRLzuoxAp8E+jJ\nrsBmLFRMl+nDb2O+8BaUjaUCXO5ugU8TUn4our7hu2SXNXU6oj5YoTuea8I141L2\n5AhE7qTQjM6B7/lB79R5fmj9fH9iPSBc9rj4FXgwLkYnTVAye/nkvjh3zh0lmdIZ\n67IFhkMqt8ELTe0G80xH/3HFs90kJ6KplsXaswB0HW+YKy9WNQS9kfwJNvWeNDMC\neu65qxB5nBEUiwFB0WcCAwEAAaNhMF8wDgYDVR0PAQH/BAQDAgKkMB0GA1UdJQQW\nMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW\nBBTfQwSvbsoNaxiXRrUyYPrMX+CqMTANBgkqhkiG9w0BAQsFAAOCAQEAUp0jYEv2\nYReLTupF9SXOVBsX+iZS4I0l7bcNlyUH01mCpnS5ez2okUVuXxZj6hMnsNB4uDKd\nP1RabfUn2CMfVIQGGV/Gdn53nie2FNGAIuNk6lEfjCoQaWzM0ukM/R/epRq6/WxS\n3uv2Wm/0kbBai2Y55VYJD17N30HMnIUQzREO0TZ+iASU98u6iTgPN1OR5aKZRIfZ\n0hfqT0JopxHUXLK/gNIBcY1rnKqWNsxrcYfJWulZZJSlVN9CEGkOqWCdX/wmsoWx\nD6M9bN/Wn40JsLcl/bWHsGj9glgXrKNppGVgTpYOV5seo2pjjXy5y8i+LA5w5Lh9\nKKblyjscCcgdeQ==\n-----END - CERTIFICATE-----\n"}}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10455","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10455","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: put - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10455","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '541' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10456","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-cmns2","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa","resourceVersion":"10456","creationTimestamp":"2021-02-24T19:41:15Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"bum"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: delete - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '159' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"configmaps","uid":"4d898fb4-6e12-484a-97d9-ab9e1c5a26fa"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-cmns2/configmaps/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:15 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:15 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_creating_config_maps.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_creating_config_maps.yml deleted file mode 100644 index fd7a9af..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/configmaps/sets_labels_when_creating_config_maps.yml +++ /dev/null @@ -1,170 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55028/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:47 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:47 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps/bar - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:47 GMT - Content-Length: - - '186' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps - \"bar\" not found","reason":"NotFound","details":{"name":"bar","kind":"configmaps"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:47 GMT -- request: - method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps - body: - encoding: UTF-8 - string: '{"metadata":{"name":"bar","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '171' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:47 GMT - Content-Length: - - '535' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"bar","namespace":"kubetruth-test-ns","uid":"12baff9b-ec52-48bc-afa3-93e4bd2fdfec","resourceVersion":"9172","creationTimestamp":"2021-02-24T19:27:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:47 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/configmaps - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:47 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"ConfigMapList","apiVersion":"v1","metadata":{"resourceVersion":"9172"},"items":[{"metadata":{"name":"app","namespace":"kubetruth-test-ns","uid":"f2f08311-2611-4ff1-aa01-6a7f052f37c7","resourceVersion":"9157","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:background_color":{},"f:live_config_tid":{},"f:polling_interval":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"background_color":"white","live_config_tid":"9e5e462a-5548-4230-b0ba-2e23684d590d","polling_interval":"15000"}},{"metadata":{"name":"bar","namespace":"kubetruth-test-ns","uid":"12baff9b-ec52-48bc-afa3-93e4bd2fdfec","resourceVersion":"9172","creationTimestamp":"2021-02-24T19:27:47Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:47Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}},{"metadata":{"name":"db-sizing","namespace":"kubetruth-test-ns","uid":"930a1d9f-fa76-43b2-a0fe-761bed791c96","resourceVersion":"9151","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:some-rds.count":{},"f:some-rds.type":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"some-rds.count":"0","some-rds.type":"db.t2.micro"}},{"metadata":{"name":"demo","namespace":"kubetruth-test-ns","uid":"eb87eb5f-18ab-4d5c-8afa-bee173589dda","resourceVersion":"9148","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:active":{},"f:color0":{},"f:color1":{},"f:color2":{},"f:delay":{},"f:enable_logging":{},"f:height":{},"f:label0":{},"f:label1":{},"f:label2":{},"f:max_cpu":{},"f:max_instances":{},"f:max_retries":{},"f:min_cpu":{},"f:num_frames":{},"f:num_retries":{},"f:region":{},"f:series0":{},"f:series1":{},"f:series2":{},"f:timeout":{},"f:width":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"active":"true","color0":"#111111","color1":"#CC9900","color2":"#CC7755","delay":"200","enable_logging":"true","height":"150","label0":"Hammers","label1":"Anvils","label2":"Rockets","max_cpu":"512","max_instances":"5","max_retries":"6","min_cpu":"4","num_frames":"80","num_retries":"3","region":"us_east","series0":"78","series1":"73","series2":"67","timeout":"5000","width":"762"}},{"metadata":{"name":"demo1","namespace":"kubetruth-test-ns","uid":"5ea4399f-f649-48d0-a802-ca71c3a89576","resourceVersion":"9154","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:live_config_tid":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"live_config_tid":"90ba456b-6251-4242-8242-c4b7e935ef02"}},{"metadata":{"name":"demo2","namespace":"kubetruth-test-ns","uid":"fc26eb33-7e00-40ba-8f34-c679aab20010","resourceVersion":"9155","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:limit":{},"f:min":{},"f:other":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"limit":"7","min":"2","other":"newdata"}},{"metadata":{"name":"demo3","namespace":"kubetruth-test-ns","uid":"c9dda293-4bc1-4cc1-a561-eec29a3241f6","resourceVersion":"9156","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:foo":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"foo":"bar"}},{"metadata":{"name":"kube-root-ca.crt","namespace":"kubetruth-test-ns","uid":"43920884-8c00-4a90-aacf-11c1fe630281","resourceVersion":"9112","creationTimestamp":"2021-02-24T19:27:28Z","managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{}}}}]},"data":{"ca.crt":"-----BEGIN - CERTIFICATE-----\nMIID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ICATE-----\n"}},{"metadata":{"name":"service-sizing","namespace":"kubetruth-test-ns","uid":"87125fda-bbb6-4f7d-893b-d14ccbe447aa","resourceVersion":"9152","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bigboy.cpu":{},"f:bigboy.max_capacity":{},"f:bigboy.memory":{},"f:bigboy.min_capacity":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bigboy.cpu":"512","bigboy.max_capacity":"1","bigboy.memory":"1024","bigboy.min_capacity":"1"}},{"metadata":{"name":"service-sizing-default","namespace":"kubetruth-test-ns","uid":"631d0de6-6b62-4b3c-928d-165f4e0b7462","resourceVersion":"9153","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:cpu":{},"f:max_capacity":{},"f:memory":{},"f:min_capacity":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"cpu":"256","max_capacity":"1","memory":"512","min_capacity":"1"}},{"metadata":{"name":"services","namespace":"kubetruth-test-ns","uid":"de75337d-4cf4-4992-970a-53a7422a6e3f","resourceVersion":"9149","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:kubecfg":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"kubecfg":""}}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:47 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/custom_resource/can_get_project_mappings.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/custom_resource/can_get_project_mappings.yml index 759a1cd..2b44264 100644 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/custom_resource/can_get_project_mappings.yml +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/custom_resource/can_get_project_mappings.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://127.0.0.1:61828/apis/kubetruth.cloudtruth.com/v1 + uri: https://127.0.0.1:60761/apis/kubetruth.cloudtruth.com/v1 body: encoding: US-ASCII string: '' @@ -10,13 +10,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:61828 + - 127.0.0.1:60761 response: status: code: 200 @@ -27,11 +27,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 603a7cd9-f3d5-41ac-85ce-63c2b2e318ba + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - 666de615-bfc9-45df-957e-e4aaa9dee586 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Thu, 29 Apr 2021 19:18:37 GMT + - Wed, 16 Jun 2021 15:28:49 GMT Content-Length: - '346' body: @@ -39,10 +39,10 @@ http_interactions: string: '{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"kubetruth.cloudtruth.com/v1","resources":[{"name":"projectmappings","singularName":"projectmapping","namespaced":true,"kind":"ProjectMapping","verbs":["delete","deletecollection","get","list","patch","create","update","watch"],"shortNames":["pm"],"storageVersionHash":"UqtD9M7id/A="}]} ' - recorded_at: Thu, 29 Apr 2021 19:18:37 GMT + recorded_at: Wed, 16 Jun 2021 15:28:49 GMT - request: method: get - uri: https://127.0.0.1:61828/apis/kubetruth.cloudtruth.com/v1/namespaces/kubetruth-test-ns/projectmappings + uri: https://127.0.0.1:60761/apis/kubetruth.cloudtruth.com/v1/namespaces/kubetruth-test-ns/projectmappings body: encoding: US-ASCII string: '' @@ -50,13 +50,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:61828 + - 127.0.0.1:60761 response: status: code: 200 @@ -67,18 +67,29 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 603a7cd9-f3d5-41ac-85ce-63c2b2e318ba + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - 666de615-bfc9-45df-957e-e4aaa9dee586 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Thu, 29 Apr 2021 19:18:37 GMT - Content-Length: - - '1728' + - Wed, 16 Jun 2021 15:28:49 GMT + Transfer-Encoding: + - chunked body: encoding: UTF-8 - string: '{"apiVersion":"kubetruth.cloudtruth.com/v1","items":[{"apiVersion":"kubetruth.cloudtruth.com/v1","kind":"ProjectMapping","metadata":{"annotations":{"meta.helm.sh/release-name":"kubetruth-test-app","meta.helm.sh/release-namespace":"kubetruth-test-ns"},"creationTimestamp":"2021-04-29T19:18:36Z","generation":1,"labels":{"app.kubernetes.io/instance":"kubetruth-test-app","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"kubetruth","app.kubernetes.io/version":"0.3.0","helm.sh/chart":"kubetruth-0.3.0"},"managedFields":[{"apiVersion":"kubetruth.cloudtruth.com/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/instance":{},"f:app.kubernetes.io/managed-by":{},"f:app.kubernetes.io/name":{},"f:app.kubernetes.io/version":{},"f:helm.sh/chart":{}}},"f:spec":{".":{},"f:configmap_name_template":{},"f:included_projects":{},"f:key_filter":{},"f:key_selector":{},"f:key_template":{},"f:namespace_template":{},"f:project_selector":{},"f:scope":{},"f:secret_name_template":{},"f:skip":{},"f:skip_secrets":{}}},"manager":"Go-http-client","operation":"Update","time":"2021-04-29T19:18:36Z"}],"name":"kubetruth-test-app-root","namespace":"kubetruth-test-ns","resourceVersion":"55912","uid":"73358f87-dee2-4656-87a1-c9276c19ceef"},"spec":{"configmap_name_template":"{{project}}","included_projects":[],"key_filter":"","key_selector":"","key_template":"{{key}}","namespace_template":"","project_selector":"","scope":"root","secret_name_template":"{{project - | dns_safe}}","skip":false,"skip_secrets":false}}],"kind":"ProjectMappingList","metadata":{"continue":"","resourceVersion":"55925"}} + string: '{"apiVersion":"kubetruth.cloudtruth.com/v1","items":[{"apiVersion":"kubetruth.cloudtruth.com/v1","kind":"ProjectMapping","metadata":{"annotations":{"meta.helm.sh/release-name":"kubetruth-test-app","meta.helm.sh/release-namespace":"kubetruth-test-ns"},"creationTimestamp":"2021-06-16T15:28:37Z","generation":1,"labels":{"app.kubernetes.io/instance":"kubetruth-test-app","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"kubetruth","app.kubernetes.io/version":"0.4.1","helm.sh/chart":"kubetruth-0.4.1"},"managedFields":[{"apiVersion":"kubetruth.cloudtruth.com/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/instance":{},"f:app.kubernetes.io/managed-by":{},"f:app.kubernetes.io/name":{},"f:app.kubernetes.io/version":{},"f:helm.sh/chart":{}}},"f:spec":{".":{},"f:configmap_template":{},"f:included_projects":{},"f:key_selector":{},"f:project_selector":{},"f:scope":{},"f:secret_template":{},"f:skip":{},"f:skip_secrets":{}}},"manager":"Go-http-client","operation":"Update","time":"2021-06-16T15:28:37Z"}],"name":"kubetruth-test-app-root","namespace":"kubetruth-test-ns","resourceVersion":"45342","uid":"8d25947c-eabe-4a98-89ab-fc56fc736fa9"},"spec":{"configmap_template":"apiVersion: + v1\nkind: ConfigMap\nmetadata:\n name: \"{{ project | dns_safe }}\"\n labels:\n version: + \"{{ parameters | sort | sha256 | slice: 0, 7 }}\"\n annotations:\n kubetruth/project_heirarchy: + |\n {{ project_heirarchy | to_yaml | indent: 6 | lstrip }}\n kubtruth/parameter_origins: + |\n {{ parameter_origins | to_yaml | indent: 6 | lstrip }}\ndata:\n {% + for parameter in parameters %}\n {{ parameter[0] | stringify }}: {{ parameter[1] + | stringify }}\n {% endfor %}\n","included_projects":[],"key_selector":"","project_selector":"","scope":"root","secret_template":"apiVersion: + v1\nkind: Secret\nmetadata:\n name: \"{{ project | dns_safe }}\"\n labels:\n version: + \"{{ parameters | sort | sha256 | slice: 0, 7 }}\"\n annotations:\n kubetruth/project_heirarchy: + |\n {{ project_heirarchy | to_yaml | indent: 6 | lstrip }}\n kubtruth/parameter_origins: + |\n {{ parameter_origins | to_yaml | indent: 6 | lstrip }}\ndata:\n {% + for parameter in parameters %}\n {{ parameter[0] | stringify }}: {{ parameter[1] + | encode64 | stringify }}\n {% endfor %}\n","skip":false,"skip_secrets":false}}],"kind":"ProjectMappingList","metadata":{"continue":"","resourceVersion":"45397"}} ' - recorded_at: Thu, 29 Apr 2021 19:18:37 GMT + recorded_at: Wed, 16 Jun 2021 15:28:49 GMT recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/creates_namespace_if_not_present.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/creates_namespace_if_not_present.yml index 6034dd1..c7d7ffb 100644 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/creates_namespace_if_not_present.yml +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/creates_namespace_if_not_present.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://127.0.0.1:55032/api/v1 + uri: https://127.0.0.1:60761/api/v1 body: encoding: US-ASCII string: '' @@ -10,13 +10,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 200 @@ -27,11 +27,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:53 GMT + - Wed, 16 Jun 2021 15:28:39 GMT Transfer-Encoding: - chunked body: @@ -39,28 +39,24 @@ http_interactions: string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT + recorded_at: Wed, 16 Jun 2021 15:28:39 GMT - request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns/configmaps + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-newns body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-newns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{},"kind":"ConfigMap","apiVersion":"v1"}' + encoding: US-ASCII + string: '' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer - Content-Length: - - '166' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 404 @@ -71,11 +67,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:53 GMT + - Wed, 16 Jun 2021 15:28:39 GMT Content-Length: - '226' body: @@ -84,10 +80,10 @@ http_interactions: \"kubetruth-test-ns-newns\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-newns","kind":"namespaces"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT + recorded_at: Wed, 16 Jun 2021 15:28:39 GMT - request: method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-newns body: encoding: US-ASCII string: '' @@ -95,13 +91,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 404 @@ -112,11 +108,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:53 GMT + - Wed, 16 Jun 2021 15:28:39 GMT Content-Length: - '226' body: @@ -125,10 +121,10 @@ http_interactions: \"kubetruth-test-ns-newns\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-newns","kind":"namespaces"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT + recorded_at: Wed, 16 Jun 2021 15:28:39 GMT - request: method: post - uri: https://127.0.0.1:55032/api/v1/namespaces + uri: https://127.0.0.1:60761/api/v1/namespaces body: encoding: UTF-8 string: '{"metadata":{"name":"kubetruth-test-ns-newns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' @@ -136,7 +132,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Content-Type: - application/json Authorization: @@ -146,7 +142,7 @@ http_interactions: Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 201 @@ -157,66 +153,22 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:53 GMT + - Wed, 16 Jun 2021 15:28:39 GMT Content-Length: - '565' body: encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-newns","uid":"9dcf6313-e8b8-4056-9856-dc6b3a213b31","resourceVersion":"10403","creationTimestamp":"2021-02-24T19:40:53Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:40:53Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns/configmaps - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-newns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '177' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:40:53 GMT - Content-Length: - - '542' - body: - encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-newns","uid":"a6f8d176-ed8c-4b13-b6d8-736a6252d03c","resourceVersion":"10405","creationTimestamp":"2021-02-24T19:40:53Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:40:53Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-newns","uid":"c64707d8-cf5b-4906-bc31-0794832b06b0","resourceVersion":"45357","creationTimestamp":"2021-06-16T15:28:39Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:39Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT + recorded_at: Wed, 16 Jun 2021 15:28:39 GMT - request: method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns/configmaps/foo + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-newns body: encoding: US-ASCII string: '' @@ -224,13 +176,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 200 @@ -241,17 +193,17 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:53 GMT + - Wed, 16 Jun 2021 15:28:39 GMT Content-Length: - - '542' + - '565' body: encoding: UTF-8 - string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-newns","uid":"a6f8d176-ed8c-4b13-b6d8-736a6252d03c","resourceVersion":"10405","creationTimestamp":"2021-02-24T19:40:53Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:40:53Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"bar":"baz"}} + string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-newns","uid":"c64707d8-cf5b-4906-bc31-0794832b06b0","resourceVersion":"45357","creationTimestamp":"2021-06-16T15:28:39Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:39Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} ' - recorded_at: Wed, 24 Feb 2021 19:40:53 GMT + recorded_at: Wed, 16 Jun 2021 15:28:39 GMT recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/sets_labels_when_creating_namespace.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/sets_labels_when_creating_namespace.yml index 5221c90..f9865bc 100644 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/sets_labels_when_creating_namespace.yml +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/ensure_namespace/sets_labels_when_creating_namespace.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://127.0.0.1:55032/api/v1 + uri: https://127.0.0.1:60761/api/v1 body: encoding: US-ASCII string: '' @@ -10,13 +10,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 200 @@ -27,11 +27,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:56 GMT + - Wed, 16 Jun 2021 15:28:40 GMT Transfer-Encoding: - chunked body: @@ -39,28 +39,24 @@ http_interactions: string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} ' - recorded_at: Wed, 24 Feb 2021 19:40:56 GMT + recorded_at: Wed, 16 Jun 2021 15:28:40 GMT - request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns2/configmaps + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-newns2 body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-newns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"data":{},"kind":"ConfigMap","apiVersion":"v1"}' + encoding: US-ASCII + string: '' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer - Content-Length: - - '167' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 404 @@ -71,11 +67,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:56 GMT + - Wed, 16 Jun 2021 15:28:40 GMT Content-Length: - '228' body: @@ -84,10 +80,10 @@ http_interactions: \"kubetruth-test-ns-newns2\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-newns2","kind":"namespaces"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:40:56 GMT + recorded_at: Wed, 16 Jun 2021 15:28:40 GMT - request: method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-newns2 + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns-newns2 body: encoding: US-ASCII string: '' @@ -95,13 +91,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 404 @@ -112,11 +108,11 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:56 GMT + - Wed, 16 Jun 2021 15:28:40 GMT Content-Length: - '228' body: @@ -125,10 +121,10 @@ http_interactions: \"kubetruth-test-ns-newns2\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-newns2","kind":"namespaces"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:40:56 GMT + recorded_at: Wed, 16 Jun 2021 15:28:40 GMT - request: method: post - uri: https://127.0.0.1:55032/api/v1/namespaces + uri: https://127.0.0.1:60761/api/v1/namespaces body: encoding: UTF-8 string: '{"metadata":{"name":"kubetruth-test-ns-newns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' @@ -136,7 +132,7 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Content-Type: - application/json Authorization: @@ -146,7 +142,7 @@ http_interactions: Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55032 + - 127.0.0.1:60761 response: status: code: 201 @@ -157,17 +153,17 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:40:56 GMT + - Wed, 16 Jun 2021 15:28:40 GMT Content-Length: - '566' body: encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-newns2","uid":"10c73c72-38a7-4501-affa-a5298251d74f","resourceVersion":"10419","creationTimestamp":"2021-02-24T19:40:56Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:40:56Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} + string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-newns2","uid":"9015764e-a85d-4a4f-af46-0521e50022a9","resourceVersion":"45365","creationTimestamp":"2021-06-16T15:28:40Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:40Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} ' - recorded_at: Wed, 24 Feb 2021 19:40:56 GMT + recorded_at: Wed, 16 Jun 2021 15:28:40 GMT recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_updating_secrets.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/gets_existing_resource.yml similarity index 54% rename from spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_updating_secrets.yml rename to spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/gets_existing_resource.yml index 9f1a666..f574339 100644 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_updating_secrets.yml +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/gets_existing_resource.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://127.0.0.1:55028/api/v1 + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource body: encoding: US-ASCII string: '' @@ -10,39 +10,41 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: - code: 200 - message: OK + code: 404 + message: Not Found headers: Cache-Control: - no-cache, private Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:57 GMT - Transfer-Encoding: - - chunked + - Wed, 16 Jun 2021 15:28:45 GMT + Content-Length: + - '320' body: encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource","kind":"configmaps"},"code":404} ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT - request: method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/baz + uri: https://127.0.0.1:60761/api/v1 body: encoding: US-ASCII string: '' @@ -50,58 +52,57 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: - code: 404 - message: Not Found + code: 200 + message: OK headers: Cache-Control: - no-cache, private Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:57 GMT - Content-Length: - - '180' + - Wed, 16 Jun 2021 15:28:45 GMT + Transfer-Encoding: + - chunked body: encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"baz\" not found","reason":"NotFound","details":{"name":"baz","kind":"secrets"},"code":404} + string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT - request: method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps body: encoding: UTF-8 - string: '{"metadata":{"name":"baz","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"stringData":{"bar":"baz"},"kind":"Secret","apiVersion":"v1"}' + string: '{"metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource","namespace":"kubetruth-test-ns"},"data":{"bar":"baz"},"kind":"ConfigMap","apiVersion":"v1"}' headers: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Content-Type: - application/json Authorization: - Bearer Content-Length: - - '174' + - '184' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 201 @@ -112,66 +113,22 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:57 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9187","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT -- request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/baz - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9187","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '536' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:57 GMT + - Wed, 16 Jun 2021 15:28:45 GMT Content-Length: - - '519' + - '478' body: encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9188","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource","namespace":"kubetruth-test-ns","uid":"d12047c0-3b74-41f7-bb0a-b1bd03dc5cb0","resourceVersion":"45384","creationTimestamp":"2021-06-16T15:28:45Z","managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}}}}]},"data":{"bar":"baz"}} ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT - request: method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/baz + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource body: encoding: US-ASCII string: '' @@ -179,57 +136,13 @@ http_interactions: Accept: - "*/*" User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:57 GMT - Content-Length: - - '519' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9188","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT -- request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/baz - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9188","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"otherlabel":"set","app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:otherlabel":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque","stringData":{"bum":"boo"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 Authorization: - Bearer - Content-Length: - - '588' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Host: - - 127.0.0.1:55028 + - 127.0.0.1:60761 response: status: code: 200 @@ -240,17 +153,17 @@ http_interactions: Content-Type: - application/json X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 Date: - - Wed, 24 Feb 2021 19:27:57 GMT + - Wed, 16 Jun 2021 15:28:45 GMT Content-Length: - - '622' + - '478' body: encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"baz","namespace":"kubetruth-test-ns","uid":"0b8ac670-7673-4346-97c7-2734ff4046a3","resourceVersion":"9189","creationTimestamp":"2021-02-24T19:27:57Z","labels":{"app.kubernetes.io/managed-by":"kubetruth","otherlabel":"set"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:57Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{},"f:bum":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{},"f:otherlabel":{}}},"f:type":{}}}]},"data":{"bar":"YmF6","bum":"Ym9v"},"type":"Opaque"} + string: '{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"rspec-examplegroups-kubetruthkubeapi-getresourcegets-existing-resource","namespace":"kubetruth-test-ns","uid":"d12047c0-3b74-41f7-bb0a-b1bd03dc5cb0","resourceVersion":"45384","creationTimestamp":"2021-06-16T15:28:45Z","managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-06-16T15:28:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}}}}]},"data":{"bar":"baz"}} ' - recorded_at: Wed, 24 Feb 2021 19:27:57 GMT + recorded_at: Wed, 16 Jun 2021 15:28:45 GMT recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/raise_when_resource_doesn_t_exist.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/raise_when_resource_doesn_t_exist.yml new file mode 100644 index 0000000..41cc755 --- /dev/null +++ b/spec/fixtures/vcr/Kubetruth_KubeApi/get_resource/raise_when_resource_doesn_t_exist.yml @@ -0,0 +1,45 @@ +--- +http_interactions: +- request: + method: get + uri: https://127.0.0.1:60761/api/v1/namespaces/kubetruth-test-ns/configmaps/rspec-examplegroups-kubetruthkubeapi-getresourceraise-when-resource-doesn-t-exist + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + User-Agent: + - rest-client/2.1.0 (darwin20 x86_64) ruby/2.7.3p183 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Host: + - 127.0.0.1:60761 + response: + status: + code: 404 + message: Not Found + headers: + Cache-Control: + - no-cache, private + Content-Type: + - application/json + X-Kubernetes-Pf-Flowschema-Uid: + - c6d9dbd7-dd7c-4844-9970-a2c737a707e7 + X-Kubernetes-Pf-Prioritylevel-Uid: + - 3bc95a2c-9c78-4c16-8ee2-9c0b68ead8f6 + Date: + - Wed, 16 Jun 2021 15:28:44 GMT + Content-Length: + - '342' + body: + encoding: UTF-8 + string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps + \"rspec-examplegroups-kubetruthkubeapi-getresourceraise-when-resource-doesn-t-exist\" + not found","reason":"NotFound","details":{"name":"rspec-examplegroups-kubetruthkubeapi-getresourceraise-when-resource-doesn-t-exist","kind":"configmaps"},"code":404} + + ' + recorded_at: Wed, 16 Jun 2021 15:28:44 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_crud_secrets.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_crud_secrets.yml deleted file mode 100644 index e395f74..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_crud_secrets.yml +++ /dev/null @@ -1,415 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55028/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"stringData":{"bar":"baz"},"kind":"Secret","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '174' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9178","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"SecretList","apiVersion":"v1","metadata":{"resourceVersion":"9178"},"items":[{"metadata":{"name":"default-token-4j4n4","namespace":"kubetruth-test-ns","uid":"aa85b06a-6d14-4455-8a2d-8166ffaab692","resourceVersion":"9115","creationTimestamp":"2021-02-24T19:27:28Z","annotations":{"kubernetes.io/service-account.name":"default","kubernetes.io/service-account.uid":"66c62266-d58a-409f-bdbd-249212993ef7"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.crt":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCakNDQWU2Z0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRJeE1ESXlNekUyTVRjd01Gb1hEVE14TURJeU1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ZzZENKOS5EZDc5UllRY0p6TnRZREhrUXlTZnVsekZ6Y1liODk5b2dhakZUN0FVdUhua054ZmprTHJUaFRYY3cxMTN3QUkxTzZsc0x0MFY3cXNTTVZNTUhnOEViXzlCR0Z5RlVVaHMwOTlxSW9MSFhxU3RqRnBHd3NqLW1WcmZOeEpNX3lNVi00YVpCX3dzNXE4THcwTWVUdVJOclRBSWpjVTJJNVZ0alI3REgzNGY5Nm9UZnhQOERGUWl6ZmpjTzNHNDlNWjR3V3gxaHNWbkUxZUItYTBZV1BhcVhsc0tsTDBtQXM5T2l2U0dRRTg0T1VsT3ZQSk55d1FEajJCc3lZOU8zcDFDbWJwR1RXblNUM0FOZDdkblhWSGV0Mzl1djdTYzVCOUdmUmFBSFZQckFjZHEtRzJpQXk0WGVtZjVWMldQb0F0eWpHa0hzRnVzb1NqNkNEUWpyNHVMWGc="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"demo1","namespace":"kubetruth-test-ns","uid":"2517b859-031c-4b90-9304-76447713dedb","resourceVersion":"9158","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:token":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"token":"bXl0b2tlbg=="},"type":"Opaque"},{"metadata":{"name":"demo2","namespace":"kubetruth-test-ns","uid":"6ea1797c-eb16-4057-a5c1-e499516cd771","resourceVersion":"9159","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:mykey":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"mykey":"c2VrcmV0IQ=="},"type":"Opaque"},{"metadata":{"name":"demo3","namespace":"kubetruth-test-ns","uid":"efda3ba8-1bc1-446b-bf3a-b68428c3dd22","resourceVersion":"9160","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:othersecret":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"othersecret":"b3RoZXJzZWtyZXQ="},"type":"Opaque"},{"metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9178","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"},{"metadata":{"name":"kubetruth-test-app","namespace":"kubetruth-test-ns","uid":"34913f69-0630-42e8-90a2-264a7b5eee12","resourceVersion":"9118","creationTimestamp":"2021-02-24T19:27:28Z","labels":{"app.kubernetes.io/instance":"kubetruth-test-app","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"kubetruth","app.kubernetes.io/version":"0.2.0","helm.sh/chart":"kubetruth-0.2.0"},"annotations":{"meta.helm.sh/release-name":"kubetruth-test-app","meta.helm.sh/release-namespace":"kubetruth-test-ns"},"managedFields":[{"manager":"Go-http-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:CLOUDTRUTH_API_KEY":{}},"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/instance":{},"f:app.kubernetes.io/managed-by":{},"f:app.kubernetes.io/name":{},"f:app.kubernetes.io/version":{},"f:helm.sh/chart":{}}},"f:type":{}}}]},"data":{"CLOUDTRUTH_API_KEY":""},"type":"Opaque"},{"metadata":{"name":"kubetruth-test-app-token-dbw7j","namespace":"kubetruth-test-ns","uid":"3afeb486-e794-454e-97d9-50ce261cba63","resourceVersion":"9120","creationTimestamp":"2021-02-24T19:27:28Z","annotations":{"kubernetes.io/service-account.name":"kubetruth-test-app","kubernetes.io/service-account.uid":"9d5d96aa-f95d-4d65-b9b7-7b6352f1fc16"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.crt":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCakNDQWU2Z0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRJeE1ESXlNekUyTVRjd01Gb1hEVE14TURJeU1qRTJNVGN3TUZvd0ZURVRNQkVHQTFVRQpBeE1LYldsdWFXdDFZbVZEUVRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS1pNCjlwVFdhYlk3RmdLYWprNU1CaXRaU091MTEycFRIQ3RwZVdhZmdRZjE1MFlBbHBaSlFpZUd5N1l2WDhhdW5KMncKY01WZ0x2Zkw3RVZzVjJ3eU92aVlWQ21CZktmRnIyMDdia3FoWlo1S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IaXA3NE5qbnVHQjJhWk5jbTNmeGg2NEpXaTVXR0lGalhPR1RIVTZMUVlOR3NaR1JWWlliZFEtZHhDSVhuclUyQjFNTmVDS0hFejJkMWNjWm9wVHZNX0MzaHRrUzh2dmhsakREX2RfeEJwRXozZ1RZdGR4cThQb1kwRHlvUEl6UGd2WU9DZ0Uwa3ZlOFJndVVvbTlESlVabTNudUtGallUcWxmN3dmd0pEcGY2dU5KRmdwcUl0RWNQVXl4VzljbXVkVlhwTlhTdw=="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"sh.helm.release.v1.kubetruth-test-app.v1","namespace":"kubetruth-test-ns","uid":"13bc8f06-78c1-40e9-aa73-5a108bc1c4c2","resourceVersion":"9124","creationTimestamp":"2021-02-24T19:27:28Z","labels":{"modifiedAt":"1614194848","name":"kubetruth-test-app","owner":"helm","status":"deployed","version":"1"},"managedFields":[{"manager":"helm","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:release":{}},"f:metadata":{"f:labels":{".":{},"f:modifiedAt":{},"f:name":{},"f:owner":{},"f:status":{},"f:version":{}}},"f:type":{}}}]},"data":{"release":"SDRzSUFBQUFBQUFDLyt4YmVZK2J5cGIvS2hidjMrNWN3Q0dKTGIwL0RHbGphTGNUYnl4MSsrcUtLbWpBcmdMQ1lodEgrZTZqWWpOZXU1T1hPNk1aVGFTb2JhamxuTi9aVDVXL000RkZIS2JQckRQb3BIR1dldmVwazZUM1ZoUXhkNHdmdklSTS96dno0c2RKK3JmdFJEak1IWnZwTXp6TGMvY3NmOCsvWDNEdisvekhQdi9wblNBSTdDZituaFg2TE12Y01kajY2U20yZzUyMEdGeDhTVkRzUjZrZkJreWZVWUlrdFREdW9KQkVkQkJ6eHlTcGxXWUowMmVhVGU2WUlFd2QrdWc1WUg3Y01jaXo0cFRTVDV6VXNxM1VvcDlQK1dYdW1JMFRKK1UyN0R2K0hYdTIrY0p6T2hJT00z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UeHVQUVp4SXFTWnNER2lXSDUwblhTWithdTg4eGdQNmsrbGNHcC9GeitwcVA4WFA1dXBWcmpqWHRYT1V2ejlsL3RJUk9LUVRHTTVQZmx5TjlHNFJzRjJtNG0vSnBjeFhLRlg3UFFDNkpQTXJoeVVGcEwrTEo3cFFqZDJ1SzFUU2pyTStlbDJLT3RvcmRYclNWK0E1dzNBWDl5by9NWWR5dUtraGJFbjV1eC94OVV5SE9RUkE0cStLb3kwNlRmNGVqWHBNcDhLNTZKbFNKdjNFYmh6VHorQ3BlMWFPdmQyM0tpLy9BeEpUOUJ5NjloM3FCVWZEbXluY2xOcTZHamp6TDZGczNmZjlTZlVSaWtsaDg0Y1p1bCs4NVZGbTZ0ZXJ3eS9WY1VQRlE1THBWRy9TT05hVTM0MnBSYS9VNVphYldISEp6eXJaMmRZRE9NUTNJeTVyNzZ3Vjd0TDQ3L0JhL2dXWWd3ZHBPelJZc3g3VjhsY3EySytQeVhta0hDL1BpdkFBQUEvLytRTUx0MXhqa0FBQT09"},"type":"helm.sh/release.v1"}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9178","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9178","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: put - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9178","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque","stringData":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '587' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9179","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns","uid":"6c869eb1-8604-4e34-8820-53cc16071276","resourceVersion":"9179","creationTimestamp":"2021-02-24T19:27:51Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:51Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: delete - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '156' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"secrets","uid":"6c869eb1-8604-4e34-8820-53cc16071276"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:51 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:51 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_use_multiple_namespaces_for_secrets.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_use_multiple_namespaces_for_secrets.yml deleted file mode 100644 index b2ac96d..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/can_use_multiple_namespaces_for_secrets.yml +++ /dev/null @@ -1,1037 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55032/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '234' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces - \"kubetruth-test-ns-secretns1\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-secretns1","kind":"namespaces"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces - body: - encoding: UTF-8 - string: '{"metadata":{"name":"kubetruth-test-ns-secretns1","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '142' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '569' - body: - encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-secretns1","uid":"6bf19459-83df-44a5-8829-7af99627dea8","resourceVersion":"10465","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '569' - body: - encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-secretns1","uid":"6bf19459-83df-44a5-8829-7af99627dea8","resourceVersion":"10465","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '234' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces - \"kubetruth-test-ns-secretns2\" not found","reason":"NotFound","details":{"name":"kubetruth-test-ns-secretns2","kind":"namespaces"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces - body: - encoding: UTF-8 - string: '{"metadata":{"name":"kubetruth-test-ns-secretns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"kind":"Namespace","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '142' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '569' - body: - encoding: UTF-8 - string: '{"kind":"Namespace","apiVersion":"v1","metadata":{"name":"kubetruth-test-ns-secretns2","uid":"906e2859-64af-42e9-ad1f-ae207fa8e3c4","resourceVersion":"10470","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:status":{"f:phase":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"stringData":{"bar":"baz"},"kind":"Secret","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '184' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10475","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"SecretList","apiVersion":"v1","metadata":{"resourceVersion":"10475"},"items":[{"metadata":{"name":"default-token-h2xxc","namespace":"kubetruth-test-ns-secretns1","uid":"8868bdee-f429-40cc-85d1-6335d696f42a","resourceVersion":"10468","creationTimestamp":"2021-02-24T19:41:26Z","annotations":{"kubernetes.io/service-account.name":"default","kubernetes.io/service-account.uid":"30309fa7-6a2c-48ca-bb84-a8fbaabffdbe"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.cr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mxZV05qYjNWdWRDOXpaWEoyYVdObExXRmpZMjkxYm5RdWRXbGtJam9pTXpBek1EbG1ZVGN0Tm1FeVl5MDBPR05oTFdKaU9EUXRZVGhtWW1GaFltWm1aR0psSWl3aWMzVmlJam9pYzNsemRHVnRPbk5sY25acFkyVmhZMk52ZFc1ME9tdDFZbVYwY25WMGFDMTBaWE4wTFc1ekxYTmxZM0psZEc1ek1UcGtaV1poZFd4MEluMC5xOVB1am9JZlE2czIyNE5sbnhQaDZQdlVSenRiY0VCZFU2MFBXaGtodE5BZl9mY2Z6UXhSb2NSN3pNekJJaWZTNVUyMVZENlRsMlhFd0FrZ0tkT3Zfc3hhaWdsUk1UTzQ2cHpvZVppazFOWmQ1WDRPQjVSS3hlcG42aHFhTExZQ0tpSjlnR2VUYV9MRm5McS1sODZvTnpuajhsSXpFa1FJM0pfSXdIa2tKLUFmV2t5OWFreHg1NUFqbVFKR3hENllDNy1WSXZuQk1jWEwtTW9pZjMzeUluMGNnUmw3RGVKSWRqSVhjRzAzZzA5ZHJnVlBvVFBWSS1zNjJZN0lMVVpxMjRfVHhhVkZSdGpyZXdvVzAxbS1xSmt3OUVkOWRwcmZiRk9RZ0FIeEpsOXJwWkFua0FiZW1EenJYRjJrd1d6STBNN1I2YklIQzliMTZTbEE0RFpyX2c="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10475","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10475","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10475","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: put - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10475","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque","stringData":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '598' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10477","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns1","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9","resourceVersion":"10477","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: delete - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '156' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"secrets","uid":"8ac853db-6c68-4349-afd3-dc2c9fe86ff9"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns1/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: post - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets - body: - encoding: UTF-8 - string: '{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"stringData":{"bar":"baz"},"kind":"Secret","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '184' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10479","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"SecretList","apiVersion":"v1","metadata":{"resourceVersion":"10479"},"items":[{"metadata":{"name":"default-token-fn5rt","namespace":"kubetruth-test-ns-secretns2","uid":"405e5a20-f792-4d90-be7b-791405ee88df","resourceVersion":"10473","creationTimestamp":"2021-02-24T19:41:26Z","annotations":{"kubernetes.io/service-account.name":"default","kubernetes.io/service-account.uid":"c276a984-1750-470c-91a7-18b96cbc366f"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.crt":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCakNDQWU2Z0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRJeE1ESXlNekUyTVRjd01Gb1hEVE14TURJeU1qRTJNVGN3TUZvd0ZURVRNQkVHQTFVRQpBeE1LYldsdWFXdDFZbVZEUVRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRV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SFNaRnl1TDZnV3ZRTUM2c2J6UXNqd1JZaTFkc3QwTzFRSnBBY2V0S2RQVDB1Z1VyRFY5TWtpOVE5c1RpUUViZHBOU3g4cGRQZUlPMk4wQkVFallZWWluZzBnZGRIOGxEeTcwTlVjYklkQklfNzdpaVRQclJ6TmJ5NFY2ZTFJZGVEX242d091VzVIbV8tUWExZTFFZVFNeHVjMHBmSjBua2ppOUZmUzNnZUhaUmV6bzFpaG52Y04wUU4xM2tpRGZCZVJaaE93MFBmQnYtaUtielp2Wk5QZFdDUkhiX2d3elAxR0gyVE8xem1yNkJ4ZVNZTWFrZGgzaXpVUGRKZ2VELTBEaE9GMVhyX0JkSFBkY0VmcWdFQjJoOFBINzZCZll2WmtQVnZxdjV0Zm5PdXFMQ3c="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10479","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10479","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10479","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: put - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10479","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque","stringData":{"bar":"bum"}}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '598' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10480","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '572' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"foo","namespace":"kubetruth-test-ns-secretns2","uid":"9af63933-6268-440a-9c01-e2f5ec437de9","resourceVersion":"10480","creationTimestamp":"2021-02-24T19:41:26Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:41:26Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YnVt"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: delete - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '156' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success","details":{"name":"foo","kind":"secrets","uid":"9af63933-6268-440a-9c01-e2f5ec437de9"}} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -- request: - method: get - uri: https://127.0.0.1:55032/api/v1/namespaces/kubetruth-test-ns-secretns2/secrets/foo - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55032 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:41:26 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"foo\" not found","reason":"NotFound","details":{"name":"foo","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:41:26 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_creating_secrets.yml b/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_creating_secrets.yml deleted file mode 100644 index e62238c..0000000 --- a/spec/fixtures/vcr/Kubetruth_KubeApi/secrets/sets_labels_when_creating_secrets.yml +++ /dev/null @@ -1,168 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://127.0.0.1:55028/api/v1 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:55 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"componentstatuses","singularName":"","namespaced":false,"kind":"ComponentStatus","verbs":["get","list"],"shortNames":["cs"]},{"name":"configmaps","singularName":"","namespaced":true,"kind":"ConfigMap","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["cm"],"storageVersionHash":"qFsyl6wFWjQ="},{"name":"endpoints","singularName":"","namespaced":true,"kind":"Endpoints","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ep"],"storageVersionHash":"fWeeMqaN/OA="},{"name":"events","singularName":"","namespaced":true,"kind":"Event","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["ev"],"storageVersionHash":"r2yiGXH7wu8="},{"name":"limitranges","singularName":"","namespaced":true,"kind":"LimitRange","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["limits"],"storageVersionHash":"EBKMFVe6cwo="},{"name":"namespaces","singularName":"","namespaced":false,"kind":"Namespace","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["ns"],"storageVersionHash":"Q3oi5N2YM8M="},{"name":"namespaces/finalize","singularName":"","namespaced":false,"kind":"Namespace","verbs":["update"]},{"name":"namespaces/status","singularName":"","namespaced":false,"kind":"Namespace","verbs":["get","patch","update"]},{"name":"nodes","singularName":"","namespaced":false,"kind":"Node","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["no"],"storageVersionHash":"XwShjMxG9Fs="},{"name":"nodes/proxy","singularName":"","namespaced":false,"kind":"NodeProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"nodes/status","singularName":"","namespaced":false,"kind":"Node","verbs":["get","patch","update"]},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pvc"],"storageVersionHash":"QWTyNDq0dC4="},{"name":"persistentvolumeclaims/status","singularName":"","namespaced":true,"kind":"PersistentVolumeClaim","verbs":["get","patch","update"]},{"name":"persistentvolumes","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["pv"],"storageVersionHash":"HN/zwEC+JgM="},{"name":"persistentvolumes/status","singularName":"","namespaced":false,"kind":"PersistentVolume","verbs":["get","patch","update"]},{"name":"pods","singularName":"","namespaced":true,"kind":"Pod","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["po"],"categories":["all"],"storageVersionHash":"xPOwRZ+Yhw8="},{"name":"pods/attach","singularName":"","namespaced":true,"kind":"PodAttachOptions","verbs":["create","get"]},{"name":"pods/binding","singularName":"","namespaced":true,"kind":"Binding","verbs":["create"]},{"name":"pods/eviction","singularName":"","namespaced":true,"group":"policy","version":"v1beta1","kind":"Eviction","verbs":["create"]},{"name":"pods/exec","singularName":"","namespaced":true,"kind":"PodExecOptions","verbs":["create","get"]},{"name":"pods/log","singularName":"","namespaced":true,"kind":"Pod","verbs":["get"]},{"name":"pods/portforward","singularName":"","namespaced":true,"kind":"PodPortForwardOptions","verbs":["create","get"]},{"name":"pods/proxy","singularName":"","namespaced":true,"kind":"PodProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"pods/status","singularName":"","namespaced":true,"kind":"Pod","verbs":["get","patch","update"]},{"name":"podtemplates","singularName":"","namespaced":true,"kind":"PodTemplate","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"LIXB2x4IFpk="},{"name":"replicationcontrollers","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["rc"],"categories":["all"],"storageVersionHash":"Jond2If31h0="},{"name":"replicationcontrollers/scale","singularName":"","namespaced":true,"group":"autoscaling","version":"v1","kind":"Scale","verbs":["get","patch","update"]},{"name":"replicationcontrollers/status","singularName":"","namespaced":true,"kind":"ReplicationController","verbs":["get","patch","update"]},{"name":"resourcequotas","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["quota"],"storageVersionHash":"8uhSgffRX6w="},{"name":"resourcequotas/status","singularName":"","namespaced":true,"kind":"ResourceQuota","verbs":["get","patch","update"]},{"name":"secrets","singularName":"","namespaced":true,"kind":"Secret","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"storageVersionHash":"S6u1pOWzb84="},{"name":"serviceaccounts","singularName":"","namespaced":true,"kind":"ServiceAccount","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"shortNames":["sa"],"storageVersionHash":"pbx9ZvyFpBE="},{"name":"serviceaccounts/token","singularName":"","namespaced":true,"group":"authentication.k8s.io","version":"v1","kind":"TokenRequest","verbs":["create"]},{"name":"services","singularName":"","namespaced":true,"kind":"Service","verbs":["create","delete","get","list","patch","update","watch"],"shortNames":["svc"],"categories":["all"],"storageVersionHash":"0/CO1lhkEBI="},{"name":"services/proxy","singularName":"","namespaced":true,"kind":"ServiceProxyOptions","verbs":["create","delete","get","patch","update"]},{"name":"services/status","singularName":"","namespaced":true,"kind":"Service","verbs":["get","patch","update"]}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:55 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets/bar - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 404 - message: Not Found - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:55 GMT - Content-Length: - - '180' - body: - encoding: UTF-8 - string: '{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets - \"bar\" not found","reason":"NotFound","details":{"name":"bar","kind":"secrets"},"code":404} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:55 GMT -- request: - method: post - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets - body: - encoding: UTF-8 - string: '{"metadata":{"name":"bar","namespace":"kubetruth-test-ns","labels":{"app.kubernetes.io/managed-by":"kubetruth"}},"stringData":{"bar":"baz"},"kind":"Secret","apiVersion":"v1"}' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Content-Type: - - application/json - Authorization: - - Bearer - Content-Length: - - '174' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 201 - message: Created - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:55 GMT - Content-Length: - - '561' - body: - encoding: UTF-8 - string: '{"kind":"Secret","apiVersion":"v1","metadata":{"name":"bar","namespace":"kubetruth-test-ns","uid":"eae323f6-ee71-4735-a0fc-0593c8dfe933","resourceVersion":"9185","creationTimestamp":"2021-02-24T19:27:55Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:55Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:55 GMT -- request: - method: get - uri: https://127.0.0.1:55028/api/v1/namespaces/kubetruth-test-ns/secrets - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*" - User-Agent: - - rest-client/2.1.0 (darwin19.6.0 x86_64) ruby/2.7.2p137 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Host: - - 127.0.0.1:55028 - response: - status: - code: 200 - message: OK - headers: - Cache-Control: - - no-cache, private - Content-Type: - - application/json - X-Kubernetes-Pf-Flowschema-Uid: - - 79cb606d-7c9d-44be-83c0-aa28372c4240 - X-Kubernetes-Pf-Prioritylevel-Uid: - - f0c96815-d8bd-44ca-ba8b-6e8ac08b1d04 - Date: - - Wed, 24 Feb 2021 19:27:55 GMT - Transfer-Encoding: - - chunked - body: - encoding: UTF-8 - string: '{"kind":"SecretList","apiVersion":"v1","metadata":{"resourceVersion":"9185"},"items":[{"metadata":{"name":"bar","namespace":"kubetruth-test-ns","uid":"eae323f6-ee71-4735-a0fc-0593c8dfe933","resourceVersion":"9185","creationTimestamp":"2021-02-24T19:27:55Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:55Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:bar":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"bar":"YmF6"},"type":"Opaque"},{"metadata":{"name":"default-token-4j4n4","namespace":"kubetruth-test-ns","uid":"aa85b06a-6d14-4455-8a2d-8166ffaab692","resourceVersion":"9115","creationTimestamp":"2021-02-24T19:27:28Z","annotations":{"kubernetes.io/service-account.name":"default","kubernetes.io/service-account.uid":"66c62266-d58a-409f-bdbd-249212993ef7"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.crt":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCakNDQWU2Z0F3SUJBZ0lCQ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NU9UTmxaamNpTENKemRXSWlPaUp6ZVhOMFpXMDZjMlZ5ZG1salpXRmpZMjkxYm5RNmEzVmlaWFJ5ZFhSb0xYUmxjM1F0Ym5NNlpHVm1ZWFZzZENKOS5EZDc5UllRY0p6TnRZREhrUXlTZnVsekZ6Y1liODk5b2dhakZUN0FVdUhua054ZmprTHJUaFRYY3cxMTN3QUkxTzZsc0x0MFY3cXNTTVZNTUhnOEViXzlCR0Z5RlVVaHMwOTlxSW9MSFhxU3RqRnBHd3NqLW1WcmZOeEpNX3lNVi00YVpCX3dzNXE4THcwTWVUdVJOclRBSWpjVTJJNVZ0alI3REgzNGY5Nm9UZnhQOERGUWl6ZmpjTzNHNDlNWjR3V3gxaHNWbkUxZUItYTBZV1BhcVhsc0tsTDBtQXM5T2l2U0dRRTg0T1VsT3ZQSk55d1FEajJCc3lZOU8zcDFDbWJwR1RXblNUM0FOZDdkblhWSGV0Mzl1djdTYzVCOUdmUmFBSFZQckFjZHEtRzJpQXk0WGVtZjVWMldQb0F0eWpHa0hzRnVzb1NqNkNEUWpyNHVMWGc="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"demo1","namespace":"kubetruth-test-ns","uid":"2517b859-031c-4b90-9304-76447713dedb","resourceVersion":"9158","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:token":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"token":"bXl0b2tlbg=="},"type":"Opaque"},{"metadata":{"name":"demo2","namespace":"kubetruth-test-ns","uid":"6ea1797c-eb16-4057-a5c1-e499516cd771","resourceVersion":"9159","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:mykey":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"mykey":"c2VrcmV0IQ=="},"type":"Opaque"},{"metadata":{"name":"demo3","namespace":"kubetruth-test-ns","uid":"efda3ba8-1bc1-446b-bf3a-b68428c3dd22","resourceVersion":"9160","creationTimestamp":"2021-02-24T19:27:35Z","labels":{"app.kubernetes.io/managed-by":"kubetruth"},"managedFields":[{"manager":"rest-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:othersecret":{}},"f:metadata":{"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:type":{}}}]},"data":{"othersecret":"b3RoZXJzZWtyZXQ="},"type":"Opaque"},{"metadata":{"name":"kubetruth-test-app","namespace":"kubetruth-test-ns","uid":"34913f69-0630-42e8-90a2-264a7b5eee12","resourceVersion":"9118","creationTimestamp":"2021-02-24T19:27:28Z","labels":{"app.kubernetes.io/instance":"kubetruth-test-app","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"kubetruth","app.kubernetes.io/version":"0.2.0","helm.sh/chart":"kubetruth-0.2.0"},"annotations":{"meta.helm.sh/release-name":"kubetruth-test-app","meta.helm.sh/release-namespace":"kubetruth-test-ns"},"managedFields":[{"manager":"Go-http-client","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:CLOUDTRUTH_API_KEY":{}},"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/instance":{},"f:app.kubernetes.io/managed-by":{},"f:app.kubernetes.io/name":{},"f:app.kubernetes.io/version":{},"f:helm.sh/chart":{}}},"f:type":{}}}]},"data":{"CLOUDTRUTH_API_KEY":""},"type":"Opaque"},{"metadata":{"name":"kubetruth-test-app-token-dbw7j","namespace":"kubetruth-test-ns","uid":"3afeb486-e794-454e-97d9-50ce261cba63","resourceVersion":"9120","creationTimestamp":"2021-02-24T19:27:28Z","annotations":{"kubernetes.io/service-account.name":"kubetruth-test-app","kubernetes.io/service-account.uid":"9d5d96aa-f95d-4d65-b9b7-7b6352f1fc16"},"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ca.crt":{},"f:namespace":{},"f:token":{}},"f:metadata":{"f:annotations":{".":{},"f:kubernetes.io/service-account.name":{},"f:kubernetes.io/service-account.uid":{}}},"f:type":{}}}]},"data":{"ca.crt":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCakNDQWU2Z0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRJeE1ESXlNekUyTVRjd01Gb1hEVE14TURJeU1qRTJNVGN3TUZvd0ZURVRNQkVHQTFVRQpBeE1LYldsdWFXdDFZbVZEUVRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS1pNCjlwVFdhYlk3RmdLYWprNU1CaXRaU091MTEycFRIQ3RwZVdhZmdRZjE1MFlBbHBaSlFpZUd5N1l2WDhhdW5KMncKY01WZ0x2Zkw3RVZzVjJ3eU92aVlWQ21CZktmRnIyMDdia3FoWlo1SnVHVzRYNkY0SHRsUkx6dW94QXA4RStqSgpyc0JtTEZSTWwrbkRiMk8rOEJhVWphVUNYTzV1Z1U4VFVuNG91cjdodTJTWE5YVTZvajVZb1R1ZWE4STE0MUwyCjVBaEU3cVRRak02QjcvbEI3OVI1Zm1qOWZIOWlQU0JjOXJqNEZYZ3dMa1luVFZBeWUvbmt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ndVVvbTlESlVabTNudUtGallUcWxmN3dmd0pEcGY2dU5KRmdwcUl0RWNQVXl4VzljbXVkVlhwTlhTdw=="},"type":"kubernetes.io/service-account-token"},{"metadata":{"name":"sh.helm.release.v1.kubetruth-test-app.v1","namespace":"kubetruth-test-ns","uid":"13bc8f06-78c1-40e9-aa73-5a108bc1c4c2","resourceVersion":"9124","creationTimestamp":"2021-02-24T19:27:28Z","labels":{"modifiedAt":"1614194848","name":"kubetruth-test-app","owner":"helm","status":"deployed","version":"1"},"managedFields":[{"manager":"helm","operation":"Update","apiVersion":"v1","time":"2021-02-24T19:27:28Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:release":{}},"f:metadata":{"f:labels":{".":{},"f:modifiedAt":{},"f:name":{},"f:owner":{},"f:status":{},"f:version":{}}},"f:type":{}}}]},"data":{"release":"SDRzSUFBQUFBQUFDLyt4YmVZK2J5cGIvS2hidjMrNWN3Q0dKTGIwL0RHbGphTGNUYnl4MSsrcUtLbWpBcmdMQ1lodEgrZTZqWWpOZXU1T1hPNk1aVGFTb2JhamxuTi9aVDVXL000RkZIS2JQckRQb3BIR1dldmVwazZUM1ZoUXhkNHdmdklSTS96dno0c2RKK3JmdFJEak1IWnZwTXp6TGMvY3NmOCsvWDNEdisvekhQdi9wblNBSTdDZituaFg2TE12Y01kajY2U20yZzUyMEdGeDhTVkRzUjZrZkJreWZVWUlrdFREdW9KQkVkQkJ6eHlTcGxXWUowMmVhVGU2WUlFd2QrdWc1WUg3Y01jaXo0cFRTVDV6VXNxM1VvcDlQK1dYdW1JMFRKK1UyN0R2K0hYdTIrY0p6T2hJT00zdEJKM1Q4SUhYYzJLSXZPeTloM0tGTHhZR1RPa2tuOWF5MEUyV0o1eVNkeUlvdDRxUk8zTWtpMjZKdi9TQU4yNk5SR0x6NGJvZFlVZEt4QXJ1VE9DaDIwb1M1WTZ6STF4cWlObnp4Sk5MT3lFenppUEppUlJIMlVVRVFaUnVIYU0zMGd3empPeVoxU0lT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clNWK0E1dzNBWDl5by9NWWR5dUtraGJFbjV1eC94OVV5SE9RUkE0cStLb3kwNlRmNGVqWHBNcDhLNTZKbFNKdjNFYmh6VHorQ3BlMWFPdmQyM0tpLy9BeEpUOUJ5NjloM3FCVWZEbXluY2xOcTZHamp6TDZGczNmZjlTZlVSaWtsaDg0Y1p1bCs4NVZGbTZ0ZXJ3eS9WY1VQRlE1THBWRy9TT05hVTM0MnBSYS9VNVphYldISEp6eXJaMmRZRE9NUTNJeTVyNzZ3Vjd0TDQ3L0JhL2dXWWd3ZHBPelJZc3g3VjhsY3EySytQeVhta0hDL1BpdkFBQUEvLytRTUx0MXhqa0FBQT09"},"type":"helm.sh/release.v1"}]} - - ' - recorded_at: Wed, 24 Feb 2021 19:27:55 GMT -recorded_with: VCR 6.0.0 diff --git a/spec/kubetruth/cli_spec.rb b/spec/kubetruth/cli_spec.rb index f3ccefd..deca04a 100644 --- a/spec/kubetruth/cli_spec.rb +++ b/spec/kubetruth/cli_spec.rb @@ -95,22 +95,23 @@ def all_usage(clazz, path=[]) --kube-url ku --dry-run --polling-interval 27 - --no-metadata ] + + expect(Project).to receive(:ctapi_context=).with({ + organization: "acme", + environment: "production", + api_key: "abc123" + }) + etl = double(ETL) - expect(ETL).to receive(:new).with(ct_context: { - organization: "acme", - environment: "production", - api_key: "abc123" - }, - kube_context: { + expect(ETL).to receive(:new).with(kube_context: { namespace: "kn", token: "kt", api_url: "ku" }, - dry_run: true, - metadata: false).and_return(etl) - expect(etl).to receive(:with_polling).with(27) + dry_run: true).and_return(etl) + expect(etl).to receive(:apply) + expect(etl).to receive(:with_polling).with(27).and_yield cli.run(args) end diff --git a/spec/kubetruth/config_spec.rb b/spec/kubetruth/config_spec.rb index cb9899c..60e05e8 100644 --- a/spec/kubetruth/config_spec.rb +++ b/spec/kubetruth/config_spec.rb @@ -6,16 +6,36 @@ module Kubetruth let(:config) { described_class.new([]) } + describe "ProjectSpec" do + + it "has same keys for defaults and struct" do + expect(described_class::ProjectSpec.new.to_h.keys).to eq(described_class::DEFAULT_SPEC.keys) + end + + it "converts types" do + spec = described_class::ProjectSpec.new( + scope: "root", + project_selector: "foo", + configmap_template: "bar", + skip: true + ) + expect(spec.scope).to be_an_instance_of(String) + expect(spec.scope).to eq("root") + expect(spec.project_selector).to be_an_instance_of(Regexp) + expect(spec.project_selector).to eq(/foo/) + expect(spec.configmap_template).to be_an_instance_of(Template) + expect(spec.configmap_template.source).to eq("bar") + expect(spec.skip).to equal(true) + end + + end + describe "initialization" do it "sets mappings" do expect(config.instance_variable_get(:@project_mapping_crds)).to eq([]) end - it "has same keys for defaults and struct" do - expect(described_class::ProjectSpec.new.to_h.keys).to eq(described_class::DEFAULT_SPEC.keys) - end - end describe "load" do @@ -53,33 +73,30 @@ module Kubetruth scope: "root", project_selector: "project_selector", key_selector: "key_selector", - key_filter: "key_filter", - configmap_name_template: "configmap_name_template", - secret_name_template: "secret_name_template", - namespace_template: "namespace_template", - key_template: "key_template", skip: true, skip_secrets: true, - included_projects: ["included_projects"] + included_projects: ["included_projects"], + configmap_template: "configmap_template", + secret_template: "secret_template" }, { scope: "override", project_selector: "project_overrides:project_selector", - configmap_name_template: "project_overrides:configmap_name_template" + configmap_template: "project_overrides:configmap_template" } ] config = described_class.new(data) config.load expect(config.instance_variable_get(:@config)).to_not eq(Kubetruth::Config::DEFAULT_SPEC) expect(config.root_spec).to be_an_instance_of(Kubetruth::Config::ProjectSpec) - expect(config.root_spec.configmap_name_template).to be_an_instance_of(Kubetruth::Template) - expect(config.root_spec.configmap_name_template.source).to eq("configmap_name_template") + expect(config.root_spec.configmap_template).to be_an_instance_of(Kubetruth::Template) + expect(config.root_spec.configmap_template.source).to eq("configmap_template") expect(config.root_spec.key_selector).to eq(/key_selector/) expect(config.override_specs.size).to eq(1) expect(config.override_specs.first).to be_an_instance_of(Kubetruth::Config::ProjectSpec) - expect(config.override_specs.first.configmap_name_template).to be_an_instance_of(Kubetruth::Template) - expect(config.override_specs.first.configmap_name_template.source).to eq("project_overrides:configmap_name_template") - expect(config.override_specs.first.secret_name_template.source).to eq(config.root_spec.secret_name_template.source) + expect(config.override_specs.first.configmap_template).to be_an_instance_of(Kubetruth::Template) + expect(config.override_specs.first.configmap_template.source).to eq("project_overrides:configmap_template") + expect(config.override_specs.first.secret_template.source).to eq(config.root_spec.secret_template.source) end end @@ -115,23 +132,30 @@ module Kubetruth end it "returns the matching override specs" do - config = described_class.new([{scope: "override", project_selector: "fo+", configmap_name_template: "foocm"}]) + config = described_class.new([{scope: "override", project_selector: "fo+", configmap_template: "foocm"}]) spec = config.spec_for_project("foo") expect(spec).to_not equal(config.root_spec) - expect(spec.configmap_name_template).to be_an_instance_of(Kubetruth::Template) - expect(spec.configmap_name_template.source).to eq("foocm") + expect(spec.configmap_template).to be_an_instance_of(Kubetruth::Template) + expect(spec.configmap_template.source).to eq("foocm") end - it "warns for multiple matching specs" do + it "raises for multiple matching specs" do config = described_class.new([ - {scope: "override", project_selector: "bo+", configmap_name_template: "not"}, - {scope: "override", project_selector: "fo+", configmap_name_template: "first"}, - {scope: "override", project_selector: "foo", configmap_name_template: "second"} + {scope: "override", project_selector: "bo+", configmap_template: "not"}, + {scope: "override", project_selector: "fo+", configmap_template: "first"}, + {scope: "override", project_selector: "foo", configmap_template: "second"} ]) + expect { config.spec_for_project("foo") }.to raise_error(Config::DuplicateSelection, /Multiple configuration specs/) + end + + it "memoizes specs by project name" do + config = described_class.new([{scope: "override", project_selector: "fo+", configmap_template: "foocm"}]) + expect(config.instance_variable_get(:@spec_mapping)).to eq({}) spec = config.spec_for_project("foo") - expect(Logging.contents).to include("Multiple configuration specs match the project") - expect(spec.configmap_name_template).to be_an_instance_of(Kubetruth::Template) - expect(spec.configmap_name_template.source).to eq("first") + expect(config.instance_variable_get(:@spec_mapping)).to eq({"foo" => spec}) + expect(config.override_specs).to_not receive(:find_all) + spec2 = config.spec_for_project("foo") + expect(spec2).to equal(spec) end end diff --git a/spec/kubetruth/etl_spec.rb b/spec/kubetruth/etl_spec.rb index 7879641..3c8ebff 100644 --- a/spec/kubetruth/etl_spec.rb +++ b/spec/kubetruth/etl_spec.rb @@ -5,66 +5,38 @@ module Kubetruth describe ETL do let(:init_args) {{ - ct_context: {}, kube_context: {} + kube_context: {} }} let(:etl) { described_class.new(init_args) } - def kubeapi(ns) + def kubeapi kapi = double(Kubetruth::KubeApi) - ns = ns.present? ? ns : nil - allow(Kubetruth::KubeApi).to receive(:new).with(hash_including(namespace: ns)).and_return(kapi) - allow(kapi).to receive(:get_config_map).and_return(Kubeclient::Resource.new) - allow(kapi).to receive(:get_secret).and_return(Kubeclient::Resource.new) + allow(Kubetruth::KubeApi).to receive(:new).and_return(kapi) + allow(kapi).to receive(:get_resource).and_return(Kubeclient::Resource.new) + allow(kapi).to receive(:apply_resource) allow(kapi).to receive(:under_management?).and_return(true) - allow(kapi).to receive(:secret_hash).and_return({}) - allow(kapi).to receive(:get_config_map_names).and_return([]) - allow(kapi).to receive(:get_secret_names).and_return([]) allow(kapi).to receive(:ensure_namespace) - allow(kapi).to receive(:namespace).and_return(ns.nil? ? "default" : ns) + allow(kapi).to receive(:namespace).and_return("default") allow(kapi).to receive(:get_project_mappings).and_return([]) kapi end before(:each) do - @ctapi_class = Class.new - @ctapi = double() - allow(Kubetruth).to receive(:CtApi).and_return(@ctapi_class) - allow(@ctapi_class).to receive(:new).and_return(@ctapi) - - @kubeapi = kubeapi("") - end - - describe "#ctapi" do - - it "is memoized" do - etl = described_class.new(init_args) - expect(etl.ctapi).to equal(etl.ctapi) - end - + @kubeapi = kubeapi end describe "#kubeapi" do it "passes namespace to ctor" do - etl = described_class.new(init_args) - expect(Kubetruth::KubeApi).to receive(:new).with(hash_including(namespace: "foo")) - etl.kubeapi("foo") - end - - it "overrides namespace from kube context in ctor" do - etl = described_class.new(init_args.merge({kube_context: {namespace: "bar"}})) - expect(Kubetruth::KubeApi).to receive(:new).with(hash_including(namespace: "foo")) - etl.kubeapi("foo") + etl = described_class.new(kube_context: {namespace: "foo"}) + expect(Kubetruth::KubeApi).to receive(:new).with(namespace: "foo") + etl.kubeapi end it "is memoized" do etl = described_class.new(init_args) - expect(etl.kubeapi("")).to equal(etl.kubeapi("")) - end - - it "same behavior with nil or blank namespace" do - etl = described_class.new(init_args) - expect(etl.kubeapi("")).to equal(etl.kubeapi(nil)) + allow(Kubetruth::KubeApi).to receive(:new) + expect(etl.kubeapi).to equal(etl.kubeapi) end end @@ -177,219 +149,94 @@ class ForceExit < Exception; end end - describe "#get_params" do - - let(:project) { "foo" } - let(:project_spec) { etl.load_config.spec_for_project(project) } - - it "handles empty" do - expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: "foo").and_return([]) - params = etl.get_params(project, project_spec) - expect(params).to eq([]) - end - - it "only selects for matching key_filter" do - project_spec.key_filter = "svc" - expect(@ctapi).to receive(:parameters).with(searchTerm: "svc", project: "foo").and_return([]) - params = etl.get_params(project, project_spec) - end - - it "only selects for matching selector" do - project_spec.key_selector = /foo$/ - expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: "foo").and_return([ - Parameter.new(key: "svc.param1", value: "value1", secret: false), - Parameter.new(key: "svc.param2.foo", value: "value2", secret: false), - ]) - params = etl.get_params(project, project_spec) - expect(params.size).to eq(1) - expect(params.collect(&:original_key)).to eq(["svc.param2.foo"]) - end - - it "applies templates to matches" do - expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: "foo").and_return([ - Parameter.new(key: "foo.key1", value: "value1", secret: false), - Parameter.new(key: "bar.key2", value: "value2", secret: false) - ]) - project_spec.key_selector = /^(?.*)\.(?.*)$/ - project_spec.key_template = Kubetruth::Template.new("{{key}}_{{prefix}}_{{project}}") - params = etl.get_params(project, project_spec, template_matches: {project: "myproj"}) - expect(params.size).to eq(2) - expect(params).to eq([ - Parameter.new(original_key: "foo.key1", key: "key1_foo_myproj", value: "value1", secret: false), - Parameter.new(original_key: "bar.key2", key: "key2_bar_myproj", value: "value2", secret: false) - ]) - end - - it "sets key in template if not in selector" do - expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: "foo").and_return([ - Parameter.new(key: "key1", value: "value1", secret: false), - ]) - project_spec.key_selector = // - project_spec.key_template = Kubetruth::Template.new("my_{{key}}") - params = etl.get_params(project, project_spec) - expect(params).to eq([ - Parameter.new(original_key: "key1", key: "my_key1", value: "value1", secret: false), - ]) - end - - it "doesn't expose secret in debug log" do - Logging.setup_logging(level: :debug, color: false) - - expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: "foo").and_return([ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "sekret", secret: true), - Parameter.new(key: "param3", value: "alsosekret", secret: true), - Parameter.new(key: "param4", value: "value4", secret: false), - ]) - params = etl.get_params(project, project_spec) - expect(Logging.contents).to include("param2") - expect(Logging.contents).to include("param3") - expect(Logging.contents).to include("") - expect(Logging.contents).to_not include("sekret") - end - - end - - describe "#apply_config_map" do - - it "calls kube to create new config map" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - expect(@kubeapi).to receive(:get_config_map).with("group1").and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) - expect(@kubeapi).to_not receive(:update_config_map) - expect(@kubeapi).to receive(:create_config_map).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_config_map(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "calls kube to update config map" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - resource = Kubeclient::Resource.new - resource.data = {oldparam: "oldvalue"} - expect(@kubeapi).to receive(:get_config_map).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(true) - expect(@kubeapi).to_not receive(:create_config_map) - expect(@kubeapi).to receive(:update_config_map).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_config_map(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "doesn't update config map if data same" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - resource = Kubeclient::Resource.new - resource.data = {param1: "value1", param2: "value2"} - expect(@kubeapi).to receive(:get_config_map).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(true) - expect(@kubeapi).to_not receive(:create_config_map) - expect(@kubeapi).to_not receive(:update_config_map) - etl.apply_config_map(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "doesn't update config map if not under management" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - resource = Kubeclient::Resource.new - resource.data = {oldparam: "oldvalue"} - expect(@kubeapi).to receive(:get_config_map).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(false) - expect(@kubeapi).to_not receive(:create_config_map) - expect(@kubeapi).to_not receive(:update_config_map) - etl.apply_config_map(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - expect(Logging.contents).to match(/Skipping config map 'group1'/) + describe "#kube_apply" do + + it "calls kube to create new resource" do + resource_yml = <<~EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "group1" + data: + "param1": "value1" + EOF + expect(@kubeapi).to receive(:ensure_namespace).with(@kubeapi.namespace) + expect(@kubeapi).to receive(:get_resource).with("configmaps", "group1", @kubeapi.namespace).and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) + expect(@kubeapi).to_not receive(:under_management?) + expect(@kubeapi).to receive(:apply_resource).with(YAML.load(resource_yml)) + etl.kube_apply(resource_yml) + expect(Logging.contents).to match(/Creating kubernetes resource/) + end + + it "calls to kube to update existing resource" do + resource_yml = <<~EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "group1" + data: + "param1": "value1" + EOF + resource_hash = YAML.load(resource_yml) + resource = Kubeclient::Resource.new(resource_hash.merge(data: {param1: "oldvalue"})) + expect(@kubeapi).to receive(:get_resource).with("configmaps", "group1", @kubeapi.namespace).and_return(resource) + expect(@kubeapi).to receive(:under_management?).and_return(true) + expect(@kubeapi).to receive(:apply_resource).with(resource_hash) + etl.kube_apply(resource_yml) + expect(Logging.contents).to match(/Updating kubernetes resource/) + end + + it "skips call to kube for existing resource not under management" do + resource_yml = <<~EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "group1" + data: + "param1": "value1" + EOF + resource = Kubeclient::Resource.new(YAML.load(resource_yml)) + expect(@kubeapi).to receive(:get_resource).with("configmaps", "group1", @kubeapi.namespace).and_return(resource) + expect(@kubeapi).to receive(:under_management?).and_return(false) + expect(@kubeapi).to_not receive(:apply_resource) + etl.kube_apply(resource_yml) + expect(Logging.contents).to match(/Skipping.*kubetruth management/) + end + + it "doesn't update resource if data same" do + resource_yml = <<~EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "group1" + data: + "param1": "value1" + EOF + resource_hash = YAML.load(resource_yml) + resource = Kubeclient::Resource.new(resource_hash) + expect(@kubeapi).to receive(:get_resource).with("configmaps", "group1", @kubeapi.namespace).and_return(resource) + expect(@kubeapi).to receive(:under_management?).and_return(true) + expect(@kubeapi).to_not receive(:apply_resource).with(resource_hash) + etl.kube_apply(resource_yml) + expect(Logging.contents).to match(/Skipping update for identical kubernetes resource/) end it "uses namespace for kube when supplied" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - foo_kapi = kubeapi("foo") - expect(etl).to receive(:kubeapi).with("foo").at_least(:once).and_return(foo_kapi) - expect(foo_kapi).to receive(:get_config_map).with("group1").and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) - expect(foo_kapi).to_not receive(:update_config_map) - expect(foo_kapi).to receive(:create_config_map).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_config_map(namespace: 'foo', name: "group1", param_hash: etl.params_to_hash(params)) - end - - end - - describe "#apply_secret" do - - it "calls kube to create new secret" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: true), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - expect(@kubeapi).to receive(:get_secret).with("group1").and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) - expect(@kubeapi).to_not receive(:update_secret) - expect(@kubeapi).to receive(:create_secret).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_secret(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "calls kube to update secret" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: true), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - resource = Kubeclient::Resource.new - resource.stringData = {oldparam: "oldvalue"} - expect(@kubeapi).to receive(:get_secret).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(true) - expect(@kubeapi).to receive(:secret_hash).with(resource).and_return({oldparam: "oldvalue"}) - expect(@kubeapi).to_not receive(:create_secret) - expect(@kubeapi).to receive(:update_secret).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_secret(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "doesn't update secret if data same" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: true), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - resource = Kubeclient::Resource.new - resource.stringData = {param1: "value1", param2: "value2"} - expect(@kubeapi).to receive(:get_secret).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(true) - expect(@kubeapi).to receive(:secret_hash).with(resource).and_return({param1: "value1", param2: "value2"}) - expect(@kubeapi).to_not receive(:create_secret) - expect(@kubeapi).to_not receive(:update_secret) - etl.apply_secret(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - end - - it "doesn't update secret if not under management=" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: true), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - resource = Kubeclient::Resource.new - resource.stringData = {oldparam: "oldvalue"} - expect(@kubeapi).to receive(:get_secret).with("group1").and_return(resource) - expect(@kubeapi).to receive(:under_management?).with(resource).and_return(false) - expect(@kubeapi).to receive(:secret_hash).with(resource).and_return({oldparam: "oldvalue"}) - expect(@kubeapi).to_not receive(:create_secret) - expect(@kubeapi).to_not receive(:update_secret) - etl.apply_secret(namespace: '', name: "group1", param_hash: etl.params_to_hash(params)) - expect(Logging.contents).to match(/Skipping secret 'group1'/) - end - - it "uses namespace for kube when supplied" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: true), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - foo_kapi = kubeapi("foo") - expect(foo_kapi).to receive(:get_secret).with("group1").and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) - expect(foo_kapi).to_not receive(:update_secret) - expect(foo_kapi).to receive(:create_secret).with("group1", {"param1" => "value1", "param2" => "value2"}) - etl.apply_secret(namespace: 'foo', name: "group1", param_hash: etl.params_to_hash(params)) + resource_yml = <<~EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "group1" + namespace: "ns1" + data: + "param1": "value1" + EOF + expect(@kubeapi).to receive(:ensure_namespace).with("ns1") + expect(@kubeapi).to receive(:get_resource).with("configmaps", "group1", "ns1").and_raise(Kubeclient::ResourceNotFoundError.new(1, "", 2)) + expect(@kubeapi).to_not receive(:under_management?) + expect(@kubeapi).to receive(:apply_resource).with(YAML.load(resource_yml)) + etl.kube_apply(resource_yml) + expect(Logging.contents).to match(/Creating kubernetes resource/) end end @@ -397,226 +244,144 @@ class ForceExit < Exception; end describe "#apply" do before(:each) do - allow(etl).to receive(:load_config).and_return(Kubetruth::Config.new([])) + default_root_spec = YAML.load_file(File.expand_path("../../helm/kubetruth/values.yaml", __dir__)).deep_symbolize_keys + @root_spec_crd = default_root_spec[:projectMappings][:root] + allow(etl).to receive(:load_config).and_return(Kubetruth::Config.new([@root_spec_crd])) + allow(Project).to receive(:create).and_wrap_original do |m, *args| + project = m.call(*args) + allow(project).to receive(:parameters).and_return([ + Parameter.new(key: "param1", value: "value1", secret: false), + Parameter.new(key: "param2", value: "value2", secret: true) + ]) + project + end end it "sets config and secrets" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - expect(etl.ctapi).to receive(:project_names).and_return(["default"]) - expect(etl).to receive(:get_params).and_return(params) - expect(etl).to receive(:apply_config_map).with(namespace: '', name: "default", param_hash: hash_including(etl.params_to_hash([params[0]]))) - expect(etl).to receive(:apply_secret).with(namespace: '', name: "default", param_hash: hash_including(etl.params_to_hash([params[1]]))) + expect(Project).to receive(:names).and_return(["proj1"]) + + allow(etl).to receive(:kube_apply) do |yml| + if yml.include?("kind: ConfigMap") + expect(yml).to match(/"param1": "value1"/) + expect(yml).to_not match(/"param2": "value2"/) + elsif yml.include?("kind: Secret") + expect(yml).to_not match(/"param1": "value1"/) + expect(yml).to match(/"param2": "#{Base64.strict_encode64('value2')}"/) + else + raise "Unexpected kubernetes resource kind" + end + end + etl.apply() end it "skips secrets" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: true) - ] + expect(Project).to receive(:names).and_return(["proj1"]) etl.load_config.root_spec.skip_secrets = true - expect(etl.ctapi).to receive(:project_names).and_return(["default"]) - expect(etl).to receive(:get_params).and_return(params) - expect(etl).to receive(:apply_config_map).with(namespace: '', name: "default", param_hash: hash_including(etl.params_to_hash([params[0]]))) - expect(etl).to_not receive(:apply_secret) + + allow(etl).to receive(:kube_apply) do |yml| + if yml.include?("kind: ConfigMap") + expect(yml).to match(/"param1": "value1"/) + expect(yml).to_not match(/"param2": "value2"/) + elsif yml.include?("kind: Secret") + raise "Secret should not be present" + else + raise "Unexpected kubernetes resource kind" + end + end + etl.apply() end it "allows dryrun" do - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - etl = described_class.new(init_args.merge(dry_run: true)) - expect(etl.ctapi).to receive(:project_names).and_return(["default"]) - expect(etl).to receive(:get_params).and_return(params) + etl.instance_variable_set(:@dry_run, true) + expect(Project).to receive(:names).and_return(["proj1"]) + expect(@kubeapi).to_not receive(:ensure_namespace) - expect(@kubeapi).to_not receive(:create_config_map) - expect(@kubeapi).to_not receive(:update_config_map) - expect(@kubeapi).to_not receive(:create_secret) - expect(@kubeapi).to_not receive(:update_secret) - etl.apply + expect(@kubeapi).to_not receive(:apply_resource) + + etl.apply() expect(Logging.contents).to match("Performing dry-run") end it "skips projects when selector fails" do etl.load_config.root_spec.project_selector = /oo/ - expect(etl.ctapi).to receive(:project_names).and_return(["default", "foo", "bar"]) - expect(etl).to_not receive(:get_params).with("default", any_args) - expect(etl).to receive(:get_params).with("foo", any_args).and_return([]) - expect(etl).to_not receive(:get_params).with("bar", any_args) - expect(etl).to receive(:apply_config_map) - expect(etl).to receive(:apply_secret) + expect(Project).to receive(:names).and_return(["proj1", "foo", "bar"]) + + allow(etl).to receive(:kube_apply) do |yml| + expect(yml).to match(/name: "foo"/) + end + etl.apply() end it "skips projects if flag is set" do - expect(etl).to receive(:load_config).and_return(Kubetruth::Config.new([ - {scope: "override", project_selector: "foo", skip: true} - ])) - - expect(etl.ctapi).to receive(:project_names).and_return(["default", "foo", "bar"]) - allow(etl).to receive(:get_params).and_return([]) - expect(etl).to receive(:apply_config_map).with(hash_including(name: "default")) - expect(etl).to_not receive(:apply_config_map).with(hash_including(name: "foo")) - expect(etl).to receive(:apply_config_map).with(hash_including(name: "bar")) - allow(etl).to receive(:apply_secret) - etl.apply() - end + allow(etl).to receive(:load_config). + and_return(Kubetruth::Config.new([@root_spec_crd, {scope: "override", project_selector: "foo", skip: true}])) + expect(Project).to receive(:names).and_return(["proj1", "foo", "bar"]) - it "gets captures for template from both levels of project selectors" do - expect(etl).to receive(:load_config).and_return(Kubetruth::Config.new([ - { - scope: "root", - namespace_template: "{{child_match}}-{{root_match}}", - project_selector: "^(?[^.]+)", - key_template: "{{root_match}}:{{child_match}}:{{project}}:{{key}}" - }, - {scope: "override", project_selector: "(?[^.]+)$"} - ])) - - params = [ - Parameter.new(key: "param1", value: "value1", secret: false) - ] - expect(etl.ctapi).to receive(:project_names).and_return(["foo.bar"]) - expect(etl.ctapi).to receive(:parameters).and_return(params) - expect(etl).to receive(:apply_config_map). - with(namespace: 'bar-foo', - name: "foo.bar", - param_hash: hash_including(etl.params_to_hash([Parameter.new(key: "foo:bar:foo.bar:param1", original_key: "param1", value: "value1", secret: false),]))) - expect(etl).to receive(:apply_secret) - etl.apply - end + allow(etl).to receive(:kube_apply) do |yml| + expect(yml).to match(/name: "((proj1)|(bar))"/) + end - it "includes projects" do - base_params = [ - Parameter.new(key: "param0", value: "value0", secret: false), - Parameter.new(key: "param2", value: "basevalue2", secret: false) - ] - foo_params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false) - ] - - expect(etl).to receive(:load_config).and_return(Kubetruth::Config.new([ - { - scope: "root", - included_projects: ["base"] - }, - {scope: "override", project_selector: "^base$", skip: true} - ])) - - expect(etl.ctapi).to receive(:project_names).and_return(["base", "foo"]) - expect(etl).to receive(:get_params).with("base", any_args).and_return(base_params) - expect(etl).to receive(:get_params).with("foo", any_args).and_return(foo_params) - expect(etl).to receive(:apply_config_map).with(namespace: '', name: "foo", param_hash: hash_including({ - "param0" => "value0", - "param1" => "value1", - "param2" => "value2" - })) - allow(etl).to receive(:apply_secret) etl.apply() end - it "skips project include of self" do - base_params = [ - Parameter.new(key: "param0", value: "value0", secret: false), - ] - - expect(etl).to receive(:load_config).and_return(Kubetruth::Config.new([ - { - scope: "root", - included_projects: ["base"] - } - ])) - - expect(etl.ctapi).to receive(:project_names).and_return(["base"]) - expect(etl).to receive(:get_params).with("base", any_args).and_return(base_params) - expect(etl).to receive(:apply_config_map) - allow(etl).to receive(:apply_secret) + it "allows included projects not selected by selector" do + etl.load_config.root_spec.project_selector = /proj1/ + etl.load_config.root_spec.included_projects = ["proj2"] + expect(Project).to receive(:names).and_return(["proj1", "proj2", "proj3"]) + + allow(etl).to receive(:kube_apply) + expect(etl.load_config.root_spec.configmap_template).to receive(:render) do |*args, **kwargs| + expect(kwargs[:project]).to eq("proj1") + expect(kwargs[:project_heirarchy]).to eq({"proj1"=>{"proj2"=>{}}}) + expect(kwargs[:parameter_origins]).to eq({"param1"=>"proj1 (proj2)"}) + end + etl.apply() - expect(Logging.contents).to include("Skipping project's import of itself") end - it "indicates param's project origin in metadata" do - base_params = [ - Parameter.new(key: "param0", value: "value0", secret: false), - Parameter.new(key: "param2", value: "basevalue2", secret: false), - Parameter.new(key: "param3", value: "basevalue3", secret: false), - Parameter.new(key: "sparam0", value: "svalue0", secret: true), - Parameter.new(key: "sparam2", value: "sbasevalue2", secret: true), - Parameter.new(key: "sparam3", value: "sbasevalue3", secret: true) - ] - bar_params = [ - Parameter.new(key: "param3", value: "barvalue3", secret: false), - Parameter.new(key: "sparam3", value: "sbarvalue3", secret: true), - ] - foo_params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: false), - Parameter.new(key: "param3", value: "value3", secret: false), - Parameter.new(key: "sparam1", value: "svalue1", secret: true), - Parameter.new(key: "sparam2", value: "svalue2", secret: true), - Parameter.new(key: "sparam3", value: "svalue3", secret: true) - ] - - expect(etl).to receive(:load_config).and_return(Kubetruth::Config.new([ - { - scope: "root", - included_projects: ["base", "bar"] - }, - {scope: "override", project_selector: "^ba.*$", skip: true} - ])) - - expect(etl.ctapi).to receive(:project_names).and_return(["base", "bar", "foo"]) - expect(etl).to receive(:get_params).with("base", any_args).and_return(base_params) - expect(etl).to receive(:get_params).with("bar", any_args).and_return(bar_params) - expect(etl).to receive(:get_params).with("foo", any_args).and_return(foo_params) - expect(etl).to receive(:apply_config_map) do |*args, **kwargs| - expect(YAML.load(kwargs[:param_hash][:cloudtruth_metadata])).to eq({ - "project_heirarchy" => "foo -> bar -> base", - "parameter_origins" => { - "param0" => "base", - "param1" => "foo", - "param2" => "foo (base)", - "param3" => "foo (bar -> base)" - } - }) - end - expect(etl).to receive(:apply_secret) do |*args, **kwargs| - expect(YAML.load(kwargs[:param_hash][:cloudtruth_metadata])).to eq({ - "project_heirarchy" => "foo -> bar -> base", - "parameter_origins" => { - "sparam0" => "base", - "sparam1" => "foo", - "sparam2" => "foo (base)", - "sparam3" => "foo (bar -> base)" - } - }) + it "allows projects not selected by root selector" do + allow(etl).to receive(:load_config). + and_return(Kubetruth::Config.new([ + @root_spec_crd, + {scope: "override", project_selector: "proj2"} + ] + )) + etl.load_config.root_spec.project_selector = /proj1/ + expect(Project).to receive(:names).and_return(["proj2"]) + + allow(etl).to receive(:kube_apply) do |yml| + expect(yml).to match(/name: "proj2"/) end + etl.apply() end - it "can turn off metadata" do - etl = described_class.new(init_args.merge(metadata: false)) - params = [ - Parameter.new(key: "param1", value: "value1", secret: false), - Parameter.new(key: "param2", value: "value2", secret: true) - ] - expect(etl.ctapi).to receive(:project_names).and_return(["default"]) - expect(etl).to receive(:get_params).and_return(params) - expect(etl).to receive(:apply_config_map) do |*args, **kwargs| - expect(kwargs[:param_hash]).to_not include(:cloudtruth_metadata) + + it "renders templates with context" do + expect(Project).to receive(:names).and_return(["proj1"]) + + allow(etl).to receive(:kube_apply) + expect(etl.load_config.root_spec.configmap_template).to receive(:render) do |*args, **kwargs| + expect(kwargs[:project]).to eq("proj1") + expect(kwargs[:debug]).to eq(etl.logger.debug?) + expect(kwargs[:parameters]).to eq({"param1"=>"value1"}) + expect(kwargs[:project_heirarchy]).to eq(Project.all["proj1"].heirarchy) + expect(kwargs[:parameter_origins]).to eq({"param1"=>"proj1"}) end - expect(etl).to receive(:apply_secret) do |*args, **kwargs| - expect(kwargs[:param_hash]).to_not include(:cloudtruth_metadata) + + expect(etl.load_config.root_spec.secret_template).to receive(:render) do |*args, **kwargs| + expect(kwargs[:project]).to eq("proj1") + expect(kwargs[:debug]).to eq(etl.logger.debug?) + expect(kwargs[:parameters]).to eq({"param2"=>"value2"}) + expect(kwargs[:project_heirarchy]).to eq(Project.all["proj1"].heirarchy) + expect(kwargs[:parameter_origins]).to eq({"param2"=>"proj1"}) end + etl.apply() end - end end diff --git a/spec/kubetruth/kubeapi_spec.rb b/spec/kubetruth/kubeapi_spec.rb index 9184619..2ec0cc4 100644 --- a/spec/kubetruth/kubeapi_spec.rb +++ b/spec/kubetruth/kubeapi_spec.rb @@ -82,6 +82,12 @@ def apiserver; "https://127.0.0.1"; end let(:kubeapi) { described_class.new(namespace: namespace, token: token, api_url: apiserver) } + before(:each) do |ex| + # gives us a unique name that is consistent across runs of the same spec + # so VCR fixture stays valid + @spec_name = "#{self.class.name}#{ex.description}".downcase.gsub(/[^\w]+/, "-") + end + describe "initialize" do it "uses supplied namespace" do @@ -94,17 +100,19 @@ def apiserver; "https://127.0.0.1"; end it "creates namespace if not present" do kapi = described_class.new(namespace: "#{namespace}-newns", token: token, api_url: apiserver) - expect { kapi.create_config_map("foo", {}) }.to raise_error(Kubeclient::ResourceNotFoundError, /namespaces.*not found/) - ns = kapi.ensure_namespace - kapi.create_config_map("foo", {bar: "baz"}) - expect(kapi.get_config_map("foo").data["bar"]).to eq("baz") + + expect { kapi.client.get_namespace(kapi.namespace) }.to raise_error(Kubeclient::ResourceNotFoundError, /namespaces.*not found/) + kapi.ensure_namespace + ns = kapi.client.get_namespace(kapi.namespace) + expect(ns.kind).to eq("Namespace") + expect(ns.metadata.name).to eq(kapi.namespace) end it "sets labels when creating namespace" do kapi = described_class.new(namespace: "#{namespace}-newns2", token: token, api_url: apiserver) - expect { kapi.create_config_map("foo", {}) }.to raise_error(Kubeclient::ResourceNotFoundError, /namespaces.*not found/) + expect { kapi.client.get_namespace(kapi.namespace) }.to raise_error(Kubeclient::ResourceNotFoundError, /namespaces.*not found/) ns = kapi.ensure_namespace - expect(ns.metadata.labels.to_h).to eq({:"app.kubernetes.io/managed-by" => "kubetruth"}) + expect(ns.metadata.labels.to_h).to match(hash_including(KubeApi::MANAGED_LABEL_KEY.to_sym => KubeApi::MANAGED_LABEL_VALUE)) end end @@ -132,144 +140,112 @@ def apiserver; "https://127.0.0.1"; end end - describe "secret_hash" do + describe "set_managed" do - it "handles empty data" do + it "handles empty labels" do resource = Kubeclient::Resource.new - expect(kubeapi.secret_hash(resource)).to eq({}) + kubeapi.set_managed(resource) + expect(resource.metadata.labels.to_h).to eq(KubeApi::MANAGED_LABEL_KEY.to_sym => KubeApi::MANAGED_LABEL_VALUE) end - it "decodes secret data" do + it "handles missing labels" do resource = Kubeclient::Resource.new - resource.data = {foo: Base64.encode64("bar")} - expect(kubeapi.secret_hash(resource)).to eq({foo: "bar"}) + resource.metadata = {} + resource.metadata.labels = {foo: "bar"} + kubeapi.set_managed(resource) + expect(resource.metadata.labels.to_h).to eq(foo: "bar", KubeApi::MANAGED_LABEL_KEY.to_sym => KubeApi::MANAGED_LABEL_VALUE) + end + + it "handles correct labels" do + resource = Kubeclient::Resource.new + resource.metadata = {} + resource.metadata.labels = {KubeApi::MANAGED_LABEL_KEY => KubeApi::MANAGED_LABEL_VALUE} + kubeapi.set_managed(resource) + expect(resource.metadata.labels.to_h).to eq({KubeApi::MANAGED_LABEL_KEY.to_sym => KubeApi::MANAGED_LABEL_VALUE}) end end - describe "configmaps" do - - it "can crud config maps" do - expect { kubeapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - cm = kubeapi.create_config_map("foo", {bar: "baz"}) - expect(kubeapi.get_config_map_names).to include("foo") - expect(kubeapi.get_config_map("foo").data["bar"]).to eq("baz") - kubeapi.update_config_map("foo", {bar: "bum"}) - expect(kubeapi.get_config_map("foo").data["bar"]).to eq("bum") - kubeapi.delete_config_map("foo") - expect { kubeapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - end + describe "get_resource" do - it "can use multiple namespaces for config maps" do - ns1_kapi = described_class.new(namespace: "#{namespace}-cmns1", token: token, api_url: apiserver) - ns1_kapi.ensure_namespace - ns2_kapi = described_class.new(namespace: "#{namespace}-cmns2", token: token, api_url: apiserver) - ns2_kapi.ensure_namespace - - expect { ns1_kapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - cm = ns1_kapi.create_config_map("foo", {bar: "baz"}) - expect(ns1_kapi.get_config_map_names).to include("foo") - expect(ns1_kapi.get_config_map("foo").data["bar"]).to eq("baz") - ns1_kapi.update_config_map("foo", {bar: "bum"}) - expect(ns1_kapi.get_config_map("foo").data["bar"]).to eq("bum") - ns1_kapi.delete_config_map("foo") - expect { ns1_kapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - - expect { ns2_kapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - cm = ns2_kapi.create_config_map("foo", {bar: "baz"}) - expect(ns2_kapi.get_config_map_names).to include("foo") - expect(ns2_kapi.get_config_map("foo").data["bar"]).to eq("baz") - ns2_kapi.update_config_map("foo", {bar: "bum"}) - expect(ns2_kapi.get_config_map("foo").data["bar"]).to eq("bum") - ns2_kapi.delete_config_map("foo") - expect { ns2_kapi.get_config_map("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) + it "raise when resource doesn't exist" do + expect { kubeapi.get_resource("configmaps", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) end - it "sets labels when creating config maps" do - expect { kubeapi.get_config_map("bar") }.to raise_error(Kubeclient::ResourceNotFoundError) - cm = kubeapi.create_config_map("bar", {bar: "baz"}) - expect(kubeapi.get_config_map_names).to include("bar") - expect(cm.metadata.labels.to_h).to eq({:"app.kubernetes.io/managed-by" => "kubetruth"}) - end + it "gets existing resource" do + expect { kubeapi.get_resource("configmaps", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) - it "sets labels when updating config maps" do - expect { kubeapi.get_config_map("baz") }.to raise_error(Kubeclient::ResourceNotFoundError) - cm = kubeapi.create_config_map("baz", {bar: "baz"}) - cm.metadata.labels = {"otherlabel" => "set"} - kubeapi.client.update_config_map(cm) + resource = Kubeclient::Resource.new(metadata: {name: @spec_name, namespace: kubeapi.namespace}, data: {bar: "baz"}) + kubeapi.client.create_config_map(resource) - cm = kubeapi.update_config_map("baz", {bum: "boo"}) - expect(cm.metadata.labels.to_h).to eq({:"app.kubernetes.io/managed-by" => "kubetruth", :"otherlabel" => "set"}) + fetched_resource = kubeapi.get_resource("configmaps", @spec_name) + expect(fetched_resource.metadata.name).to eq(@spec_name) end end - describe "secrets" do - - it "can crud secrets" do - expect { kubeapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - secret = kubeapi.create_secret("foo", {bar: "baz"}) - expect(kubeapi.get_secret_names).to include("foo") - resource = kubeapi.get_secret("foo") - data = kubeapi.secret_hash(resource) - expect(data).to eq({bar: "baz"}) - kubeapi.update_secret("foo", {bar: "bum"}) - resource = kubeapi.get_secret("foo") - data = kubeapi.secret_hash(resource) - expect(data).to eq({bar: "bum"}) - kubeapi.delete_secret("foo") - expect { kubeapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) + describe "apply_resource" do + + it "creates a resource using client namespace" do + expect { kubeapi.get_resource("configmaps", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) + + resource = Kubeclient::Resource.new(apiVersion: "v1", kind: "ConfigMap", metadata: {name: @spec_name}, data: {bar: "baz"}) + kubeapi.apply_resource(resource) + + fetched_resource = kubeapi.get_resource("configmaps", @spec_name) + expect(fetched_resource.metadata.namespace).to eq(kubeapi.namespace) + expect(fetched_resource.metadata.name).to eq(@spec_name) + expect(fetched_resource.data.to_h).to eq({bar: "baz"}) + end + + it "creates a resource with supplied namespace" do + kapi = described_class.new(namespace: "#{namespace}-arns", token: token, api_url: apiserver) + kapi.ensure_namespace + ns = kapi.namespace + + expect { kubeapi.get_resource("configmaps", @spec_name, ns) }.to raise_error(Kubeclient::ResourceNotFoundError) + + resource = Kubeclient::Resource.new(apiVersion: "v1", kind: "ConfigMap", metadata: {namespace: ns, name: @spec_name}, data: {bar: "baz"}) + kubeapi.apply_resource(resource) + + fetched_resource = kubeapi.get_resource("configmaps", @spec_name, ns) + expect(fetched_resource.metadata.namespace).to eq(ns) + expect(fetched_resource.metadata.name).to eq(@spec_name) end - it "can use multiple namespaces for secrets" do - ns1_kapi = described_class.new(namespace: "#{namespace}-secretns1", token: token, api_url: apiserver) - ns1_kapi.ensure_namespace - ns1_kapi.ensure_namespace - ns2_kapi = described_class.new(namespace: "#{namespace}-secretns2", token: token, api_url: apiserver) - ns2_kapi.ensure_namespace - - expect { ns1_kapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - secret = ns1_kapi.create_secret("foo", {bar: "baz"}) - expect(ns1_kapi.get_secret_names).to include("foo") - resource = ns1_kapi.get_secret("foo") - data = ns1_kapi.secret_hash(resource) - expect(data).to eq({bar: "baz"}) - ns1_kapi.update_secret("foo", {bar: "bum"}) - resource = ns1_kapi.get_secret("foo") - data = ns1_kapi.secret_hash(resource) - expect(data).to eq({bar: "bum"}) - ns1_kapi.delete_secret("foo") - expect { ns1_kapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - - expect { ns2_kapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) - secret = ns2_kapi.create_secret("foo", {bar: "baz"}) - expect(ns2_kapi.get_secret_names).to include("foo") - resource = ns2_kapi.get_secret("foo") - data = ns2_kapi.secret_hash(resource) - expect(data).to eq({bar: "baz"}) - ns2_kapi.update_secret("foo", {bar: "bum"}) - resource = ns2_kapi.get_secret("foo") - data = ns2_kapi.secret_hash(resource) - expect(data).to eq({bar: "bum"}) - ns2_kapi.delete_secret("foo") - expect { ns2_kapi.get_secret("foo") }.to raise_error(Kubeclient::ResourceNotFoundError) + it "creates a resource from hash" do + expect { kubeapi.get_resource("configmaps", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) + + resource = { apiVersion: "v1", kind: "ConfigMap", metadata: { name: @spec_name }, data: { bar: "baz" } } + kubeapi.apply_resource(resource) + + fetched_resource = kubeapi.get_resource("configmaps", @spec_name) + expect(fetched_resource.metadata.namespace).to eq(kubeapi.namespace) + expect(fetched_resource.metadata.name).to eq(@spec_name) + expect(fetched_resource.data.to_h).to eq({bar: "baz"}) end - it "sets labels when creating secrets" do - expect { kubeapi.get_secret("bar") }.to raise_error(Kubeclient::ResourceNotFoundError) - secret = kubeapi.create_secret("bar", {bar: "baz"}) - expect(kubeapi.get_secret_names).to include("bar") - expect(secret.metadata.labels.to_h).to eq({:"app.kubernetes.io/managed-by" => "kubetruth"}) + it "sets up management when creating a resource" do + expect { kubeapi.get_resource("configmaps", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) + + resource = Kubeclient::Resource.new(apiVersion: "v1", kind: "ConfigMap", metadata: {name: @spec_name}, data: {bar: "baz"}) + kubeapi.apply_resource(resource) + + fetched_resource = kubeapi.get_resource("configmaps", @spec_name) + expect(fetched_resource.metadata.name).to eq(@spec_name) + expect(fetched_resource.metadata.labels.to_h).to match(hash_including(KubeApi::MANAGED_LABEL_KEY.to_sym => KubeApi::MANAGED_LABEL_VALUE)) end - it "sets labels when updating secrets" do - expect { kubeapi.get_secret("baz") }.to raise_error(Kubeclient::ResourceNotFoundError) - secret = kubeapi.create_secret("baz", {bar: "baz"}) - secret.metadata.labels = {"otherlabel" => "set"} - kubeapi.client.update_secret(secret) + it "creates other types of resources" do + expect { kubeapi.get_resource("secrets", @spec_name) }.to raise_error(Kubeclient::ResourceNotFoundError) + + resource = Kubeclient::Resource.new(apiVersion: "v1", kind: "Secret", metadata: {name: @spec_name}, data: {bar: Base64.strict_encode64("baz")}) + kubeapi.apply_resource(resource) - secret = kubeapi.update_secret("baz", {bum: "boo"}) - expect(secret.metadata.labels.to_h).to eq({:"app.kubernetes.io/managed-by" => "kubetruth", :"otherlabel" => "set"}) + fetched_resource = kubeapi.get_resource("secrets", @spec_name) + expect(fetched_resource.kind).to eq("Secret") + expect(fetched_resource.metadata.namespace).to eq(kubeapi.namespace) + expect(fetched_resource.metadata.name).to eq(@spec_name) end end diff --git a/spec/kubetruth/logging_spec.rb b/spec/kubetruth/logging_spec.rb index 4f9a023..4e8f9a1 100644 --- a/spec/kubetruth/logging_spec.rb +++ b/spec/kubetruth/logging_spec.rb @@ -27,13 +27,13 @@ module Kubetruth it "logs with color" do described_class.setup_logging(level: :info, color: true) logger.info("howdy") - a = ::Logging.logger.root.appenders.find {|a| a.try(:layout).try(:color_scheme) } + a = ::Logging.logger.root.appenders.find {|a| a&.layout&.color_scheme } expect(a).to_not be_nil end it "outputs plain text" do described_class.setup_logging(level: :info, color: false) - a = ::Logging.logger.root.appenders.find {|a| a.try(:layout).try(:color_scheme) } + a = ::Logging.logger.root.appenders.find {|a| a&.layout&.color_scheme } expect(a).to be_nil end diff --git a/spec/kubetruth/parameter_spec.rb b/spec/kubetruth/parameter_spec.rb new file mode 100644 index 0000000..cef8ebf --- /dev/null +++ b/spec/kubetruth/parameter_spec.rb @@ -0,0 +1,18 @@ +require 'rspec' +require 'kubetruth/parameter' + +module Kubetruth + describe Parameter do + + describe "#initialize" do + + it "creates from kwargs" do + data = {key: "key1", value: "value1", secret: true} + param = described_class.new(**data) + expect(param.to_h).to eq(data) + end + + end + + end +end diff --git a/spec/kubetruth/project_spec.rb b/spec/kubetruth/project_spec.rb new file mode 100644 index 0000000..214f0eb --- /dev/null +++ b/spec/kubetruth/project_spec.rb @@ -0,0 +1,275 @@ +require 'rspec' +require 'kubetruth/project' +require 'kubetruth/parameter' +require 'kubetruth/config' + +module Kubetruth + describe Project do + + before(:each) do + described_class.ctapi_context = {} + described_class.instance_variable_set(:@ctapi, nil) + @ctapi_class = Class.new + @ctapi = double() + allow(Kubetruth).to receive(:CtApi).and_return(@ctapi_class) + allow(@ctapi_class).to receive(:new).and_return(@ctapi) + described_class.reset + end + + describe "#initialize" do + + it "creates from kwargs" do + data = {name: "name1", spec: Kubetruth::Config::ProjectSpec.new} + proj = described_class.new(**data) + expect(proj.to_h).to eq(data) + end + + end + + describe "#ctapi" do + + it "is memoized" do + expect(described_class.ctapi).to equal(described_class.ctapi) + expect(described_class.new.ctapi).to equal(described_class.ctapi) + end + + end + + describe "#names" do + + it "gets project names from ctapi" do + expect(described_class.ctapi).to receive(:project_names).and_return(["proj1", "proj2"]) + expect(described_class.names).to eq(["proj1", "proj2"]) + end + + end + + describe "#all" do + + it "returns all projects created via create" do + projects = {} + projects["proj1"] = described_class.create(name: "proj1", spec: Kubetruth::Config::ProjectSpec.new) + projects["proj2"] = described_class.create(name: "proj2", spec: Kubetruth::Config::ProjectSpec.new) + expect(described_class.all).to eq(projects) + end + + end + + describe "#reset" do + + it "resets all projects created via create" do + projects = {} + projects["proj1"] = described_class.create(name: "proj1", spec: Kubetruth::Config::ProjectSpec.new) + projects["proj2"] = described_class.create(name: "proj2", spec: Kubetruth::Config::ProjectSpec.new) + expect(described_class.all).to eq(projects) + described_class.reset + expect(described_class.all).to eq({}) + end + + end + + describe "#create" do + + it "creates a project and adds to all" do + spec = Kubetruth::Config::ProjectSpec.new + proj = described_class.create(name: "proj1", spec: spec) + expect(proj).to be_an_instance_of(described_class) + expect(proj.name).to eq("proj1") + expect(proj.spec).to eq(spec) + expect(described_class.all).to eq({"proj1" => proj}) + end + + end + + describe "#parameters" do + + let(:project) { described_class.create(name: "proj1", spec: Kubetruth::Config::ProjectSpec.new(**Kubetruth::Config::DEFAULT_SPEC)) } + + it "handles empty" do + expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: project.name).and_return([]) + params = project.parameters + expect(params).to eq([]) + end + + it "uses simple key_selector as search parameter" do + project.spec.key_selector = /svc/ + expect(@ctapi).to receive(:parameters).with(searchTerm: "svc", project: project.name).and_return([ + Parameter.new(key: "svc.param1", value: "value1", secret: false), + Parameter.new(key: "svc.param2", value: "value2", secret: false), + ]) + params = project.parameters + expect(params.size).to eq(2) + expect(Logging.contents).to_not match(/Looking for key pattern matches/) + end + + it "uses complex key_selector client-side" do + project.spec.key_selector = /foo$/ + expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: project.name).and_return([ + Parameter.new(key: "svc.param1", value: "value1", secret: false), + Parameter.new(key: "svc.param2.foo", value: "value2", secret: false), + ]) + params = project.parameters + expect(params.size).to eq(1) + expect(params.collect(&:key)).to eq(["svc.param2.foo"]) + expect(Logging.contents).to match(/Looking for key pattern matches/) + end + + it "doesn't expose secret in debug log" do + Logging.setup_logging(level: :debug, color: false) + + expect(@ctapi).to receive(:parameters).with(searchTerm: "", project: project.name).and_return([ + Parameter.new(key: "param1", value: "value1", secret: false), + Parameter.new(key: "param2", value: "sekret", secret: true), + Parameter.new(key: "param3", value: "alsosekret", secret: true), + Parameter.new(key: "param4", value: "value4", secret: false), + ]) + params = project.parameters + expect(Logging.contents).to include("param2") + expect(Logging.contents).to include("param3") + expect(Logging.contents).to include("") + expect(Logging.contents).to_not include("sekret") + end + + end + + describe "tree traversal" do + + let(:config) { + Kubetruth::Config.new([ + Kubetruth::Config::DEFAULT_SPEC.merge(scope: "root"), + Kubetruth::Config::DEFAULT_SPEC.merge(project_selector: "proj1"), + Kubetruth::Config::DEFAULT_SPEC.merge(project_selector: "proj2"), + Kubetruth::Config::DEFAULT_SPEC.merge(project_selector: "proj3") + ]) + } + let(:proj1) { described_class.create(name: "proj1", spec: config.spec_for_project("proj1")) } + let(:proj2) { described_class.create(name: "proj2", spec: config.spec_for_project("proj2")) } + let(:proj3) { described_class.create(name: "proj3", spec: config.spec_for_project("proj3")) } + + before(:each) do + # make sure they are loaded in Project.all + all_projects = [proj1, proj2, proj3] + end + + describe "#included_projects" do + + it "gets single level of included projects" do + proj1.spec.included_projects = ["proj2", "proj3"] + projects = proj1.included_projects + expect(projects).to eq({proj2.name => {}, proj3.name => {}}) + expect(Logging.contents).to_not match(/Breaking circular dependency/) + expect(Logging.contents).to_not match(/Skipping unknown project/) + end + + it "gets multiple levels of included projects" do + proj1.spec.included_projects = ["proj2", "proj3"] + proj2.spec.included_projects = ["proj3"] + projects = proj1.included_projects + expect(projects).to eq({proj2.name => {proj3.name => {}}, proj3.name => {}}) + end + + it "breaks cycles to self" do + proj1.spec.included_projects = ["proj1"] + projects = proj1.included_projects + expect(projects).to eq({}) + expect(Logging.contents).to match(/Breaking circular dependency/) + end + + it "breaks nested cycles" do + proj1.spec.included_projects = ["proj2"] + proj2.spec.included_projects = ["proj3"] + proj3.spec.included_projects = ["proj1"] + projects = proj1.included_projects + expect(projects).to eq({proj2.name => {proj3.name => {}}}) + expect(Logging.contents).to match(/Breaking circular dependency/) + end + + it "skips unknown projects" do + proj1.spec.included_projects = ["proj4"] + projects = proj1.included_projects + expect(projects).to eq({}) + expect(Logging.contents).to match(/Skipping unknown project/) + end + + it "yields each project in a DFS fashion" do + proj1.spec.included_projects = ["proj2", "proj3"] + proj2.spec.included_projects = ["proj3"] + + expect { |b| proj1.included_projects(&b) }. + to yield_successive_args(proj3, proj2, proj3) + end + + end + + describe "#all_parameters" do + + it "gets parameters for included projects and self" do + proj1.spec.included_projects = ["proj2"] + proj2.spec.included_projects = ["proj3"] + + expect(proj1).to receive(:parameters).and_return([param1 = Parameter.new(key: "proj1key")]) + expect(proj2).to receive(:parameters).and_return([param2 = Parameter.new(key: "proj2key")]) + expect(proj3).to receive(:parameters).and_return([param3 = Parameter.new(key: "proj3key")]) + + params = proj1.all_parameters + expect(params).to eq([param3, param2, param1]) + end + + end + + describe "#parameter_origins" do + + it "enumerates parameter origins by project" do + proj1.spec.included_projects = ["proj2"] + proj2.spec.included_projects = ["proj3"] + + proj1_params = [ + Parameter.new(key: "param0", value: "proj1value0"), + Parameter.new(key: "param2", value: "proj1value2"), + Parameter.new(key: "param3", value: "proj1value3"), + ] + proj2_params = [ + Parameter.new(key: "param3", value: "proj2value3"), + Parameter.new(key: "param4", value: "proj2value4"), + ] + proj3_params = [ + Parameter.new(key: "param1", value: "proj3value1"), + Parameter.new(key: "param2", value: "proj3value2"), + Parameter.new(key: "param3", value: "proj3value3"), + ] + + expect(proj1).to receive(:parameters).and_return(proj1_params) + expect(proj2).to receive(:parameters).and_return(proj2_params) + expect(proj3).to receive(:parameters).and_return(proj3_params) + + + expect(proj1.parameter_origins).to eq({ + "param0" => "proj1", + "param1" => "proj3", + "param2" => "proj1 (proj3)", + "param3" => "proj1 (proj2 -> proj3)", + "param4" => "proj2" + }) + + end + + end + + describe "#heirarchy" do + + it "gets heirarchy of included projects including self" do + proj1.spec.included_projects = ["proj2", "proj3"] + expect(proj1.heirarchy).to eq({ + proj1.name => { + proj2.name => {}, + proj3.name => {} + } + }) + end + + end + + end + + end +end diff --git a/spec/kubetruth/template_spec.rb b/spec/kubetruth/template_spec.rb index 0e6885b..e10213b 100644 --- a/spec/kubetruth/template_spec.rb +++ b/spec/kubetruth/template_spec.rb @@ -4,6 +4,14 @@ module Kubetruth describe Template do + describe "#to_s" do + + it "shows the template source" do + expect(Template.new("foo").to_s).to eq("foo") + end + + end + describe "CustomLiquidFilters" do include Kubetruth::Template::CustomLiquidFilters @@ -66,6 +74,71 @@ module Kubetruth end + describe "#indent" do + + it "indents by count spaces for each line" do + expect(indent("foo\nbar", 3)).to eq(" foo\n bar") + end + + end + + describe "#nindent" do + + it "indents by count spaces for each line with a leading newline" do + expect(nindent("foo\nbar", 3)).to eq(" \n foo\n bar") + end + + end + + describe "#stringify" do + + it "produces a yaml string" do + expect(stringify("foo")).to eq('"foo"') + expect(stringify(%q(foo'"bar))).to eq(%q("foo'\"bar")) + end + + end + + describe "#to_yaml" do + + it "produces a yaml string" do + expect(to_yaml([1, 2])).to eq("---\n- 1\n- 2\n") + end + + end + + describe "#to_json" do + + it "produces a json string" do + expect(to_json({"foo" => "bar"})).to eq('{"foo":"bar"}') + end + + end + + describe "#sha256" do + + it "does a sha256 digest" do + expect(sha256("foo")).to eq(Digest::SHA256.hexdigest("foo")) + end + + end + + describe "#encode64" do + + it "does a base64 encode" do + expect(encode64("foo")).to eq(Base64.strict_encode64("foo")) + end + + end + + describe "#decode64" do + + it "does a base64 decode" do + expect(decode64(Base64.strict_encode64("foo"))).to eq("foo") + end + + end + end describe "regexp match" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9207151..92c6fc6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,6 @@ require "bundler/setup" ENV['CLOUDTRUTH_API_KEY'] ||= 'fake_api_key' require "kubetruth" -require "kubetruth/logging" -# Need to setup logging before loading any other files -Kubetruth::Logging.setup_logging(level: :info, color: false) require "open3"