53 Commits

Author SHA1 Message Date
Wei Liu
6117a3e553 disable leader election for grpc server (#1468)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
2026-04-02 08:25:46 +00:00
Jian Zhu
fc55a5df7c 🌱 Add TLS ConfigMap watch and restart for cluster-manager operator (#1452)
* 🌱 Add TLS profile configuration support via flags and ConfigMap

Add pkg/common/tls library to support TLS profile compliance
for OCM components. This enables components to receive TLS
configuration via command-line flags (--tls-min-version and
--tls-cipher-suites) from operators, aligning with the upstream
enhancement proposal for TLS profile configuration.

Key features:
- TLS version and cipher suite parsing from flags or ConfigMap
- ConfigMap-based TLS configuration for operator use
- ConfigMap watcher for operators to detect profile changes
- OpenSSL cipher name mapping to Go crypto/tls constants
- Safe defaults (TLS 1.2) when no configuration provided

Updated pkg/common/options/webhook.go to use TLS library instead
of hardcoded TLS 1.2, enabling webhook components to respect
TLS flags injected by operators.

This is the foundation for OCM TLS profile compliance, keeping
upstream code OpenShift-agnostic while supporting dynamic TLS
configuration.

Related: open-cluster-management-io/enhancements#175

Signed-off-by: Jia Zhu <jiazhu@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Add TLS ConfigMap watch and restart to cluster-manager operator

Implement ConfigMap-based TLS profile compliance for cluster-manager operator
with hash comparison to prevent infinite restart loops.

Changes:
- Add TLS ConfigMap informer to watch ocm-tls-profile ConfigMap
- Load current TLS config at startup and compute hash
- Add event handlers that compare ConfigMap hash with current hash
- Only restart if ConfigMap content actually differs from current config
- Add comprehensive logging for all scenarios

Scenarios handled:
 ConfigMap exists at startup (hash matches) → no restart
 ConfigMap created after startup (hash differs) → restart to apply
 ConfigMap updated (new hash differs) → restart to apply
 ConfigMap deleted (was using it) → restart to use defaults

Leader election behavior:
- This code only runs on the leader pod (due to controllercmd framework)
- Non-leader pods wait idle until they acquire leadership
- New leaders load current ConfigMap state when they start, ensuring latest config
- Only the active leader monitors ConfigMap changes and restarts

🤖 Generated with Claude Code

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Inject TLS config flags into addon-webhook deployment

Implement Case 2 pattern for addon-webhook TLS configuration:
cluster-manager-operator loads TLS config from ConfigMap and injects
it as flags into the addon-webhook deployment.

Changes:
- Add AddonWebhookTLSMinVersion and AddonWebhookTLSCipherSuites fields to HubConfig
- Load TLS config once when creating ClusterManagerController
- Pass TLS config strings as parameters to controller
- Inject --tls-min-version and --tls-cipher-suites flags into addon-webhook deployment template

This approach ensures addon-webhook receives TLS configuration via flags
without needing to watch the ConfigMap itself. When the ConfigMap changes,
cluster-manager-operator restarts, reloads the config, and updates the
deployment with new flags.

🤖 Generated with Claude Code

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Log TLS min version and cipher suites on startup

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Move TLS library to sdk-go and update vendor dependencies

Relocates TLS config and cipher helpers from pkg/common/tls into the
vendored open-cluster-management.io/sdk-go/pkg/tls package, adds a
generic watcher utility, and updates all import references accordingly.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Inject TLS flags into all hub component deployments

Extend TLS flag injection from addon-webhook-only to all seven
hub deployments managed by cluster-manager-operator:

Manifests (operator → deployment args):
- Rename HubConfig.AddonWebhookTLS* → TLS* so the same fields
  drive all deployments rather than only the addon webhook
- Add {{- if .TLSMinVersion }} blocks to all six remaining
  deployment manifests (registration/work/placement controllers
  and registration/work webhook servers)

Controller binaries (registration, work, placement, addon-manager):
- Add --tls-min-version and --tls-cipher-suites flags to the
  common Options struct so the binaries accept the injected flags
  without failing; the flags are stored for future use

Note: library-go's NewCommandWithContext uses cmd.Run (not RunE),
so there is no clean programmatic hook to inject TLS into the 8443
health server without bypassing library-go's own boilerplate
(signal handling, log init, profiling). Upstream library-go also
has no native TLS configuration API on ControllerCommandConfig or
ControllerBuilder. The 8443 health server defaults to TLS 1.2 via
SetRecommendedHTTPServingInfoDefaults; configuring it further
requires an upstream library-go enhancement.

Webhook binaries already fully support these flags via WebhookOptions;
no binary changes are needed there.

Signed-off-by: Jian Zhu <zhujian@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Wire --tls-min-version to library-go 8443 health server via WithServingTLSConfig

Now that library-go has WithServingTLSConfig (ServingMinTLSVersion /
ServingCipherSuites fields + injection in StartController before
WithServer is called), wire the --tls-min-version and
--tls-cipher-suites flags from Options into it.

ApplyTLSToCommand installs a PersistentPreRunE hook that calls
CmdConfig.WithServingTLSConfig after cobra flag parsing completes.
PersistentPreRunE runs before cmd.Run, so all library-go boilerplate
(signal handling, logging, profiling) is preserved - unlike the
previous approach of replacing RunE which silently bypassed it.

Uses go mod replace → /Users/jiazhu/go/src/github.com/openshift/library-go
for local development/testing; replace directive to be removed once the
library-go PR is merged and vendored.

Signed-off-by: Jian Zhu <zhujian@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Switch to --config file for controller 8443 TLS configuration

Replace the WithServingTLSConfig approach with library-go's native
--config flag mechanism:

ApplyTLSToCommand now installs a PersistentPreRunE hook that:
1. Writes a minimal GenericOperatorConfig YAML to a temp file under
   /tmp (which is mounted as an emptyDir in all hub controller
   deployments, so writing is safe even with readOnlyRootFilesystem)
2. Sets --config to point at the temp file before cmd.Run executes

All library-go boilerplate in cmd.Run (signal handling, log init,
profiling, basicFlags.Validate) is fully preserved because
PersistentPreRunE runs before Run, not replacing it.

Inside StartController, Config() reads the temp file; the TLS values
survive SetRecommendedHTTPServingInfoDefaults because DefaultString
only sets fields that are currently empty.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Add tests for TLS profile compliance

Unit tests (pkg/common/options):
- TestApplyTLSToCommand: table-driven test covering all flag combinations:
  no flags (no-op), min-version only, cipher-suites only, both set,
  and --config pre-set by user (injection skipped).

Unit tests (clustermanager_controller):
- TestSyncDeployWithTLSConfig: verifies that when tlsMinVersion /
  tlsCipherSuites are set on the controller, the --tls-min-version and
  --tls-cipher-suites flags appear in the args of every managed hub
  deployment (registration, registration-webhook, placement, work-webhook).
  Also verifies the flags are absent when TLS config is not set.

Integration tests (test/integration/operator):
- "should inject tls-min-version into all hub deployments when
  ocm-tls-profile ConfigMap exists": creates the ocm-tls-profile
  ConfigMap with minTLSVersion=VersionTLS13 in the operator namespace
  and verifies all six hub deployments gain --tls-min-version=VersionTLS13
  in their container args.

Signed-off-by: Jian Zhu <zhujian@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Switch TLS cipher suite format from OpenSSL to IANA

Update vendored sdk-go to use IANA cipher suite names (e.g.
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) instead of OpenSSL names
(e.g. ECDHE-RSA-AES128-GCM-SHA256).

IANA is the canonical format used by Go's crypto/tls, the Kubernetes
apiserver --tls-cipher-suites flag, and library-go's ServingInfo.CipherSuites.
Using IANA names end-to-end eliminates the format mismatch that caused
library-go's 8443 health server to reject cipher suite names written by
ApplyTLSToCommand.

The ocm-tls-profile ConfigMap now accepts IANA names only. The downstream
tls-profile-sync sidecar is responsible for converting OpenShift
TLSSecurityProfile (OpenSSL-style) names to IANA before writing the ConfigMap.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Fix TLS ConfigMap test: create ConfigMap before operator startup

The previous test created ocm-tls-profile ConfigMap after the operator
started, which triggered the watcher's hash-change detection and called
os.Exit(0), killing the test process. Move the test into a dedicated
Describe with BeforeEach that creates the ConfigMap before starting the
operator so the watcher seeds its hash at startup and no restart is
triggered.

Also add hubWorkControllerDeployment to the tlsDeployments list since
its manifest includes tls-min-version injection.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: Jia Zhu <jiazhu@redhat.com>
Signed-off-by: zhujian <jiazhu@redhat.com>
Signed-off-by: Jian Zhu <zhujian@redhat.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-01 06:54:30 +00:00
Jian Qiu
c367622060 🌱 Move addon api to beta in registration (#1438)
* Move addon api to beta in registration

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update conversion e2e tests

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Add addon v1beta1 to supported type in grpc

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix flaky e2e in addon conversion

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Set subject for registration configuration when it is not set

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2026-03-23 13:31:55 +00:00
Ben Perry
501c2d6d35 Support default mode webhook networking configuration (#1035)
* Support default mode webhook networking configuration

Signed-off-by: Ben Perry <bhperry94@gmail.com>

* Share common webhook config between hosted and default mode

Signed-off-by: Ben Perry <bhperry94@gmail.com>

* Nest all related bind configuration together

Signed-off-by: Ben Perry <bhperry94@gmail.com>

* Disable surge with hostNetwork to prevent port conflicts

Signed-off-by: Ben Perry <bhperry94@gmail.com>

* Remove dev dependency

Signed-off-by: Ben Perry <bhperry94@gmail.com>

* Set defaults in one place

Signed-off-by: Ben Perry <bhperry94@gmail.com>

---------

Signed-off-by: Ben Perry <bhperry94@gmail.com>
2026-02-28 02:43:41 +00:00
Jian Zhu
2128dfebcc fix: handle ComponentNamespace in CI test environment (#1387)
The TestNewAgentOptions test was failing in CI because it expected
ComponentNamespace to always be "open-cluster-management-agent", but
NewAgentOptions() reads from /var/run/secrets/kubernetes.io/serviceaccount/namespace
when running in a Kubernetes pod (which exists in CI environment).

Updated the test to accept either the default value (when running locally)
or the actual pod namespace (when running in CI), while ensuring the
namespace is never empty.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: zhujian <jiazhu@redhat.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 14:14:59 +00:00
Jian Qiu
2743547b40 Reduce logging level of DumpSecret to v(4) (#1357)
It generates a lot of noises otherwise

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2026-01-29 04:28:42 +00:00
Jian Qiu
33310619d9 🌱 use SDK basecontroller for better logging. (#1269)
* Use basecontroller in sdk-go instead for better logging

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Rename to fakeSyncContext

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-12-01 03:07:02 +00:00
Jian Qiu
8f8cd01b52 Update dependencies: k8s 0.34.1, controller-runtime 0.22.3, and OCM libs (#1267)
Some checks failed
Post / coverage (push) Failing after 37m28s
Post / images (amd64, addon-manager) (push) Failing after 7m29s
Post / images (amd64, placement) (push) Failing after 7m1s
Post / images (amd64, registration) (push) Failing after 7m7s
Post / images (amd64, registration-operator) (push) Failing after 7m22s
Post / images (amd64, work) (push) Failing after 7m25s
Post / images (arm64, addon-manager) (push) Failing after 7m5s
Post / images (arm64, placement) (push) Failing after 7m4s
Post / images (arm64, registration) (push) Failing after 7m20s
Post / images (arm64, registration-operator) (push) Failing after 7m9s
Post / images (arm64, work) (push) Failing after 7m12s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 59s
Close stale issues and PRs / stale (push) Successful in 29s
- Update k8s.io/* libraries to v0.34.1
- Update sigs.k8s.io/controller-runtime to v0.22.3
- Update open-cluster-management.io/api to 2337d27c3b7f
- Update open-cluster-management.io/sdk-go to a185f88d7b1b
- Update open-cluster-management.io/addon-framework to 1a0a9be61322
- Update openshift libraries (api, client-go, library-go) to latest commits
  for structured-merge-diff v6 compatibility
- Add Recorder() method to FakeSDKSyncContext with adapter pattern to bridge
  openshift/library-go and SDK event recorder interfaces
- Update vendor directory and regenerate CRDs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Jian Qiu <jqiu@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-26 05:56:58 +00:00
Jian Qiu
eb033993c2 🌱 Use base controller in sdk-go (#1251)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m11s
Post / coverage (push) Failing after 37m30s
Post / images (amd64, addon-manager) (push) Failing after 7m29s
Post / images (amd64, placement) (push) Failing after 6m57s
Post / images (amd64, registration) (push) Failing after 7m5s
Post / images (amd64, registration-operator) (push) Failing after 7m5s
Post / images (amd64, work) (push) Failing after 7m2s
Post / images (arm64, addon-manager) (push) Failing after 7m18s
Post / images (arm64, placement) (push) Failing after 7m7s
Post / images (arm64, registration) (push) Failing after 7m13s
Post / images (arm64, registration-operator) (push) Failing after 7m6s
Post / images (arm64, work) (push) Failing after 7m2s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 45s
* Use base controller in sdk-go

We can leverage contextual logger in base controller.

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix integration test error

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-11-20 07:53:42 +00:00
Wei Liu
74aa03b01c using api auth consts (#1146)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
2025-08-28 07:15:36 +00:00
Wei Liu
ef24cbbab4 support cert auto approve for grpc (#1134)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m35s
Post / coverage (push) Failing after 41m11s
Post / images (amd64, addon-manager) (push) Failing after 8m58s
Post / images (amd64, placement) (push) Failing after 7m57s
Post / images (amd64, registration) (push) Failing after 8m0s
Post / images (amd64, registration-operator) (push) Failing after 7m59s
Post / images (amd64, work) (push) Failing after 7m32s
Post / images (arm64, addon-manager) (push) Failing after 8m3s
Post / images (arm64, placement) (push) Failing after 7m41s
Post / images (arm64, registration) (push) Failing after 7m20s
Post / images (arm64, registration-operator) (push) Failing after 7m41s
Post / images (arm64, work) (push) Failing after 7m42s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 31s
Signed-off-by: Wei Liu <liuweixa@redhat.com>
2025-08-25 07:44:21 +00:00
Jian Qiu
588f82f48b Refactor webhook to use a common webhook option (#1096)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m26s
Post / coverage (push) Failing after 39m1s
Post / images (amd64) (push) Failing after 8m21s
Post / images (arm64) (push) Failing after 7m47s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 47s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-07-29 07:38:59 +00:00
Jian Qiu
a75eec0b7b Add unit test for agent options (#1097)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-07-29 07:27:38 +00:00
Wei Liu
7924226eba grpc server (#1058)
Some checks failed
Post / coverage (push) Failing after 36m50s
Post / images (amd64) (push) Failing after 8m47s
Post / images (arm64) (push) Failing after 8m15s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m8s
Close stale issues and PRs / stale (push) Successful in 50s
Signed-off-by: Wei Liu <liuweixa@redhat.com>
2025-07-09 08:59:10 +00:00
ivanscai
e753bd6e81 add hub QPS/Burst to hub work client,for talking with hub cluster apiserver (#1012)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m7s
Post / coverage (push) Failing after 27m40s
Post / images (amd64) (push) Failing after 3m26s
Post / images (arm64) (push) Failing after 2m55s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 36s
Signed-off-by: caijing <caijing.cai@alibaba-inc.com>
2025-05-28 13:41:55 +00:00
Ben Perry
f13599ffdb Refactor common CEL eval functions into shared pkg (#1003)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m10s
Post / coverage (push) Failing after 30m9s
Post / images (amd64) (push) Failing after 3m38s
Post / images (arm64) (push) Failing after 2m50s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 35s
Signed-off-by: Ben Perry <bhperry94@gmail.com>
2025-05-26 14:36:04 +00:00
Ankit Kurmi
cd8827572e feat: updated golang to v1.23.6 and related k8s.io packages (#870)
Signed-off-by: Ankit152 <ankitkurmi152@gmail.com>
2025-04-09 07:46:27 +00:00
Jian Qiu
241a3eaaa3 Reduce client scope built from driver (#915)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m1s
Post / coverage (push) Failing after 22m36s
Post / images (amd64) (push) Failing after 13m6s
Post / images (arm64) (push) Failing after 2m21s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 13s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2025-03-27 09:44:13 +00:00
jaswalkiranavtar
57c78cd4de Miscellaneous code cleanup (#881)
Some checks are pending
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Post / coverage (push) Waiting to run
Post / images (amd64) (push) Waiting to run
Post / images (arm64) (push) Waiting to run
Post / image manifest (push) Blocked by required conditions
Post / trigger clusteradm e2e (push) Blocked by required conditions
* extract constants and remove permissions

Signed-off-by: Alex <alexchan2988@gmail.com>

* Addressing miscellaneous code cleanup

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

---------

Signed-off-by: Alex <alexchan2988@gmail.com>
Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>
Co-authored-by: Alex <alexchan2988@gmail.com>
2025-03-13 00:45:19 +00:00
Zhiwei Yin
b94d7da6e9 refator gc and move rbac deletion to cluster controller (#831)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2025-02-19 01:47:04 +00:00
alex0chan
0153747acf Made changes for clusteradm accept to create role and policies on hub (#819)
Some checks failed
Post / coverage (push) Failing after 26m56s
Post / images (amd64) (push) Failing after 6m52s
Post / images (arm64) (push) Failing after 6m50s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 54s
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m19s
* Acceping AWS IRSA registraion request

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

* Addressing comments

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

* Addressing comments

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

* Making csr as a default enabled driver if no other driver is explicitly enabled

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

---------

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>
Co-authored-by: “Jeffrey <jeffreywong0417@gmail.com>
Co-authored-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>
2025-02-18 13:14:06 +00:00
Zhiwei Yin
568789fef4 refactor to use common HasFinalizer func (#830)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 2m33s
Post / coverage (push) Failing after 26m11s
Post / images (amd64) (push) Failing after 7m0s
Post / images (arm64) (push) Failing after 6m47s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 28s
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2025-02-13 02:48:46 +00:00
jaswalkiranavtar
f62242d047 Assume prerequisite role on hub if initailize with aws-irsa (#807)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m28s
Post / coverage (push) Failing after 26m43s
Post / images (amd64) (push) Failing after 6m50s
Post / images (arm64) (push) Failing after 6m49s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 35s
* Adding managedcluster identity creator role arn

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

* Addressing review comments

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>

---------

Signed-off-by: Gaurav Jaswal <jaswalkiranavtar@gmail.com>
Co-authored-by: Amrutha <amrutha.hari12@gmail.com>
2025-01-17 16:37:47 +00:00
Jian Qiu
8c1d286b11 Refactor registration (#535)
* Refactor registration

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix integration test

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Refactor cert controller to secret controller

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update health check func

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-07-17 14:14:11 +00:00
Ohki Nozomu
1227b71043 Fix typo: Rename 'CommoOpts' to 'CommonOpts' (#523)
Signed-off-by: ohkinozomu <nozomunoise@gmail.com>
2024-06-17 02:21:10 +00:00
xuezhao
0357cb99e1 Registration-agent supports multiple bootstrapkubeconfigs and switch-hub. (#443)
Signed-off-by: xuezhaojun <zxue@redhat.com>
2024-06-04 13:46:39 +00:00
Jian Zhu
66d4e782ec 🐛 Regenerate the hub kubeconfig secret if the cluster name of the current context changes (#473)
* Regenerate the hub kubeconfig secret if the cluster name of the current context changes

Signed-off-by: zhujian <jiazhu@redhat.com>

* Add an integration test

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2024-05-23 14:31:09 +00:00
Jian Zhu
c749b42ca0 Send available condition events for managed cluster (#450)
* Send available condition events for managed cluster

Signed-off-by: zhujian <jiazhu@redhat.com>

* Send available condition events for managed cluster

Signed-off-by: zhujian <jiazhu@redhat.com>

* Rename event reporting component

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2024-05-06 07:00:36 +00:00
Jian Qiu
3a2250d974 Refactor NewUnstructured method (#418)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-04-11 12:01:07 +00:00
Jian Qiu
c04ab368de Bump api and addon-framework deps (#354)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-01-23 07:40:26 +00:00
Jian Qiu
6cfce8ce24 Revert apply func (#353)
this part dep on library-go so remove from
sdk-go

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-01-22 03:46:46 +00:00
Jian Qiu
bede3edd92 Switch to patcher in sdk-go (#349)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-01-22 02:04:49 +00:00
Jian Qiu
976019dd43 🐛 Requeue for rolling strategy in mwrs (#337)
* Requeue for rolling strategy in mwrs

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Add more integration test for rolling

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2024-01-04 09:55:20 +00:00
Mohamed ElSerngawy
35680c3ca3 Implement ManifestWorkReplicaSet RollOut strategy (#259)
* Implement rollout strategy

Signed-off-by: melserngawy <melserng@redhat.com>

* Update API and new logic

Signed-off-by: melserngawy <melserng@redhat.com>

---------

Signed-off-by: melserngawy <melserng@redhat.com>
2023-11-02 03:08:35 +00:00
Yang Le
9aaa1327fa 🐛 move the rebootstrap logic to registration agent (#267)
Signed-off-by: Yang Le <yangle@redhat.com>
2023-10-18 09:58:06 +00:00
Qing Hao
c8410bfbf1 addon consume rollout helpers (#225)
Signed-off-by: haoqing0110 <qhao@redhat.com>
2023-09-20 04:17:48 +02:00
Yang Le
1f51d8c6bc 🐛 fix the AlreadyExists logic case if the manifest is not cached by Getter when applying a manifest (#275)
Signed-off-by: Yang Le <yangle@redhat.com>
2023-09-11 11:47:48 +02:00
Jian Qiu
88f6f4dd17 Refactor code to start managers with shared informers (#232)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-08-21 00:03:58 -02:30
Nitish Chauhan
6e0937e4d0 🌱 adding contextual logging in registration component (#220)
* contextual logging for registration component

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* removing logger from convertTo & convertFrom

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

---------

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
2023-08-14 23:04:55 -02:30
xuezhaojun
142fd5b247 Add ClusterAnnotations support. (#234)
Signed-off-by: xuezhaojun <zxue@redhat.com>
2023-07-27 04:31:25 +02:00
Jian Qiu
e810520961 🌱 Refactor code to fix lint warning (#218)
* Refactor code to fix lint warning

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* enable lint for testing files

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-07-25 07:12:34 +02:00
Jian Qiu
e22faa4545 🌱 Build a commonoption for all managers (#228)
* Build a commonoption for all managers

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Add unit tests

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-07-25 03:12:35 +02:00
Jian Qiu
f7cd1402e9 run work and registration as a single binary (#201)
* run registratin/work together

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix integration test and lint issue

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update operator to deploy singleton mode

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update deps

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-07-14 04:56:48 +02:00
Jian Zhu
5db224052b 🐛 remove klusterlet finalizer forcely (#214)
* remove klusterlet finalizer forcely

Signed-off-by: zhujian <jiazhu@redhat.com>

* add patch options for patcher

Signed-off-by: zhujian <jiazhu@redhat.com>

* add patch options for all patcher funcs

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2023-07-11 02:45:17 -04:00
Jian Qiu
e4792e4b83 Refactor to use common queue/filter funcs (#197)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-06-28 15:59:19 +02:00
Jian Qiu
4ae644879a 🌱 Refactor cluster permission (#193)
* User lister in permission apply for cluster

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Reduce get call in registration

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-06-26 11:31:40 +02:00
Jian Qiu
53890594c3 🌱 Use patcher in operator to replace previous update (#181)
* Use patcher in operator to replace previous update

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix test error

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Fix permission in csv

Signed-off-by: Jian Qiu <jqiu@redhat.com>

---------

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-06-18 20:43:36 -04:00
Jian Zhu
d3d648283e 🌱 Configure the golangci lint (#180)
* 🌱 Configure the golangci lint

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 Fix lint issues

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2023-06-13 03:51:48 -04:00
Wei Liu
b55881d6d2 expose the spoke informers (#179)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
2023-06-12 23:10:15 -04:00
Jian Zhu
7332a585c0 🌱 add a verify rule for golang files import order (#177)
* 🌱 add a verify rule for golang files import order

This PR uses the [gci tool](https://github.com/daixiang0/gci) to make all go files' import section with a specific order, it will organize import with group with order:
1. standard library modules
2. 3rd party modules
3. modules in OCM org, like the `open-cluster-management.io/api`
4. current project `open-cluster-management.io/ocm` modules

developers can use the `make fmt-imports` to format the import automatically and the `make verify-fmt-imports` to check for any violation.

Signed-off-by: zhujian <jiazhu@redhat.com>

* 🌱 format the go files import

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2023-06-12 10:23:04 -04:00