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

build: Update CRDs and k8s dependencies #48

Merged
merged 6 commits into from
May 7, 2021
Merged

Conversation

colunira
Copy link
Contributor

@colunira colunira commented Apr 28, 2021

CRDs in version v1beta1 are deprecated. Update the version to v1 and bump k8s dependencies.

  • Changed rule compare logic: the SelfLink attribute in ObjectMeta is no longer used, switched to UID.

@colunira colunira changed the title Update CRDs and k8s dependencies build: Update CRDs and k8s dependencies Apr 28, 2021
@aeneasr aeneasr requested a review from Demonsthere April 28, 2021 14:47
@Demonsthere
Copy link
Collaborator

Hi there, and thanks for your contribution ;) PR related to ory/k8s#236
Could you also update the version of kind? The current one is installing k8s 1.17.

@@ -1,18 +1,17 @@
module github.com/ory/oathkeeper-maester

go 1.12
go 1.15
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you changed the required go version, please update it also in the CI config otherwise, it won't be able to run

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the advice ❤️
I will update kind, too

@Demonsthere
Copy link
Collaborator

It looks like in the test, here the CM is empty, instead of having 1 item

---
apiVersion: v1
data:
  access-rules.json: |-
    [
      {
        "upstream": {
          "url": "http://abc.def",
          "preserve_host": false
        },
        "id": "test-rule-1.test-namespace",
        "match": {
          "url": "http://gh.ij",
          "methods": [
            "GET",
            "POST"
          ]
        },
        "authenticators": [
          {
            "handler": "anonymous"
          }
        ],
        "authorizer": {
          "handler": "allow"
        },
        "mutators": [
          {
            "handler": "header",
            "config": {
              "headers": {
                "X-Some-Arbitrary-Data": "{{ print .Extra.some.arbitrary.data }}",
                "X-User": "{{ print .Subject }}"
              }
            }
          }
        ]
      },
      {
        "upstream": {
          "url": "http://abcde.fgh",
          "preserve_host": false
        },
        "id": "test-rule-2.test-namespace",
        "match": {
          "url": "http://xyz.com",
          "methods": [
            "POST",
            "PUT"
          ]
        },
        "authenticators": [
          {
            "handler": "oauth2_client_credentials",
            "config": {
              "required_scope": [
                "scope-a",
                "scope-b"
              ]
            }
          },
          {
            "handler": "anonymous"
          }
        ],
        "authorizer": {
          "handler": "keto_engine_acp_ory",
          "config": {
            "required_action": "my:action:1234",
            "required_resource": "my:resource:foobar:foo:1234"
          }
        },
        "mutators": [
          {
            "handler": "id_token",
            "config": {
              "aud": [
                "audience1",
                "audience2"
              ]
            }
          }
        ]
      }
    ]
kind: ConfigMap
metadata:
  creationTimestamp: "2021-05-06T09:00:57Z"
  name: oathkeeper-rules
  namespace: oathkeeper-maester-system
  resourceVersion: "660"
  uid: eda16479-f852-4842-99ab-ed1db77b9554
---
apiVersion: v1
data:
  access-rules.json: '[]'
kind: ConfigMap
metadata:
  creationTimestamp: "2021-05-06T09:00:57Z"
  name: oathkeeper-rules
  namespace: oathkeeper-maester-system
  resourceVersion: "683"
  uid: eda16479-f852-4842-99ab-ed1db77b9554

Copy link
Collaborator

@Demonsthere Demonsthere left a comment

Choose a reason for hiding this comment

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

Nice work! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants