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

Fix #474: Svc Annotations created but not updated #492

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

hoyhbx
Copy link
Contributor

@hoyhbx hoyhbx commented Aug 1, 2022

Change log description

Purpose of the change

Fix #474, now service annotations are not only created but also updated.

What the code does

We added one line of code in the function to update annotations.

curr.SetAnnotations(next.GetAnnotations())

How to verify it

  1. Build the image and deploy the operator

  2. Deploy a zookeeper instance with no annotations specified

    apiVersion: zookeeper.pravega.io/v1beta1
    kind: ZookeeperCluster
    metadata:
      name: zookeeper
    spec:
      replicas: 3
  3. Execute kubectl get svc/zookeeper-headless -o yaml and observe that this service does not have any annotations.

    apiVersion: v1
    kind: Service
    metadata:
      creationTimestamp: "2022-08-01T21:56:06Z"
      labels:
        app: zookeeper
        headless: "true"
        owner-rv: "1474"
        release: zookeeper
      name: zookeeper-headless
      namespace: default
      ownerReferences:
      - apiVersion: zookeeper.pravega.io/v1beta1
    ...
  4. Now, update this zookeeper instance by adding domainName: hgvkbmxwtg to our CR.

    apiVersion: zookeeper.pravega.io/v1beta1
    kind: ZookeeperCluster
    metadata:
      name: zookeeper
    spec:
      domainName: hgvkbmxwtg
      replicas: 3
  5. Execute kubectl get sec/zookeeper-headless -o yaml and observe that this service now has the expected annotation.

    $ kubectl get svc/zookeeper-headless -o yaml
    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        external-dns.alpha.kubernetes.io/hostname: zookeeper-headless.hgvkbmxwtg.
      creationTimestamp: "2022-08-01T21:56:06Z"
      labels:
        app: zookeeper
        headless: "true"
        owner-rv: "1474"
        release: zookeeper
      name: zookeeper-headless
      namespace: default
      ownerReferences:
      - apiVersion: zookeeper.pravega.io/v1beta1
    ...

@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #492 (fa3e23b) into master (2403ac5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #492   +/-   ##
=======================================
  Coverage   85.04%   85.05%           
=======================================
  Files          12       12           
  Lines        1605     1606    +1     
=======================================
+ Hits         1365     1366    +1     
  Misses        155      155           
  Partials       85       85           
Impacted Files Coverage Δ
pkg/zk/synchronizers.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2403ac5...fa3e23b. Read the comment docs.

Copy link
Contributor

@anishakj anishakj left a comment

Choose a reason for hiding this comment

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

LGTM

@anishakj anishakj merged commit ed16dab into pravega:master Aug 12, 2022
mmoscher pushed a commit to mmoscher/zookeeper-operator that referenced this pull request Oct 12, 2022
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.

[BUG] Annotation field in zookeeper headless service does not update
2 participants