Skip to content

update k8s 1.25 validation logic - #270

Merged
openshift-merge-robot merged 3 commits into
operator-framework:masterfrom
everettraven:validation/k8s-1.25
Oct 28, 2022
Merged

update k8s 1.25 validation logic#270
openshift-merge-robot merged 3 commits into
operator-framework:masterfrom
everettraven:validation/k8s-1.25

Conversation

@everettraven

@everettraven everettraven commented Oct 26, 2022

Copy link
Copy Markdown
Contributor

Description of the change:

  • Updates validation logic for Kubernetes 1.25 deprecated APIs to also look for deprecated APIs in the following CSV fields:
    • ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.ClusterPermissions[].Rules[]
      • if the resource specified could potentially have a deprecated API create a warning
        • If the resource has been specified in the ClusterServiceVersion.Spec.CustomResourceDefinitions a warning is not raised
    • ClusterServiceVersion.Spec.InstallStrategy.StrategySpec.Permissions[].Rules[]
      • if the resource specified could potentially have a deprecated API create a warning
        • If the resource has been specified in the ClusterServiceVersion.Spec.CustomResourceDefinitions a warning is not raised
    • ClusterServiceVersion.Spec.CustomResourceDefinitions.Owned[].Resources[]
      • if an owned resource is of a deprecated API create an error
    • ClusterServiceVersion.Spec.CustomResourceDefinitions.Owned[].Resources[]
      • if an owned resource is of a deprecated API create an error
  • Updates the test logic and testdata as necessary to verify these changes work as expected

Motivation for the change:

  • Check the CSV fields to see if there are any references to APIs deprecated in Kubernetes 1.25

to look for deprecated k8s APIs in various CSV fields

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@openshift-ci
openshift-ci Bot requested review from njhale and timflannagan October 26, 2022 15:30
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

@jmrodri jmrodri left a comment

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.

/lgtm

Comment thread pkg/validation/internal/removed_apis.go Outdated
for i, desc := range crdDescriptions {
for j, res := range desc.Resources {
resFromKind := fmt.Sprintf("%ss", strings.ToLower(res.Kind))
fmt.Println("XXX resFromKind:", resFromKind)

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.

Suggested change
fmt.Println("XXX resFromKind:", resFromKind)

Comment thread pkg/validation/internal/removed_apis.go Outdated
// Check the Required Resources
crdCheck("Required", csv.Spec.CustomResourceDefinitions.Required)

fmt.Println("XXX resInCsvCrds:", resInCsvCrds)

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.

Suggested change
fmt.Println("XXX resInCsvCrds:", resInCsvCrds)

Comment thread pkg/validation/internal/removed_apis.go Outdated
for j, rule := range perm.Rules {
for _, res := range rule.Resources {
if _, ok := resInCsvCrds[res]; ok {
fmt.Println("XXX resource: ", res, "is in resInCsvCrds map!")

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.

Suggested change
fmt.Println("XXX resource: ", res, "is in resInCsvCrds map!")

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2022
@jmrodri

jmrodri commented Oct 28, 2022

Copy link
Copy Markdown
Member

@everettraven should probably remove the XXX debug logs now.

@everettraven

Copy link
Copy Markdown
Contributor Author

should probably remove the XXX debug logs now.
oops, forgot those haha

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2022
@jmrodri

jmrodri commented Oct 28, 2022

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2022
@jmrodri

jmrodri commented Oct 28, 2022

Copy link
Copy Markdown
Member

/approved

@jmrodri

jmrodri commented Oct 28, 2022

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented Oct 28, 2022

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven, jmrodri

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

The pull request process is described here

Details 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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2022
@openshift-merge-robot
openshift-merge-robot merged commit b611f6c into operator-framework:master Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants