*: add initial code and build scripts - #1
Conversation
|
|
||
| END OF TERMS AND CONDITIONS | ||
|
|
||
| Copyright 2014 Red Hat, Inc. |
There was a problem hiding this comment.
nit: I don't think this section is intended to be replaced (e.g. Kubernetes does not alter it). It's just a template which you should alter when constructing your own boilerplate (which Kubernetes keeps in per-file headers like this). If we don't want per-file headers, we may want the boilerplate statement in a NOTICE (like the installer) or the README.md. Although I'm new to Red Hat, maybe there's a company position on this or precedent that I'm not aware of.
There was a problem hiding this comment.
Huh, I hadn't even noticed that. You're right that the template shouldn't be modified. I'll actually download the license from the web this time.
There was a problem hiding this comment.
@abhinavdahiya I had to rebase the "first" commit (the license). That is why you should always start a repo with an empty commit.
|
|
||
| func init() { | ||
| flag.StringVar(&flags.kubeconfig, "kubeconfig", "", "Kubeconfig file to access a remote cluster. Warning: For testing only, do not use in production.") | ||
| flag.StringVar(&flags.clusterID, "cluster-id", "", "UUID of the cluster that the channel operator is managing, MUST be set") |
There was a problem hiding this comment.
Should be part of a CVO config ?
There was a problem hiding this comment.
Eventually, yes. For this initial commit, I'm going to leave it as-is.
| } | ||
|
|
||
| var ( | ||
| // SchemeBuilder is the scheme builder for MachineConfigPools |
There was a problem hiding this comment.
TODO(later): MachineConfigPools
| ) | ||
|
|
||
| const ( | ||
| ContentTypeGraphV1 = "application/vnd.redhat.cincinnati.graph+json; version=1.0" |
There was a problem hiding this comment.
TODO(later): all exported fields must have a comment https://github.com/golang/go/wiki/CodeReviewComments#doc-comments
| ContentTypeGraphV1 = "application/vnd.redhat.cincinnati.graph+json; version=1.0" | ||
| ) | ||
|
|
||
| type Client struct { |
| Destination int | ||
| } | ||
|
|
||
| func (e *edge) UnmarshalJSON(data []byte) error { |
There was a problem hiding this comment.
Why special unmarshal?
There was a problem hiding this comment.
Because we are going from an array of indices to a struct.
For example, given the following response:
{
nodes: {...},
edges: [[0, 1]]
}
This needs to be unmarshalled into a struct:
{
Origin: 0,
Destination: 1,
}|
|
||
| func ensureOperatorStatusExists(config *rest.Config) func() { | ||
| return func() { | ||
| client, err := clientset.NewForConfig(config) |
There was a problem hiding this comment.
move this out of returned func, wait.Until will repeatedly call ensureOperatorStatusExists. No use of recreating client everytime.
There was a problem hiding this comment.
Is the creation of a client expensive? I left it here so that I didn't have to create a bunch of different clients in the parent function.
There was a problem hiding this comment.
You cannot test this function by using fakeClient
eg. https://github.com/openshift/machine-config-operator/blob/e34eeb6f06a3e290f349c0450361f3dafccf6ba8/pkg/controller/render/controller_test.go#L77-L97
| return | ||
| } | ||
|
|
||
| _, err = client.ApiextensionsV1beta1().CustomResourceDefinitions().Create(&v1beta1.CustomResourceDefinition{ |
There was a problem hiding this comment.
Doesn't handle a case where somebody updates the CRD rather than deleting it.
|
|
||
| func checkForUpdate(config *rest.Config, cc cincinnati.Client) func() { | ||
| return func() { | ||
| payloads, err := cc.GetUpdate("http://localhost:8080/graph", semver.MustParse("1.8.9-tectonic.3"), "fast") |
There was a problem hiding this comment.
TODO(later): remove harded coded logic here.
| } | ||
|
|
||
| func updateStatus(config *rest.Config, payloads []string) error { | ||
| client, err := versioned.NewForConfig(config) |
There was a problem hiding this comment.
same as client in ensureOperatorStatusExists
fixed manifests
```console $ git --no-pager -C ../lightspeed-agentic-operator log --pretty=oneline -1 84a97541c3e01c7a89c96ea0acf1afc663bb5a8f (HEAD -> main, origin/main, origin/HEAD) Merge pull request #1 from harche/wt/api-pr $ cp ../lightspeed-agentic-operator/config/crd/bases/agentic.openshift.io_proposals.yaml install/0000_00_cluster-version-operator_45_lightspeed-crd-proposals.yaml $ cp ../lightspeed-agentic-operator/config/crd/bases/agentic.openshift.io_agents.yaml install/0000_00_cluster-version-operator_46_lightspeed-crd-agents.yaml $ cp ../lightspeed-agentic-operator/config/crd/bases/agentic.openshift.io_llmproviders.yaml install/0000_00_cluster-version-operator_47_lightspeed-crd-llmproviders.yaml $ cp ../lightspeed-agentic-operator/config/crd/bases/agentic.openshift.io_analysisresults.yaml install/0000_00_cluster-version-operator_47_lightspeed-crd-analysisresults.yaml $ rm install/0000_00_cluster-version-operator_47_lightspeed-crd-workflows.yaml ```
pkg/readiness: Fix etcd health check for HyperShift hosted clusters
- Skip manifest cleanup if disableConsolePlugin fails, to avoid removing backing resources while the plugin is still registered in the console config (wking review openshift#1) - Wait for at least one available replica before enabling the plugin in the console config, so the console doesn't try to load a plugin whose backing pod isn't ready yet (wking review openshift#2) - consolePluginEnsured remains a TP-acceptable volatile cache; active reconciliation of owned resources is deferred to pre-GA (wking openshift#3) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No description provided.