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

feat: support admin/config/set for minioJob #2054

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Mar 29, 2024

feat: support admin/config/set for minioJob

mc admin config set ALIAS/ audit_webhook:IDENTIFIER  \
   endpoint="https://webhook-1.example.net"          \
   auth_token="TOKEN"                                \
   client_cert="cert.pem"                            \
   client_key="cert.key"

How to test:
1.deploy operator with envOPERATOR_STS_ENABLED = on
2.deploy tenant
3.deploy minioJob

apiVersion: v1
kind: ServiceAccount
metadata:
  name: mc-job-sa
---
apiVersion: sts.min.io/v1alpha1
kind: PolicyBinding
metadata:
  name: mc-job-bingding
spec:
  application:
    serviceaccount: mc-job-sa
  policies:
    - consoleAdmin
---
apiVersion: job.min.io/v1alpha1
kind: MinIOJob
metadata:
  name: minio-test-job
spec:
  serviceAccountName: mc-job-sa
  tenant:
    name: mytest-minio
  commands:
    - op: admin/config/set
      args:
        webhookName: "webhook1"
        endpoint:    "endpoint1"
        auth_token:  "token1"
        client_cert: "certContent"
        client_key:  "keyContent"

feat: support admin/config/set for minioJob
@jiuker jiuker force-pushed the feat_support_admin_config_set branch from 2a06911 to 5bbaaa8 Compare March 29, 2024 08:23
lint
lint
@shtripat
Copy link
Contributor

shtripat commented Apr 1, 2024

Is it like we always allow setting audit_webhook only? How about setting notify_webhook and lambda_webhook configs? Should we allow setting type as well in CR?

@jiuker
Copy link
Contributor Author

jiuker commented Apr 1, 2024

Is it like we always allow setting audit_webhook only? How about setting notify_webhook and lambda_webhook configs? Should we allow setting type as well in CR?

That's ok. You can set webhookName like notify_webhook:xxx or lambda_webhook:yyyy @shtripat

@shtripat
Copy link
Contributor

shtripat commented Apr 1, 2024

While verification after applying the job CR, I see below error

$ kubectl get miniojobs.job.min.io -oyaml | yq '.items[0].status' 
message: Get tenant tenant-ns/tenant1 error:tenants.minio.min.io "tenant1" not found
phase: Error

whereas tenant is created and initialized fine

$ kubectl get tenants.minio.min.io -A 
NAMESPACE   NAME      STATE         AGE
tenant-ns   tenant1   Initialized   5m49s

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

Verified. Works as expected. A minor one.

pkg/utils/miniojob/minioJob.go Show resolved Hide resolved
@jiuker jiuker requested a review from shtripat April 2, 2024 07:23
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

lgtm

@cniackz cniackz merged commit 524aefa into minio:master Apr 3, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants