Skip to content

Commit

Permalink
Revert "api: Add config option for vm-console-proxy, deprecate featur…
Browse files Browse the repository at this point in the history
…e gate"

This reverts commit 76ae5fb.

The change should not be in the v0.21 version, but in v0.22.

Signed-off-by: Andrej Krejcir <[email protected]>
  • Loading branch information
akrejcir committed Aug 19, 2024
1 parent b30c062 commit a3b9811
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 85 deletions.
10 changes: 0 additions & 10 deletions api/v1beta2/ssp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ type SSPSpec struct {
// TLSSecurityProfile is a configuration for the TLS.
TLSSecurityProfile *ocpv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`

// TokenGenerationService configures the service for generating tokens to access VNC for a VM.
TokenGenerationService *TokenGenerationService `json:"tokenGenerationService,omitempty"`

// CommonInstancetypes is the configuration of the common-instancetypes operand
//
// Deprecated: This functionality will be removed in a future release.
Expand Down Expand Up @@ -119,8 +116,6 @@ type FeatureGates struct {
// Deprecated: This field is ignored.
DeployTektonTaskResources bool `json:"deployTektonTaskResources,omitempty"`

// +kubebuilder:deprecatedversion:warning="use the .spec.tokenGenerationService to enable vm-console-proxy"
// Deprecated: This field is ignored.
DeployVmConsoleProxy bool `json:"deployVmConsoleProxy,omitempty"`

// Enables deployment of the common-instancetypes bundles, defaults to true.
Expand All @@ -143,11 +138,6 @@ func (t *DataImportCronTemplate) AsDataImportCron() cdiv1beta1.DataImportCron {
}
}

// TokenGenerationService configures the service for generating tokens to access VNC for a VM.
type TokenGenerationService struct {
Enabled bool `json:"enabled,omitempty"`
}

// SSPStatus defines the observed state of SSP
type SSPStatus struct {
lifecycleapi.Status `json:",inline"`
Expand Down
20 changes: 0 additions & 20 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions config/crd/bases/ssp.kubevirt.io_ssps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4194,7 +4194,6 @@ spec:
description: 'Deprecated: This field is ignored.'
type: boolean
deployVmConsoleProxy:
description: 'Deprecated: This field is ignored.'
type: boolean
type: object
tektonPipelines:
Expand Down Expand Up @@ -5479,13 +5478,6 @@ spec:
- Custom
type: string
type: object
tokenGenerationService:
description: TokenGenerationService configures the service for generating
tokens to access VNC for a VM.
properties:
enabled:
type: boolean
type: object
required:
- commonTemplates
type: object
Expand Down
8 changes: 0 additions & 8 deletions data/crd/ssp.kubevirt.io_ssps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4196,7 +4196,6 @@ spec:
description: 'Deprecated: This field is ignored.'
type: boolean
deployVmConsoleProxy:
description: 'Deprecated: This field is ignored.'
type: boolean
type: object
tektonPipelines:
Expand Down Expand Up @@ -5481,13 +5480,6 @@ spec:
- Custom
type: string
type: object
tokenGenerationService:
description: TokenGenerationService configures the service for generating
tokens to access VNC for a VM.
properties:
enabled:
type: boolean
type: object
required:
- commonTemplates
type: object
Expand Down
2 changes: 1 addition & 1 deletion internal/operands/vm-console-proxy/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (v *vmConsoleProxy) WatchClusterTypes() []operands.WatchType {
}

func (v *vmConsoleProxy) Reconcile(request *common.Request) ([]common.ReconcileResult, error) {
if request.Instance.Spec.TokenGenerationService == nil || !request.Instance.Spec.TokenGenerationService.Enabled {
if request.Instance.Spec.FeatureGates == nil || !request.Instance.Spec.FeatureGates.DeployVmConsoleProxy {
cleanupResults, err := v.Cleanup(request)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions internal/operands/vm-console-proxy/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ var _ = Describe("VM Console Proxy Operand", func() {
}
})

It("should delete resources when TokenGenerationService is disabled", func() {
It("should delete resources when feature gate was disabled", func() {
_, err := operand.Reconcile(&request)
Expect(err).ToNot(HaveOccurred())

Expand All @@ -264,7 +264,7 @@ var _ = Describe("VM Console Proxy Operand", func() {
ExpectResourceExists(bundle.Deployment, request)
ExpectResourceExists(bundle.ApiService, request)

request.Instance.Spec.TokenGenerationService.Enabled = false
request.Instance.Spec.FeatureGates.DeployVmConsoleProxy = false

_, err = operand.Reconcile(&request)
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -310,8 +310,8 @@ func getMockedRequest() common.Request {
Namespace: namespace,
},
Spec: ssp.SSPSpec{
TokenGenerationService: &ssp.TokenGenerationService{
Enabled: true,
FeatureGates: &ssp.FeatureGates{
DeployVmConsoleProxy: true,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func (s *newSspStrategy) Init() {
CommonTemplates: sspv1beta2.CommonTemplates{
Namespace: s.GetTemplatesNamespace(),
},
TokenGenerationService: &sspv1beta2.TokenGenerationService{
Enabled: true,
FeatureGates: &sspv1beta2.FeatureGates{
DeployVmConsoleProxy: true,
},
},
}
Expand Down
5 changes: 3 additions & 2 deletions tests/vm_console_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ var _ = Describe("VM Console Proxy Operand", func() {
strategy.SkipSspUpdateTestsIfNeeded()

updateSsp(func(foundSsp *ssp.SSP) {
foundSsp.Spec.TokenGenerationService = &ssp.TokenGenerationService{
Enabled: true,
if foundSsp.Spec.FeatureGates == nil {
foundSsp.Spec.FeatureGates = &ssp.FeatureGates{}
}
foundSsp.Spec.FeatureGates.DeployVmConsoleProxy = true
})

expectedLabels := expectedLabelsFor("vm-console-proxy", "vm-console-proxy")
Expand Down
10 changes: 0 additions & 10 deletions vendor/kubevirt.io/ssp-operator/api/v1beta2/ssp_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3b9811

Please sign in to comment.