k8s-ruby 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7bf6629e29b3cf02237f6452f03b8d276d34f8cae7cd21d2200268e2c600e1c
4
- data.tar.gz: 84ad817c8dbc5a7264312f4695399664174100a84a15612a36c21db537539783
3
+ metadata.gz: a91490b13f752ae7062cf986b6ed7e3e0eaced0c81f0ed8df1072b34a0fe0b68
4
+ data.tar.gz: 16b22333dda9aee3d1a8d149b6e1a5e4f2639c2aab39f7983b3a7d765da9cc36
5
5
  SHA512:
6
- metadata.gz: a1931b02895f606f1e8794c65d7e3e92967f6c33c6d54fa2251e9a751dff0a81808cf5d81475c433938473d8323bc1409d56c04ab4132ba8aae833f6a0798e8d
7
- data.tar.gz: c2313e289ed9f23de2203f48412e017c9942711f26c0c92c65dce2ec11eb0bf69650e05e8b7a9c4ef86413d960ae40af5021cb264cef92465bcc941f33d80bdb
6
+ metadata.gz: f3bba4862aa466faf91e25d4a47d32752fd3dbcae6331c8c5b396e10d311fe0676f37db14be2422028d73bc17bc36eb811dbb3cf51823fcc962b28c0247e5a1f
7
+ data.tar.gz: 4a123b134179c155a4494b3ebd788200f171b8698bc488377293b867451589db482eba2a1ee5897908bd207fb537c7b0644389af764279ef0ddcb8c1485c3a7d
@@ -0,0 +1,178 @@
1
+ # stub to call common GitHub Action (GA) as part of Continuous Integration (CI) Pull Request process checks for main branch
2
+ # inputs are described in the chef/common-github-actions/<GA.yml> with same name as this stub
3
+ #
4
+ # secrets are inherited from the calling workflow, typically SONAR_TOKEN, SONAR_HOST_URL, GH_TOKEN, AKEYLESS_JWT_ID, POLARIS_SERVER_URL and POLARIS_ACCESS_TOKEN
5
+
6
+ name: CI Pull Request on Main Branch
7
+
8
+ on:
9
+ pull_request:
10
+ branches: [ main, release/** ]
11
+ push:
12
+ branches: [ main, release/** ]
13
+
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ env:
20
+ STUB_VERSION: "1.0.8"
21
+
22
+ jobs:
23
+ echo_version:
24
+ name: 'Echo stub version'
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - name: echo version of stub and inputs
28
+ run: |
29
+ echo "CI main pull request stub version $STUB_VERSION"
30
+
31
+ detect-custom-metadata:
32
+ name: 'Detect custom properties'
33
+ runs-on: ubuntu-latest
34
+ outputs:
35
+ primaryApplication: ${{ steps.set-custom-metadata.outputs.primaryApplication }}
36
+ appBuildLanguage: ${{ steps.set-custom-metadata.outputs.applicationBuildLanguage }}
37
+ appBuildProfile: ${{ steps.set-custom-metadata.outputs.applicationBuildProfile }}
38
+ versionFromFile: ${{ steps.set-version-from-file.outputs.versionFromFile }}
39
+ steps:
40
+ - name: 'Checkout repository'
41
+ uses: actions/checkout@v4
42
+
43
+ - name: 'Detect version from file'
44
+ id: set-version-from-file
45
+ shell: bash
46
+ run: |
47
+ if [[ -f "VERSION" ]]; then
48
+ version=$(head -1 VERSION)
49
+ echo "VERSION_FROM_FILE=${version}" >> $GITHUB_ENV
50
+ echo "versionFromFile=${version}" >> $GITHUB_OUTPUT
51
+ elif [[ -f "go.mod" ]]; then
52
+ version=$(grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+' go.mod | head -1)
53
+ echo "VERSION_FROM_FILE=${version}" >> $GITHUB_ENV
54
+ echo "versionFromFile=${version}" >> $GITHUB_OUTPUT
55
+ else
56
+ echo "VERSION_FROM_FILE not found, defaulting to empty"
57
+ echo "versionFromFile=" >> $GITHUB_OUTPUT
58
+ fi
59
+ # do not do echo "::set-output name=versionFromFile::$version" any more per https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
60
+
61
+ - name: 'Detect app, language, and build profile environment variables from repository custom properties'
62
+ id: set-custom-metadata
63
+ # GH API returns something like [{"property_name":"GABuildLanguage","value":"go"},{"property_name":"GABuildProfile","value":"cli"},{"property_name":"primaryApplication","value":"chef-360"}]'
64
+ run: |
65
+ response=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/properties/values)
66
+
67
+ primaryApplication=$(echo "$response" | jq -r '.[] | select(.property_name=="primaryApplication") | .value')
68
+ GABuildLanguage=$(echo "$response" | jq -r '.[] | select(.property_name=="GABuildLanguage") | .value')
69
+ GABuildProfile=$(echo "$response" | jq -r '.[] | select(.property_name=="GABuildProfile") | .value')
70
+
71
+ echo "PRIMARY_APPLICATION=$primaryApplication" >> $GITHUB_ENV
72
+ echo "GA_BUILD_LANGUAGE=$GABuildLanguage" >> $GITHUB_ENV
73
+ echo "GA_BUILD_PROFILE=$GABuildProfile" >> $GITHUB_ENV
74
+
75
+ # If workflow_dispatch, use inputs (left), if other trigger, use default env (right)
76
+ echo "primaryApplication=${primaryApplication}" >> $GITHUB_OUTPUT
77
+ echo "applicationBuildLanguage=${GABuildLanguage}" >> $GITHUB_OUTPUT
78
+ echo "applicationBuildProfile=${GABuildProfile}" >> $GITHUB_OUTPUT
79
+ continue-on-error: true
80
+ env:
81
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
+
83
+ call-ci-main-pr-check-pipeline:
84
+ uses: chef/common-github-actions/.github/workflows/ci-main-pull-request.yml@main
85
+ # needs: [detect-custom-metadata, detect-version-from-file]
86
+ needs: [detect-custom-metadata]
87
+ secrets: inherit
88
+ permissions:
89
+ id-token: write
90
+ contents: read
91
+
92
+ with:
93
+ application: ${{ needs.detect-custom-metadata.outputs.primaryApplication }}
94
+ visibility: ${{ github.event.repository.visibility }} # private, public, or internal
95
+ # go-private-modules: GOPRIVATE for Go private modules, default is 'github.com/progress-platform-services/*
96
+
97
+ # if version specified, it takes precedence; can be a semver like 1.0.2-xyz or a tag like "latest"
98
+ version: ${{ needs.detect-custom-metadata.outputs.versionFromFile || '1.0.0' }}
99
+ detect-version-source-type: 'file' # options include "none" (do not detect), "file", "github-tag" or "github-release"
100
+ detect-version-source-parameter: '' # use for file name
101
+ language: ${{ needs.detect-custom-metadata.outputs.appBuildLanguage }} # Go, Ruby, Rust, JavaScript, TypeScript, Python, Java, C#, PHP, other - used for build and SonarQube language setting
102
+
103
+ # complexity-checks, linting, trufflehog and trivy
104
+ perform-complexity-checks: true
105
+ # scc-output-filename: 'scc-output.txt'
106
+ perform-language-linting: true # Perform language-specific linting and pre-compilation checks
107
+ perform-trufflehog-scan: true
108
+ perform-trivy-scan: true
109
+
110
+ # perform application build and unit testing, will use custom repository properties when implemented for chef-primary-application, chef-build-profile, and chef-build-language
111
+ build: true
112
+ build-profile: ${{ needs.detect-custom-metadata.outputs.appBuildProfile }}
113
+ unit-tests: false
114
+ unit-test-output-path: "path/to/file.out"
115
+ unit-test-command-override: ""
116
+
117
+ # BlackDuck SAST (Polaris) require a build or binary present in repo to do SAST testing
118
+ # requires these secrets: POLARIS_SERVER_URL, POLARIS_ACCESS_TOKEN
119
+ perform-blackduck-polaris: false
120
+ polaris-application-name: "Chef-Agents" # one of these: Chef-Agents, Chef-Automate, Chef-Chef360, Chef-Habitat, Chef-Infrastructure-Server, Chef-Shared-Services, Chef-Other, Chef-Non-Product
121
+ polaris-project-name: ${{ github.event.repository.name }} # arch-sample-cli
122
+ polaris-working-directory: '.' # Working directory for the scan, defaults to . but usually lang-dependent like ./src
123
+ polaris-coverity-build-command: 'go build -o bin/chef-cli.exe' # Coverity build command, typically done in build stage by language or here as param 1-liner like "mvn clean install"
124
+ polaris-coverity-clean-command: 'go clean' # Coverity clean command, typically done before build stage by language or here as param 1-liner like "mvn clean"
125
+ polaris-detect-search-depth: '5' # Detect search depth, blank but can be set to "3" to search up to 3 levels of subdirectories for code to scan'
126
+ polaris-assessment-mode: 'SAST' # Assessment mode (SAST, CI or SOURCE_UPLOAD)
127
+ wait-for-scan: true
128
+ # polaris-detect-args: '' # Additional Detect arguments, can supply extra arguments like "--detect.diagnostic=true"
129
+ # coverity_build_command: "go build"
130
+ # coverity_clean_command: "go clean"
131
+ # polaris-config-path: '' # Path to Detect configuration file, typically a file supplied at root level like ./detect-config.yml
132
+ # polaris-coverity-config-path: '' # Path to Coverity configuration file, typically a file supplied at root level like ./coverity.yml
133
+ # polaris-coverity-args: '' # Additional Coverity arguments,can supply extra arguments like "--config-override capture.build.build-command=make
134
+
135
+ # perform SonarQube scan, with or without unit test coverage data
136
+ # requires secrets SONAR_TOKEN and SONAR_HOST_URL (progress.sonar.com)
137
+ perform-sonarqube-scan: true
138
+ # perform-sonar-build: true
139
+ # build-profile: 'default'
140
+ # report-unit-test-coverage: true
141
+ perform-docker-scan: false # scan Dockerfile and built images with Docker Scout or Trivy; see repo custom properties matching "container"
142
+
143
+ # report to central developer dashboard
144
+ report-to-atlassian-dashboard: false
145
+ quality-product-name: 'Chef-Agents' # product name for quality reporting, like Chef360, Courier, Inspec
146
+ # quality-product-name: ${{ github.event.repository.name }} # like 'Chef-360' - the product name for quality reporting, like Chef360, Courier, Inspec
147
+ # quality-sonar-app-name: 'YourSonarAppName'
148
+ # quality-testing-type: 'Integration' like Unit, Integration, e2e, api, Performance, Security
149
+ # quality-service-name: 'YourServiceOrRepoName'
150
+ # quality-junit-report: 'path/to/junit/report''
151
+
152
+ # perform Habitat-based and native packaging, publish to package repositories
153
+ package-binaries: false # Package binaries (e.g., RPM, DEB, MSI, dpkg + signing + SHA)
154
+ habitat-build: false # Create Habitat packages
155
+ publish-habitat-packages: false # Publish Habitat packages to Builder
156
+ publish-habitat-hab_package: false # Chef Habitat package to install (e.g., core/nginx)
157
+ publish-habitat-hab_version: "1.0.0" # Chef Habitat package version (optional)
158
+ publish-habitat-hab_release: "20240101010101" # Chef Habitat package release (optional)
159
+ publish-habitat-hab_channel: "stable" # Chef Habitat package channel (e.g., stable, base, base-2025); default is stable
160
+ publish-habitat-hab_auth_token: "" # Chef Habitat Builder authentication token (uses secret if not provided)
161
+ publish-habitat-runner_os: "ubuntu-latest" # OS runner for Habitat package publishing job, can also be windows-latest
162
+ habitat-grype-scan: false # Scan built Habitat packages with Grype for vulnerabilities
163
+ publish-packages: false # Publish packages (e.g., container from Dockerfile to ECR, go-releaser binary to releases page, omnibus to artifactory, gems, choco, homebrew, other app stores)
164
+
165
+ # generate and export Software Bill of Materials (SBOM) in various formats
166
+ generate-sbom: true
167
+ export-github-sbom: true # SPDX JSON artifact on job instance
168
+ generate-msft-sbom: false
169
+ license_scout: false # Run license scout for license compliance (uses .license_scout.yml)
170
+
171
+ # perform Blackduck software composition analysis (SCA) for 3rd party CVEs, licensing, and operational risk
172
+ perform-blackduck-sca-scan: true # combined with generate sbom & generate github-sbom, also needs version above
173
+ blackduck-project-group-name: 'Chef-Agents' # typically one of (Chef), Chef-Agents, Chef-Automate, Chef-Chef360, Chef-Habitat, Chef-Infrastructure-Server, Chef-Shared-Services, Chef-Non-Product'
174
+ blackduck-project-name: ${{ github.event.repository.name }} # BlackDuck project name, typically the repository name
175
+
176
+ # udf1: 'default' # user defined flag 1
177
+ # udf2: 'default' # user defined flag 2
178
+ # udf3: 'default' # user defined flag 3
@@ -7,27 +7,6 @@ on:
7
7
  pull_request:
8
8
 
9
9
  jobs:
10
- build-2-6:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v4
14
- - run: docker compose build rspec-2.6
15
- - run: docker compose run rspec-2.6
16
-
17
- build-2-7:
18
- runs-on: ubuntu-latest
19
- steps:
20
- - uses: actions/checkout@v4
21
- - run: docker compose build rspec-2.7
22
- - run: docker compose run rspec-2.7
23
-
24
- build-3-0:
25
- runs-on: ubuntu-latest
26
- steps:
27
- - uses: actions/checkout@v4
28
- - run: docker compose build rspec-3.0
29
- - run: docker compose run rspec-3.0
30
-
31
10
  build-3-1:
32
11
  runs-on: ubuntu-latest
33
12
  steps:
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- ARG BASE_IMAGE=ruby:2.7
1
+ ARG BASE_IMAGE=ruby:3.1
2
2
  FROM ${BASE_IMAGE}
3
3
 
4
4
  RUN gem install bundler:2.3.5
@@ -9,7 +9,6 @@ COPY Gemfile *.gemspec ./
9
9
  COPY lib/k8s/ruby/version.rb ./lib/k8s/ruby/
10
10
 
11
11
  RUN bundle install
12
- RUN bundle update --bundler
13
12
 
14
13
  COPY . .
15
14
  ENTRYPOINT ["/app/entrypoint.sh"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.17.2
1
+ 0.18.0
data/docker-compose.yaml CHANGED
@@ -1,25 +1,4 @@
1
1
  services:
2
- rspec-2.6:
3
- build:
4
- context: .
5
- args:
6
- BASE_IMAGE: ruby:2.6
7
- volumes:
8
- - .:/app
9
- rspec-2.7:
10
- build:
11
- context: .
12
- args:
13
- BASE_IMAGE: ruby:2.7
14
- volumes:
15
- - .:/app
16
- rspec-3.0:
17
- build:
18
- context: .
19
- args:
20
- BASE_IMAGE: ruby:3.0
21
- volumes:
22
- - .:/app
23
2
  rspec-3.1:
24
3
  build:
25
4
  context: .
data/k8s-ruby.gemspec CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = "bin"
22
22
  spec.executables = []
23
23
  spec.require_paths = ["lib"]
24
- spec.required_ruby_version = ">= 2.4"
24
+ spec.required_ruby_version = ">= 3.1"
25
25
 
26
- spec.add_runtime_dependency "excon", "~> 0.71"
26
+ spec.add_runtime_dependency "excon", "~> 1.5"
27
27
  spec.add_runtime_dependency "dry-struct"
28
28
  spec.add_runtime_dependency "dry-types"
29
29
  spec.add_runtime_dependency "dry-configurable"
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "yaml-safe_load_stream3"
35
35
  spec.add_runtime_dependency "base64"
36
36
 
37
- spec.add_development_dependency "bundler", ">= 1.17", "< 3.0"
37
+ spec.add_development_dependency "bundler", ">= 1.17"
38
38
  spec.add_development_dependency "rake", ">= 12.3.3"
39
39
  spec.add_development_dependency "rspec", "~> 3.7"
40
40
  spec.add_development_dependency "webmock", "~> 3.6"
@@ -3,6 +3,6 @@
3
3
  module K8s
4
4
  class Ruby
5
5
  # Updated on releases using semver.
6
- VERSION = "0.17.2"
6
+ VERSION = "0.18.0"
7
7
  end
8
8
  end
data/lib/k8s/transport.rb CHANGED
@@ -183,6 +183,7 @@ module K8s
183
183
  persistent: true,
184
184
  middlewares: EXCON_MIDDLEWARES,
185
185
  headers: REQUEST_HEADERS,
186
+ include_default_port: !@options[:omit_default_port],
186
187
  **@options
187
188
  )
188
189
  end
@@ -0,0 +1,43 @@
1
+ # SonarQube configuration file
2
+ #
3
+ # Sample Ruby Sonar file - https://docs.sonarsource.com/sonarqube-server/10.6/analyzing-source-code/languages/ruby/
4
+ # properties defined in https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/analysis-parameters/
5
+ #
6
+ # view this repo in sonar: <ADD your URL like https://sonar.progress.com/dashboard?id=chef_inspec_k8s-ruby_d9e48289-6759-4a67-ba37-d2df5736629f>
7
+ # Required metadata
8
+ sonar.projectKey=inspec_k8s-ruby_d9e48289-6759-4a67-ba37-d2df5736629f
9
+ # project name is 3 parts: "Chef" + "<area/product>" + "<repo>" with underscores between
10
+ # <area/product> choices: Chef-Agents | Chef-Automate | Chef360 | Chef-Habitat | Chef-Infra-Server | Chef-Shared-Services
11
+ # example project name: chef/chef-vault repo would be Chef_Chef-Infra-Client_chef-vault
12
+ sonar.projectName=Chef_InSpec_k8s-ruby
13
+ # sonar.projectVersion=1.0
14
+ # sonar.projectDescription=
15
+
16
+ # Language - https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/languages/overview/ go, ruby, rust
17
+ sonar.language=ruby
18
+ sonar.sources=lib
19
+ # sonar.sources=lib <-- for Ruby, match this with the /spec directory for tests & SARIF output directory for test results/rcov
20
+ # sonar.exclusions=**/*_test.go, **/*.js, **/*.sql, **/*.yml, **/*.yaml; may exclude **/vendor/** for Ruby
21
+
22
+ # Unit tests
23
+ sonar.tests=spec
24
+ # was spec/**/*.rb
25
+ # sonar.test.inclusions=**/*_test.go **/*Test.java
26
+ # Coverage report
27
+ sonar.ruby.coverage.framework=RSpec
28
+ sonar.ruby.coverage.reportPaths=coverage/coverage.json
29
+ # ^^^ comma-delimited paths to Rubocop reports, SimpleCov, or RSpec plugin reports (coverage/coverage.json <-- default output for simpleCov)
30
+
31
+ # sonar.ruby.rubocop.reportPaths=./rubocop-report.json -- import Ruby Rubocop
32
+ # sonar.dependencyCheck.htmlReportPath=./dependency-check-report.html -- import OWASP dependency check report
33
+ # sonar.externalIssuesReportPaths Comma-delimited list of paths to generic issue reports.
34
+ # sonar.sarifReportPaths Comma-delimited list of paths to SARIF issue reports.
35
+
36
+ # Additional settings
37
+ # sonar.qualitygate.wait=false
38
+ # sonar.qualitygate.timeout=300
39
+
40
+ # skip C-language processor
41
+ sonar.c.file.suffixes=-
42
+ sonar.cpp.file.suffixes=-
43
+ sonar.objc.file.suffixes=-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k8s-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rdx.net
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-10 00:00:00.000000000 Z
12
+ date: 2026-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.71'
20
+ version: '1.5'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0.71'
27
+ version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: dry-struct
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -164,9 +164,6 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.17'
167
- - - "<"
168
- - !ruby/object:Gem::Version
169
- version: '3.0'
170
167
  type: :development
171
168
  prerelease: false
172
169
  version_requirements: !ruby/object:Gem::Requirement
@@ -174,9 +171,6 @@ dependencies:
174
171
  - - ">="
175
172
  - !ruby/object:Gem::Version
176
173
  version: '1.17'
177
- - - "<"
178
- - !ruby/object:Gem::Version
179
- version: '3.0'
180
174
  - !ruby/object:Gem::Dependency
181
175
  name: rake
182
176
  requirement: !ruby/object:Gem::Requirement
@@ -256,6 +250,7 @@ extra_rdoc_files: []
256
250
  files:
257
251
  - ".expeditor/config.yml"
258
252
  - ".expeditor/update_version.sh"
253
+ - ".github/workflows/ci-main-pull-request-stub-1.0.8.yml"
259
254
  - ".github/workflows/tests.yml"
260
255
  - ".gitignore"
261
256
  - ".rspec"
@@ -291,6 +286,7 @@ files:
291
286
  - lib/k8s/stack.rb
292
287
  - lib/k8s/transport.rb
293
288
  - lib/k8s/util.rb
289
+ - sonar-project.properties
294
290
  homepage: https://github.com/k8s-ruby/k8s-ruby
295
291
  licenses:
296
292
  - Apache-2.0
@@ -303,7 +299,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
303
299
  requirements:
304
300
  - - ">="
305
301
  - !ruby/object:Gem::Version
306
- version: '2.4'
302
+ version: '3.1'
307
303
  required_rubygems_version: !ruby/object:Gem::Requirement
308
304
  requirements:
309
305
  - - ">="