Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use informers for CVO #7

Merged
merged 5 commits into from Aug 15, 2018

Conversation

abhinavdahiya
Copy link
Contributor

@abhinavdahiya abhinavdahiya commented Aug 14, 2018

Uses informer pattern for CVO
/assign @crawford

cmd/start.go Outdated
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v", version.Version)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use version.String instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 done

@abhinavdahiya abhinavdahiya reopened this Aug 14, 2018
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 14, 2018
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 14, 2018
@abhinavdahiya
Copy link
Contributor Author

/test all

@smarterclayton
Copy link
Contributor

/refresh

@abhinavdahiya
Copy link
Contributor Author

/test all

@abhinavdahiya
Copy link
Contributor Author

/refresh

@abhinavdahiya
Copy link
Contributor Author

/skip

@crawford
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: abhinavdahiya, crawford
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

If they are not already assigned, you can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 7a157fb into openshift:master Aug 15, 2018
@abhinavdahiya abhinavdahiya deleted the informers branch June 7, 2019 06:00
wking added a commit to wking/cluster-version-operator that referenced this pull request Jan 16, 2020
… in required

We claimed:

  if we have no required, then we don't care what someone else has set

since this code landed in d9f6718 (lib: add lib for applying
objects, 2018-08-14, openshift#7).  But we do care in situations like [1],
where a 4.3 -> 4.2 downgrade leaves 4.3 readiness probes in place for
a 4.2 operator which has no /readyz.

With this commit we still have a few other types where we claim to not
care:

  $ git grep -hB1 'someone else has set' | grep func
  func ensureSecurityContextPtr(modified *bool, existing **corev1.SecurityContext, required *corev1.SecurityContext) {
  func ensureCapabilitiesPtr(modified *bool, existing **corev1.Capabilities, required *corev1.Capabilities) {
  func ensureAffinityPtr(modified *bool, existing **corev1.Affinity, required *corev1.Affinity) {
  func ensurePodSecurityContextPtr(modified *bool, existing **corev1.PodSecurityContext, required *corev1.PodSecurityContext) {
  func ensureSELinuxOptionsPtr(modified *bool, existing **corev1.SELinuxOptions, required *corev1.SELinuxOptions) {
  func setBoolPtr(modified *bool, existing **bool, required *bool) {
  func setInt64Ptr(modified *bool, existing **int64, required *int64) {

but I'm leaving them alone until we have a clearer picture about
whether we care about those specific properties or not.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1791863#c1
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cluster-version-operator that referenced this pull request Jan 17, 2020
… in required

We claimed:

  if we have no required, then we don't care what someone else has set

since this code landed in d9f6718 (lib: add lib for applying
objects, 2018-08-14, openshift#7).  But we do care in situations like [1],
where a 4.3 -> 4.2 downgrade leaves 4.3 readiness probes in place for
a 4.2 operator which has no /readyz.

With this commit we still have a few other types where we claim to not
care:

  $ git grep -hB1 'someone else has set' | grep func
  func ensureSecurityContextPtr(modified *bool, existing **corev1.SecurityContext, required *corev1.SecurityContext) {
  func ensureCapabilitiesPtr(modified *bool, existing **corev1.Capabilities, required *corev1.Capabilities) {
  func ensureAffinityPtr(modified *bool, existing **corev1.Affinity, required *corev1.Affinity) {
  func ensurePodSecurityContextPtr(modified *bool, existing **corev1.PodSecurityContext, required *corev1.PodSecurityContext) {
  func ensureSELinuxOptionsPtr(modified *bool, existing **corev1.SELinuxOptions, required *corev1.SELinuxOptions) {
  func setBoolPtr(modified *bool, existing **bool, required *bool) {
  func setInt64Ptr(modified *bool, existing **int64, required *int64) {

but I'm leaving them alone until we have a clearer picture about
whether we care about those specific properties or not.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1791863#c1
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cluster-version-operator that referenced this pull request Jan 17, 2020
… in required

We claimed:

  if we have no required, then we don't care what someone else has set

since this code landed in d9f6718 (lib: add lib for applying
objects, 2018-08-14, openshift#7).  But we do care in situations like [1],
where a 4.3 -> 4.2 downgrade leaves 4.3 readiness probes in place for
a 4.2 operator which has no /readyz.

With this commit we still have a few other types where we claim to not
care:

  $ git grep -hB1 'someone else has set' | grep func
  func ensureSecurityContextPtr(modified *bool, existing **corev1.SecurityContext, required *corev1.SecurityContext) {
  func ensureCapabilitiesPtr(modified *bool, existing **corev1.Capabilities, required *corev1.Capabilities) {
  func ensureAffinityPtr(modified *bool, existing **corev1.Affinity, required *corev1.Affinity) {
  func ensurePodSecurityContextPtr(modified *bool, existing **corev1.PodSecurityContext, required *corev1.PodSecurityContext) {
  func ensureSELinuxOptionsPtr(modified *bool, existing **corev1.SELinuxOptions, required *corev1.SELinuxOptions) {
  func setBoolPtr(modified *bool, existing **bool, required *bool) {
  func setInt64Ptr(modified *bool, existing **int64, required *int64) {

but I'm leaving them alone until we have a clearer picture about
whether we care about those specific properties or not.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1791863#c1
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cluster-version-operator that referenced this pull request Jan 17, 2020
… in required

We claimed:

  if we have no required, then we don't care what someone else has set

since this code landed in d9f6718 (lib: add lib for applying
objects, 2018-08-14, openshift#7).  But we do care in situations like [1],
where a 4.3 -> 4.2 downgrade leaves 4.3 readiness probes in place for
a 4.2 operator which has no /readyz.

With this commit we still have a few other types where we claim to not
care:

  $ git grep -hB1 'someone else has set' | grep func
  func ensureSecurityContextPtr(modified *bool, existing **corev1.SecurityContext, required *corev1.SecurityContext) {
  func ensureCapabilitiesPtr(modified *bool, existing **corev1.Capabilities, required *corev1.Capabilities) {
  func ensureAffinityPtr(modified *bool, existing **corev1.Affinity, required *corev1.Affinity) {
  func ensurePodSecurityContextPtr(modified *bool, existing **corev1.PodSecurityContext, required *corev1.PodSecurityContext) {
  func ensureSELinuxOptionsPtr(modified *bool, existing **corev1.SELinuxOptions, required *corev1.SELinuxOptions) {
  func setBoolPtr(modified *bool, existing **bool, required *bool) {
  func setInt64Ptr(modified *bool, existing **int64, required *int64) {

but I'm leaving them alone until we have a clearer picture about
whether we care about those specific properties or not.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1791863#c1
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cluster-version-operator that referenced this pull request Feb 24, 2020
… in required

We claimed:

  if we have no required, then we don't care what someone else has set

since this code landed in d9f6718 (lib: add lib for applying
objects, 2018-08-14, openshift#7).  But we do care in situations like [1],
where a 4.3 -> 4.2 downgrade leaves 4.3 readiness probes in place for
a 4.2 operator which has no /readyz.

With this commit we still have a few other types where we claim to not
care:

  $ git grep -hB1 'someone else has set' | grep func
  func ensureSecurityContextPtr(modified *bool, existing **corev1.SecurityContext, required *corev1.SecurityContext) {
  func ensureCapabilitiesPtr(modified *bool, existing **corev1.Capabilities, required *corev1.Capabilities) {
  func ensureAffinityPtr(modified *bool, existing **corev1.Affinity, required *corev1.Affinity) {
  func ensurePodSecurityContextPtr(modified *bool, existing **corev1.PodSecurityContext, required *corev1.PodSecurityContext) {
  func ensureSELinuxOptionsPtr(modified *bool, existing **corev1.SELinuxOptions, required *corev1.SELinuxOptions) {
  func setBoolPtr(modified *bool, existing **bool, required *bool) {
  func setInt64Ptr(modified *bool, existing **int64, required *int64) {

but I'm leaving them alone until we have a clearer picture about
whether we care about those specific properties or not.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1791863#c1
wking added a commit to wking/cluster-version-operator that referenced this pull request Aug 5, 2020
This seems to have been copy-pasted from the machine-config operator
in 6c8f725 (cvo: refactor to informers, 2018-08-14, openshift#7) and then
from there over to the auto-update package with ad4bd6c (pkg: add
autoupdate ctrl, 2018-08-22, openshift#11).  Update to generic wording that is
less likely to go stale.
wking added a commit to wking/cluster-version-operator that referenced this pull request Aug 5, 2020
This seems to have been copy-pasted from the machine-config operator
in 6c8f725 (cvo: refactor to informers, 2018-08-14, openshift#7) and then
from there over to the auto-update package with ad4bd6c (pkg: add
autoupdate ctrl, 2018-08-22, openshift#11).  Update to generic wording that is
less likely to go stale.
wking added a commit to wking/cluster-version-operator that referenced this pull request Aug 5, 2020
This seems to have been copy-pasted from the machine-config operator
in 6c8f725 (cvo: refactor to informers, 2018-08-14, openshift#7) and then
from there over to the auto-update package with ad4bd6c (pkg: add
autoupdate ctrl, 2018-08-22, openshift#11).  Update to generic wording that is
less likely to go stale.
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Sep 14, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cluster-version-operator that referenced this pull request Sep 16, 2021
Since this package was created in d9f6718 (lib: add lib for
applying objects, 2018-08-14, openshift#7), the volume(mount) merge logic has
required manifest entries to exist, but has allowed in-cluster entries
to persist without removal.  That hasn't been a problem until [1]:

1. In 4.3, the autoscaler asked for a ca-cert volume mount, based on
   the cluster-autoscaler-operator-ca config map.
2. In 4.4, the autoscaler dropped those manifest entries [2].
3. In 4.9, the autoscaler asked the CVO to remove the config map [3].

That lead some born-in 4.3 clusters to have crashlooping autoscalers,
because the mount attempts kept failing on the missing config map.

We couldn't think of a plausible reason why cluster admins would want
to inject additional volume mounts in a CVO-managed pod configuration,
so this commit removes that ability and begins clearing away any
volume(mount) configuration that is not present in the reconciling
manifest.  Cluster administrators who do need to add additional mounts
in an emergency are free to use ClusterVersion's spec.overrides to
take control of a particular CVO-managed resource.

This joins a series of similar previous tightenings, including
02bb9ba (lib/resourcemerge/core: Clear env and envFrom if unset in
manifest, 2021-04-20, openshift#549) and ca299b8 (lib/resourcemerge: remove
ports which are no longer required, 2020-02-13, openshift#322).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2002834
[2]: openshift/cluster-autoscaler-operator@f08589d#diff-547486373183980619528df695869ed32b80c18383bc16b57a5ee931bf0edd39L89
[3]: openshift/cluster-autoscaler-operator@9a7b3be#diff-d0cf785e044c611986a4d9bdd65bb373c86f9eb1c97bd3f105062184342a872dR4
wking added a commit to wking/cluster-version-operator that referenced this pull request Jul 25, 2023
This is from 9cf86f3 (cmd: update cmd for informers, 2018-08-14, openshift#7).
I'm not completely sure what it was about, but I expect it was a
copy/paste error referencing a MachineConfig controller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. 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.

None yet

8 participants