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

add customizations for source.toolkit.fluxcd.io/v1beta2/HelmRepository #3483

Closed
wants to merge 1 commit into from

Conversation

yike21
Copy link
Member

@yike21 yike21 commented Apr 29, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Add third-party resources source.toolkit.fluxcd.io/v1beta2/HelmRepository into Resource Interpreter framework.

Which issue(s) this PR fixes:
Part of #3331

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
NONE


@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 29, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign poor12 after the PR has been reviewed.
You can assign the PR to them by writing /assign @poor12 in a comment when ready.

The full list of commands accepted by this bot can be found 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

@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2023
@yike21
Copy link
Member Author

yike21 commented Apr 29, 2023

The test report baset on karmadactl interpret is below:

### Check the customizations in file
$ karmadactl interpret -f customizations.yaml --check
I0429 17:44:16.088770 2883402 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:16.088934 2883402 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:16.099276 2883402 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:16.099404 2883402 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
-----------------------------------
SOURCE: declarative-configuration-helmrepository
TARGET: source.toolkit.fluxcd.io/v1beta2 HelmRepository   
RULERS:
    Retain:                                               PASS
    InterpretReplica:                                     UNSET
    ReviseReplica:                                        UNSET
    InterpretStatus:                                      PASS
    AggregateStatus:                                      PASS
    InterpretHealth:                                      PASS
    InterpretDependency:                                  PASS

### Execute the retention rule
$ karmadactl interpret -f customizations.yaml --operation retain --desired-file testdata/desired-helmrepository.yaml --observed-file testdata/observed-helmrepository.yaml 
I0429 17:44:41.368713 2883747 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:41.368899 2883747 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:41.380146 2883747 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:44:41.380631 2883747 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] retained:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
    name: podinfo
    namespace: test-helmrepository
spec:
    interval: 5m0s
    secretRef:
        name: fake-secret
    suspend: true
    url: https://stefanprodan.github.io/podinfo

### Execute the statusReflection rule
$ karmadactl interpret -f customizations.yaml --operation interpretStatus --observed-file testdata/observed-helmrepository.yaml 
I0429 17:45:07.996345 2884147 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:07.996593 2884147 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:08.016714 2884147 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:08.016863 2884147 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] status:
artifact:
    digest: sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69
    lastUpdateTime: "2023-04-29T09:30:31Z"
    path: helmrepository/test-helmrepository/sample/index-61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69.yaml
    revision: sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69
    size: 42012
    url: http://source-controller.flux-system.svc.cluster.local./helmrepository/test-helmrepository/sample/index-61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69.yaml
conditions:
    - lastTransitionTime: "2023-04-29T09:30:31Z"
      message: 'stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
      observedGeneration: 1
      reason: Succeeded
      status: "True"
      type: Ready
    - lastTransitionTime: "2023-04-29T09:30:31Z"
      message: 'stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
      observedGeneration: 1
      reason: Succeeded
      status: "True"
      type: ArtifactInStorage
url: http://source-controller.flux-system.svc.cluster.local./helmrepository/test-helmrepository/sample/index.yaml

### Execute the healthInterpretation rule
$ karmadactl interpret -f customizations.yaml --operation interpretHealth --observed-file testdata/observed-helmrepository.yaml 
I0429 17:45:40.149303 2884580 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:40.149463 2884580 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:40.159486 2884580 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:45:40.159588 2884580 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] healthy:
true

### Execute the dependencyInterpretation rule
$ karmadactl interpret -f customizations.yaml --operation interpretDependency --observed-file testdata/observed-helmrepository.yaml 
I0429 17:46:26.623746 2885176 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:26.624303 2885176 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:26.648522 2885176 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:26.648911 2885176 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] dependencies:
- apiVersion: v1
  kind: Secret
  name: fake-secret
  namespace: test-helmrepository

### Execute the statusAggregation rule
$ karmadactl interpret -f customizations.yaml --operation aggregateStatus --observed-file testdata/observed-helmrepository.yaml --status-file testdata/status-file.yaml 
I0429 17:46:53.092388 2885577 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:53.092530 2885577 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:53.099549 2885577 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0429 17:46:53.099670 2885577 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] aggregatedStatus:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
    name: podinfo
    namespace: test-helmrepository
spec:
    interval: 5m0s
    provider: generic
    secretRef:
        name: fake-secret
    suspend: true
    timeout: 60s
    url: https://stefanprodan.github.io/podinfo
status:
    artifact:
        digest: sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69
        lastUpdateTime: "2023-04-29T09:30:33Z"
        path: helmrepository/test-helmrepository/sample/index-61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69.yaml
        revision: sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69
        size: 42012
        url: http://source-controller.flux-system.svc.cluster.local./helmrepository/test-helmrepository/sample/index-61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69.yaml
    conditions:
        - lastTransitionTime: "2023-04-29T09:30:31Z"
          message: 'member1: stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: Ready
        - lastTransitionTime: "2023-04-29T09:30:31Z"
          message: 'member1: stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: ArtifactInStorage
        - lastTransitionTime: "2023-04-29T09:30:33Z"
          message: 'member3: stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: Ready
        - lastTransitionTime: "2023-04-29T09:30:33Z"
          message: 'member3: stored artifact: revision ''sha256:61f94c20ee9417f222c3d30672724473ae50d406c8c097d80a8a6263c1384f69'''
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: ArtifactInStorage
    lastHandledReconcileAt: ""
    url: http://source-controller.flux-system.svc.cluster.local./helmrepository/test-helmrepository/sample/index.yaml

@yike21 yike21 closed this Apr 29, 2023
@yike21 yike21 deleted the bundle-flux-HelmRepository branch April 29, 2023 10:05
@yike21 yike21 restored the bundle-flux-HelmRepository branch April 29, 2023 10:06
@yike21 yike21 deleted the bundle-flux-HelmRepository branch April 29, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants