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

chore: clean up unused API code after moving to v1beta1 #543

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ vet: ## Run go vet against code.

.PHONY: unit-test
unit-test: manifests fmt vet generate envtest ## Run tests.
go test ./... -v -short -coverprofile cover.out
cd apis && go test ./... -v -coverprofile ../cover-apis.out cover-main.out cover-pkg.out
go test ./... -v -coverprofile cover-operator.out
sed -i '/mode: set/d' "cover-operator.out"
sed -i '/mode: set/d' "cover-apis.out"
echo "mode: set" > cover.out
cat cover-operator.out cover-apis.out >> cover.out
rm cover-operator.out cover-apis.out

## e2e tests require the operator to be deployed in a real cluster
.PHONY: e2e-test-kuttl
Expand Down
23 changes: 0 additions & 23 deletions apis/core/v1alpha1/common/common.go

This file was deleted.

20 changes: 0 additions & 20 deletions apis/core/v1alpha1/featureflagconfiguration_conversion.go

This file was deleted.

39 changes: 0 additions & 39 deletions apis/core/v1alpha1/featureflagconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@ limitations under the License.
package v1alpha1

import (
"github.com/open-feature/open-feature-operator/apis/core/v1alpha1/common"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// FeatureFlagConfigurationSpec defines the desired state of FeatureFlagConfiguration
type FeatureFlagConfigurationSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// ServiceProvider [DEPRECATED]: superseded by FlagSourceConfiguration
// +optional
// +nullable
Expand Down Expand Up @@ -78,8 +71,6 @@ type FeatureFlagServiceProvider struct {

// FeatureFlagConfigurationStatus defines the observed state of FeatureFlagConfiguration
type FeatureFlagConfigurationStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

//+kubebuilder:object:root=true
Expand Down Expand Up @@ -107,33 +98,3 @@ type FeatureFlagConfigurationList struct {
func init() {
SchemeBuilder.Register(&FeatureFlagConfiguration{}, &FeatureFlagConfigurationList{})
}

func (ff *FeatureFlagConfiguration) GetReference() metav1.OwnerReference {
return metav1.OwnerReference{
APIVersion: ff.APIVersion,
Kind: ff.Kind,
Name: ff.Name,
UID: ff.UID,
Controller: common.TrueVal(),
}
}

func (ff *FeatureFlagConfiguration) GenerateConfigMap(name string, namespace string, references []metav1.OwnerReference) corev1.ConfigMap {
return corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Annotations: map[string]string{
"openfeature.dev/featureflagconfiguration": name,
},
OwnerReferences: references,
},
Data: map[string]string{
common.FeatureFlagConfigurationConfigMapKey(namespace, name): ff.Spec.FeatureFlagSpec,
},
}
}

func (p *FeatureFlagServiceProvider) IsSet() bool {
return p != nil && p.Name != ""
}
80 changes: 0 additions & 80 deletions apis/core/v1alpha1/featureflagconfiguration_types_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions apis/core/v1alpha1/featureflagconfiguration_webhook.go

This file was deleted.

20 changes: 0 additions & 20 deletions apis/core/v1alpha1/flagsourceconfiguration_conversion.go

This file was deleted.

Loading
Loading