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

[Release 1.3] Change the FeatureGates implemantation (#1060) #1062

Merged
merged 2 commits into from
Jan 18, 2021

Conversation

nunnatsa
Copy link
Collaborator

Change the FeatureGates implemantation to be strict and to add documentation to the CR for each feature gate.

The previose implementation used a map[string]bool to store the feature gates. That way, it was impossible to add documentation for each feature gate.

This PR changes the implementation so the feature gates are now stored in a struct, as a pointer to boolean (to keep them optional). The result is a documentable feature gates as well as strict naming of the feature gates, because their names are not just astring but a field name.

Since HotplugVolumes is not a valid json or yaml tag name (starts with upper case), the gate name was changed to hotplugVolumes (starts with lower case)

As part of this change, the HyperConverged CRD contains the documentation for the hotplugVolumes feature gate, that can be read directly from the CRD, or by calling kubectl explain:

$ kubectl explain HyperConverged.spec.featureGates
KIND:     HyperConverged
VERSION:  hco.kubevirt.io/v1beta1

RESOURCE: featureGates <Object>

DESCRIPTION:
     featureGates HyperConvergedFeatureGates contains a list of feature enabler
     flags. Setting a flag to `true` will enable the feature. Setting `false` or
     removing the feature gate, disables the feature.

FIELDS:
   hotplugVolumes	<boolean>
     Allow attaching a data volume to a running VMI; type is boolean; default is
     false

In addition, this PR adds feature gates documentation to the docs/cluster-configuration.md file with the following usage example:

apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
  name: kubevirt-hyperconverged
spec:
  infra: {}
  workloads: {}
  featureGates:
    hotplugVolumes: true

Signed-off-by: Nahshon Unna-Tsameret nunnatsa@redhat.com

Release note:

Added CRD documentation to the hotplugVolumes feature gate
Added Feature gates documentation to the cluster-configuration.md document
Change HotplugVolumes to hotplugVolumes

nunnatsa and others added 2 commits January 18, 2021 11:35
* Change the FeatureGates implemantation

Change the FeatureGates implemantation to be strict and to add documentation to the CR for each feature gate

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* Fix code-review comments

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* Fix code-review comments

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* Fix code-review comments

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* modify HotplugVolumes casing to hotplugVolumes

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

(cherry picked from commit ead55cf)
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
Change the FeatureGates implemantation to be strict and to add documentation to the CR for each feature gate.

The previose implementation used a `map[string]bool` to store the feature gates. That way, it was impossible to add documentation for each feature gate.

This PR changes the implementation so the feature gates are now stored in a struct, as a pointer to boolean (to keep them optional). The result is a documentable feature gates as well as strict naming of the feature gates, because their names are not just astring but a field name.

Since `HotplugVolumes` is not a valid json or yaml tag name (starts with upper case), the gate name was changed to `hotplugVolumes` (starts with lower case)

As part of this change, the HyperConverged CRD contains the documentation for the `hotplugVolumes` feature gate, that can be read directly from the CRD, or by calling `kubectl explain`:
```
$ kubectl explain HyperConverged.spec.featureGates
KIND:     HyperConverged
VERSION:  hco.kubevirt.io/v1beta1

RESOURCE: featureGates <Object>

DESCRIPTION:
     featureGates HyperConvergedFeatureGates contains a list of feature enabler
     flags. Setting a flag to `true` will enable the feature. Setting `false` or
     removing the feature gate, disables the feature.

FIELDS:
   hotplugVolumes	<boolean>
     Allow attaching a data volume to a running VMI; type is boolean; default is
     false
```

In addition, this PR adds feature gates documentation to the `docs/cluster-configuration.md` file with the following usage example:

```yaml
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
  name: kubevirt-hyperconverged
spec:
  infra: {}
  workloads: {}
  featureGates:
    hotplugVolumes: true
```

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

**Release note**:
```release-note
Added CRD documentation to the hotplugVolumes feature gate
Added Feature gates documentation to the cluster-configuration.md document
Change HotplugVolumes to hotplugVolumes
```

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XL labels Jan 18, 2021
@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2021

hco-e2e-upgrade-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-aws

In response to this:

hco-e2e-upgrade-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nunnatsa
Copy link
Collaborator Author

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2021

hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link

openshift-ci bot commented Jan 18, 2021

@nunnatsa: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/hco-e2e-upgrade-aws 2365a59 link /test hco-e2e-upgrade-aws
ci/prow/hco-e2e-image-index-gcp 2365a59 link /test hco-e2e-image-index-gcp

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2021
@tiraboschi
Copy link
Member

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiraboschi

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

The pull request process is described 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2021
@nunnatsa
Copy link
Collaborator Author

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 18, 2021

hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot kubevirt-bot merged commit 804d066 into kubevirt:release-1.3 Jan 18, 2021
@nunnatsa nunnatsa deleted the release-1.3 branch January 18, 2021 14:10
nunnatsa added a commit to nunnatsa/hyperconverged-cluster-operator that referenced this pull request Jan 18, 2021
As the code of the webhook and the operator were changed for 1.3.0 in kubevirt#1062, a new images are required.

This PR changes the image digests for these two images to match the latest version for 1.3.0

In addition, this PR also fir the sanity test to run in the `release-1.3` branch.

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Jan 18, 2021
As the code of the webhook and the operator were changed for 1.3.0 in #1062, a new images are required.

This PR changes the image digests for these two images to match the latest version for 1.3.0

In addition, this PR also fir the sanity test to run in the `release-1.3` branch.

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants