Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/make-self-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
exit 1

- name: Octo STS Token Exchange
uses: octo-sts/action@a26b0c6455c7f13316f29a8766287f939e75f6c8 # v1.0.2
uses: octo-sts/action@d6c70ad3b9ac85df6da6b9749014d7283987cfec # v1.0.3
id: octo-sts
with:
scope: 'jetstack/jetstack-secure'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
exit 1

- name: Octo STS Token Exchange
uses: octo-sts/action@a26b0c6455c7f13316f29a8766287f939e75f6c8 # v1.0.2
uses: octo-sts/action@d6c70ad3b9ac85df6da6b9749014d7283987cfec # v1.0.3
id: octo-sts
with:
scope: 'jetstack/jetstack-secure'
Expand All @@ -50,7 +50,7 @@ jobs:
go-version: ${{ steps.go-version.outputs.result }}

- name: Self-hosted Renovate
uses: renovatebot/github-action@70ea19f1b0dc8a9cc7af1b4278f8d3fd9778b577 # v43.0.17
uses: renovatebot/github-action@c5fdc9f98fdf9e9bb16b5760f7e560256eb79326 # v44.0.2
with:
configurationFile: .github/renovate.json5
token: ${{ steps.octo-sts.outputs.token }}
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ linters:
- makezero
- mirror
- misspell
- modernize
- musttag
- nakedret
- nilerr
Expand Down Expand Up @@ -81,9 +82,10 @@ formatters:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/jetstack/preflight) # Custom section: groups all imports with the specified Prefix.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
custom-order: true
exclusions:
generated: lax
paths: [third_party, builtin$, examples$]
30 changes: 15 additions & 15 deletions api/datareading.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type DataReadingsPost struct {
type DataReading struct {
// ClusterID is optional as it can be inferred from the agent
// token when using basic authentication.
ClusterID string `json:"cluster_id,omitempty"`
DataGatherer string `json:"data-gatherer"`
Timestamp Time `json:"timestamp"`
Data interface{} `json:"data"`
SchemaVersion string `json:"schema_version"`
ClusterID string `json:"cluster_id,omitempty"`
DataGatherer string `json:"data-gatherer"`
Timestamp Time `json:"timestamp"`
Data any `json:"data"`
SchemaVersion string `json:"schema_version"`
}

// UnmarshalJSON implements the json.Unmarshaler interface for DataReading.
Expand Down Expand Up @@ -61,11 +61,11 @@ func (o *DataReading) UnmarshalJSON(data []byte) error {

// Define a list of decoding attempts with prioritized types
dataTypes := []struct {
target interface{}
assign func(interface{})
target any
assign func(any)
}{
{&DiscoveryData{}, func(v interface{}) { o.Data = v.(*DiscoveryData) }},
{&DynamicData{}, func(v interface{}) { o.Data = v.(*DynamicData) }},
{&DiscoveryData{}, func(v any) { o.Data = v.(*DiscoveryData) }},
{&DynamicData{}, func(v any) { o.Data = v.(*DynamicData) }},
}

// Attempt to decode the Data field into each type
Expand All @@ -82,7 +82,7 @@ func (o *DataReading) UnmarshalJSON(data []byte) error {

// jsonUnmarshalStrict unmarshals JSON data into the provided interface,
// disallowing unknown fields to ensure strict adherence to the expected structure.
func jsonUnmarshalStrict(data []byte, v interface{}) error {
func jsonUnmarshalStrict(data []byte, v any) error {
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
return decoder.Decode(v)
Expand All @@ -92,8 +92,8 @@ func jsonUnmarshalStrict(data []byte, v interface{}) error {
type GatheredResource struct {
// Resource is a reference to a k8s object that was found by the informer
// should be of type unstructured.Unstructured, raw Object
Resource interface{} `json:"resource"`
DeletedAt Time `json:"deleted_at,omitempty"`
Resource any
DeletedAt Time
}

func (v GatheredResource) MarshalJSON() ([]byte, error) {
Expand All @@ -103,8 +103,8 @@ func (v GatheredResource) MarshalJSON() ([]byte, error) {
}

data := struct {
Resource interface{} `json:"resource"`
DeletedAt string `json:"deleted_at,omitempty"`
Resource any `json:"resource"`
DeletedAt string `json:"deleted_at,omitempty"`
}{
Resource: v.Resource,
DeletedAt: dateString,
Expand All @@ -116,7 +116,7 @@ func (v GatheredResource) MarshalJSON() ([]byte, error) {
func (v *GatheredResource) UnmarshalJSON(data []byte) error {
var tmpResource struct {
Resource *unstructured.Unstructured `json:"resource"`
DeletedAt Time `json:"deleted_at,omitempty"`
DeletedAt Time `json:"deleted_at"`
}

d := json.NewDecoder(bytes.NewReader(data))
Expand Down
2 changes: 1 addition & 1 deletion api/datareading_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestDataReading_UnmarshalJSON(t *testing.T) {
tests := []struct {
name string
input string
wantDataType interface{}
wantDataType any
expectError string
}{
{
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ require (
github.com/spf13/cobra v1.10.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
golang.org/x/sync v0.17.0
golang.org/x/sync v0.18.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.34.1
k8s.io/apimachinery v0.34.1
k8s.io/client-go v0.34.1
k8s.io/component-base v0.34.1
sigs.k8s.io/controller-runtime v0.22.3
k8s.io/api v0.34.2
k8s.io/apimachinery v0.34.2
k8s.io/client-go v0.34.2
k8s.io/component-base v0.34.2
sigs.k8s.io/controller-runtime v0.22.4
sigs.k8s.io/yaml v1.6.0
)

Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKl
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -297,18 +297,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM=
k8s.io/api v0.34.1/go.mod h1:SB80FxFtXn5/gwzCoN6QCtPD7Vbu5w2n1S0J5gFfTYk=
k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY=
k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw=
k8s.io/apiextensions-apiserver v0.34.1 h1:NNPBva8FNAPt1iSVwIE0FsdrVriRXMsaWFMqJbII2CI=
k8s.io/apiextensions-apiserver v0.34.1/go.mod h1:hP9Rld3zF5Ay2Of3BeEpLAToP+l4s5UlxiHfqRaRcMc=
k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4=
k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4=
k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
k8s.io/apiserver v0.34.1 h1:U3JBGdgANK3dfFcyknWde1G6X1F4bg7PXuvlqt8lITA=
k8s.io/apiserver v0.34.1/go.mod h1:eOOc9nrVqlBI1AFCvVzsob0OxtPZUCPiUJL45JOTBG0=
k8s.io/client-go v0.34.1 h1:ZUPJKgXsnKwVwmKKdPfw4tB58+7/Ik3CrjOEhsiZ7mY=
k8s.io/client-go v0.34.1/go.mod h1:kA8v0FP+tk6sZA0yKLRG67LWjqufAoSHA2xVGKw9Of8=
k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A=
k8s.io/component-base v0.34.1/go.mod h1:mknCpLlTSKHzAQJJnnHVKqjxR7gBeHRv0rPXA7gdtQ0=
k8s.io/client-go v0.34.2 h1:Co6XiknN+uUZqiddlfAjT68184/37PS4QAzYvQvDR8M=
k8s.io/client-go v0.34.2/go.mod h1:2VYDl1XXJsdcAxw7BenFslRQX28Dxz91U9MWKjX97fE=
k8s.io/component-base v0.34.2 h1:HQRqK9x2sSAsd8+R4xxRirlTjowsg6fWCPwWYeSvogQ=
k8s.io/component-base v0.34.2/go.mod h1:9xw2FHJavUHBFpiGkZoKuYZ5pdtLKe97DEByaA+hHbM=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA=
Expand All @@ -317,8 +317,8 @@ k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzk
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/controller-runtime v0.22.3 h1:I7mfqz/a/WdmDCEnXmSPm8/b/yRTy6JsKKENTijTq8Y=
sigs.k8s.io/controller-runtime v0.22.3/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A=
sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
Expand Down
18 changes: 9 additions & 9 deletions internal/cyberark/servicediscovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func New(httpClient *http.Client) *Client {
// DiscoveryResponse represents the full JSON response returned by the CyberArk api/tenant-discovery/public API
// The API is documented here https://ca-il-confluence.il.cyber-ark.com/spaces/EV/pages/575618345/Updated+PD+APIs+doc
type DiscoveryResponse struct {
Region string `json:"region"`
DRRegion string `json:"dr_region"`
Subdomain string `json:"subdomain"`
TenantID string `json:"tenant_id"`
PlatformID string `json:"platform_id"`
IdentityID string `json:"identity_id"`
DefaultURL string `json:"default_url"`
TenantFlags map[string]interface{} `json:"tenant_flags"`
Services []Service `json:"services"`
Region string `json:"region"`
DRRegion string `json:"dr_region"`
Subdomain string `json:"subdomain"`
TenantID string `json:"tenant_id"`
PlatformID string `json:"platform_id"`
IdentityID string `json:"identity_id"`
DefaultURL string `json:"default_url"`
TenantFlags map[string]any `json:"tenant_flags"`
Services []Service `json:"services"`
}

type Service struct {
Expand Down
22 changes: 11 additions & 11 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,55 @@ targets:
- folder_name: generate-verify
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/generate-verify
- folder_name: go
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/go
- folder_name: helm
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/helm
- folder_name: help
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/help
- folder_name: kind
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/kind
- folder_name: klone
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/klone
- folder_name: licenses
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/licenses
- folder_name: oci-build
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/oci-build
- folder_name: oci-publish
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/oci-publish
- folder_name: repository-base
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/repository-base
- folder_name: tools
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 3640ec2744eca6198a647fa0cd6ca09536aa4f8e
repo_hash: 4479013f57fb2f7f0f28b4e951dc1ba6e6badddc
repo_path: modules/tools
4 changes: 3 additions & 1 deletion make/_shared/go/.golangci.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ linters:
- makezero
- mirror
- misspell
- modernize
- musttag
- nakedret
- nilerr
Expand All @@ -69,10 +70,11 @@ formatters:
enable: [ gci, gofmt ]
settings:
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix({{REPO-NAME}}) # Custom section: groups all imports with the specified Prefix.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
exclusions:
Expand Down
5 changes: 2 additions & 3 deletions make/_shared/go/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ generate-golangci-lint-config: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir)/s
cp $(golangci_lint_config) $(bin_dir)/scratch/golangci-lint.yaml.tmp
$(YQ) -i 'del(.linters.enable)' $(bin_dir)/scratch/golangci-lint.yaml.tmp
$(YQ) eval-all -i '. as $$item ireduce ({}; . * $$item)' $(bin_dir)/scratch/golangci-lint.yaml.tmp $(golangci_lint_override)
$(YQ) -i '(.. | select(tag == "!!str")) |= sub("{{REPO-NAME}}", "$(repo_name)")' $(bin_dir)/scratch/golangci-lint.yaml.tmp
mv $(bin_dir)/scratch/golangci-lint.yaml.tmp $(golangci_lint_config)

shared_generate_targets += generate-golangci-lint-config
Expand Down Expand Up @@ -147,9 +146,9 @@ fix-golangci-lint: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(NEEDS_GCI) $(bin_dir)/
@find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \
| while read d; do \
target=$$(dirname $${d}); \
echo "Running 'GOVERSION=$(VENDORED_GO_VERSION) $(bin_dir)/tools/golangci-lint fmt -c $(CURDIR)/$(golangci_lint_config)' in directory '$${target}'"; \
echo "Running 'GOVERSION=$(VENDORED_GO_VERSION) $(bin_dir)/tools/golangci-lint run --fix -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout)' in directory '$${target}'"; \
pushd "$${target}" >/dev/null; \
GOVERSION=$(VENDORED_GO_VERSION) $(GOLANGCI-LINT) fmt -c $(CURDIR)/$(golangci_lint_config) || exit; \
GOVERSION=$(VENDORED_GO_VERSION) $(GOLANGCI-LINT) run --fix -c $(CURDIR)/$(golangci_lint_config) --timeout $(golangci_lint_timeout) || exit; \
popd >/dev/null; \
echo ""; \
done
1 change: 1 addition & 0 deletions make/_shared/licenses/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ oci-license-layer-$1: | $(bin_dir)/scratch $(NEEDS_GO-LICENSES)
cp $$(go_$1_mod_dir)/LICENSES $$(license_layer_path_$1)/licenses/LICENSES

oci-build-$1: oci-license-layer-$1
oci-build-$1__local: oci-license-layer-$1
oci_$1_additional_layers += $$(license_layer_path_$1)
endef

Expand Down
Loading