Skip to content

*: add initial code and build scripts - #1

Merged
crawford merged 5 commits into
openshift:masterfrom
crawford:initial
Jul 31, 2018
Merged

*: add initial code and build scripts#1
crawford merged 5 commits into
openshift:masterfrom
crawford:initial

Conversation

@crawford

Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 31, 2018
Comment thread LICENSE Outdated

END OF TERMS AND CONDITIONS

Copyright 2014 Red Hat, Inc.

@wking wking Jul 31, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhinavdahiya I had to rebase the "first" commit (the license). That is why you should always start a repo with an empty commit.

Comment thread cmd/main.go

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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be part of a CVO config ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, yes. For this initial commit, I'm going to leave it as-is.

}

var (
// SchemeBuilder is the scheme builder for MachineConfigPools

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO(later): MachineConfigPools

)

const (
ContentTypeGraphV1 = "application/vnd.redhat.cincinnati.graph+json; version=1.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Destination int
}

func (e *edge) UnmarshalJSON(data []byte) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why special unmarshal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
}

Comment thread pkg/cvo/cvo.go Outdated

func ensureOperatorStatusExists(config *rest.Config) func() {
return func() {
client, err := clientset.NewForConfig(config)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this out of returned func, wait.Until will repeatedly call ensureOperatorStatusExists. No use of recreating client everytime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pkg/cvo/cvo.go Outdated
return
}

_, err = client.ApiextensionsV1beta1().CustomResourceDefinitions().Create(&v1beta1.CustomResourceDefinition{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't handle a case where somebody updates the CRD rather than deleting it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow.

Comment thread pkg/cvo/cvo.go Outdated

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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO(later): remove harded coded logic here.

Comment thread pkg/cvo/cvo.go Outdated
}

func updateStatus(config *rest.Config, payloads []string) error {
client, err := versioned.NewForConfig(config)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as client in ensureOperatorStatusExists

@crawford
crawford merged commit 9038eeb into openshift:master Jul 31, 2018
@crawford
crawford deleted the initial branch July 31, 2018 18:22
openshift-merge-robot pushed a commit that referenced this pull request May 21, 2019
openshift-merge-bot Bot pushed a commit that referenced this pull request May 13, 2026
```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
```
openshift-merge-bot Bot pushed a commit that referenced this pull request Jun 26, 2026
pkg/readiness: Fix etcd health check for HyperShift hosted clusters
jhadvig added a commit to jhadvig/cluster-version-operator that referenced this pull request Jul 21, 2026
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants