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

Remove unused CRD for Superset credentials #33

Merged
merged 1 commit into from
Dec 3, 2021
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

### Added
- Initial implementation of the operator added. An admin user can be created in the Superset
database with the Init command which takes the credentials from a secret ([#7], [#12]).
database with the Init command which takes the credentials from a secret ([#7], [#12], [#33]).

[#7]: https://github.com/stackabletech/superset-operator/pull/7
[#12]: https://github.com/stackabletech/superset-operator/pull/12
[#33]: https://github.com/stackabletech/superset-operator/pull/33
64 changes: 0 additions & 64 deletions deploy/crd/supersetcredentials.crd.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions deploy/helm/superset-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,69 +470,3 @@ spec:
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: supersetcredentials.superset.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: superset.stackable.tech
names:
categories: []
kind: SupersetCredentials
plural: supersetcredentials
shortNames:
- supersetcredentials
singular: supersetcredentials
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: "Auto-generated derived type for SupersetCredentialsSpec via `CustomResource`"
properties:
spec:
properties:
adminUser:
properties:
email:
type: string
firstname:
type: string
lastname:
type: string
password:
type: string
username:
type: string
required:
- email
- firstname
- lastname
- password
- username
type: object
connections:
properties:
secretKey:
type: string
sqlalchemyDatabaseUri:
type: string
required:
- secretKey
- sqlalchemyDatabaseUri
type: object
required:
- adminUser
- connections
type: object
required:
- spec
title: SupersetCredentials
type: object
served: true
storage: true
subresources: {}
66 changes: 0 additions & 66 deletions deploy/manifests/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,69 +471,3 @@ spec:
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: supersetcredentials.superset.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: superset.stackable.tech
names:
categories: []
kind: SupersetCredentials
plural: supersetcredentials
shortNames:
- supersetcredentials
singular: supersetcredentials
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: "Auto-generated derived type for SupersetCredentialsSpec via `CustomResource`"
properties:
spec:
properties:
adminUser:
properties:
email:
type: string
firstname:
type: string
lastname:
type: string
password:
type: string
username:
type: string
required:
- email
- firstname
- lastname
- password
- username
type: object
connections:
properties:
secretKey:
type: string
sqlalchemyDatabaseUri:
type: string
required:
- secretKey
- sqlalchemyDatabaseUri
type: object
required:
- adminUser
- connections
type: object
required:
- spec
title: SupersetCredentials
type: object
served: true
storage: true
subresources: {}
2 changes: 1 addition & 1 deletion examples/simple-superset-credentials-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: simple-superset-credentials
type: superset.stackable.tech/superset-credentials
type: Opaque
stringData:
adminUser.username: admin
adminUser.firstname: Superset
Expand Down
19 changes: 4 additions & 15 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,14 @@ pub struct SupersetClusterSpec {
pub nodes: Role<SupersetConfig>,
}

#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[kube(
group = "superset.stackable.tech",
version = "v1alpha1",
kind = "SupersetCredentials",
plural = "supersetcredentials",
shortname = "supersetcredentials",
namespaced,
kube_core = "stackable_operator::kube::core",
k8s_openapi = "stackable_operator::k8s_openapi",
schemars = "stackable_operator::schemars"
)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SupersetCredentialsSpec {
pub struct SupersetCredentials {
pub admin_user: AdminUserCredentials,
pub connections: Connections,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AdminUserCredentials {
pub username: String,
Expand All @@ -81,7 +70,7 @@ pub struct AdminUserCredentials {
pub password: String,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Connections {
pub secret_key: String,
Expand Down
3 changes: 1 addition & 2 deletions rust/operator-binary/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use stackable_operator::crd::CustomResourceExt;
use stackable_superset_crd::commands::{Init, Restart, Start, Stop};
use stackable_superset_crd::{SupersetCluster, SupersetCredentials};
use stackable_superset_crd::SupersetCluster;

fn main() -> Result<(), stackable_operator::error::Error> {
built::write_built_file().expect("Failed to acquire build-time information");

SupersetCluster::write_yaml_schema("../../deploy/crd/supersetcluster.crd.yaml")?;
SupersetCredentials::write_yaml_schema("../../deploy/crd/supersetcredentials.crd.yaml")?;
Init::write_yaml_schema("../../deploy/crd/init.crd.yaml")?;
Restart::write_yaml_schema("../../deploy/crd/restart.crd.yaml")?;
Start::write_yaml_schema("../../deploy/crd/start.crd.yaml")?;
Expand Down
6 changes: 1 addition & 5 deletions rust/operator-binary/src/stackable-superset-operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use stackable_operator::kube::CustomResourceExt;
use stackable_operator::{cli, logging};
use stackable_operator::{client, error};
use stackable_superset_crd::commands::{Init, Restart, Start, Stop};
use stackable_superset_crd::{SupersetCluster, SupersetCredentials};
use stackable_superset_crd::SupersetCluster;
use tracing::error;

mod built_info {
Expand All @@ -25,7 +25,6 @@ async fn main() -> Result<(), error::Error> {
SubCommand::with_name("crd")
.setting(AppSettings::ArgRequiredElseHelp)
.subcommand(cli::generate_crd_subcommand::<SupersetCluster>())
.subcommand(cli::generate_crd_subcommand::<SupersetCredentials>())
.subcommand(cli::generate_crd_subcommand::<Init>())
.subcommand(cli::generate_crd_subcommand::<Restart>())
.subcommand(cli::generate_crd_subcommand::<Start>())
Expand All @@ -37,9 +36,6 @@ async fn main() -> Result<(), error::Error> {
if cli::handle_crd_subcommand::<SupersetCluster>(subcommand)? {
return Ok(());
};
if cli::handle_crd_subcommand::<SupersetCredentials>(subcommand)? {
return Ok(());
};
if cli::handle_crd_subcommand::<Init>(subcommand)? {
return Ok(());
};
Expand Down