Skip to content

Commit

Permalink
Merge pull request #43 from wansir/master
Browse files Browse the repository at this point in the history
defines installation mode in extension.yaml
  • Loading branch information
wansir committed Aug 1, 2023
2 parents 8fd3c89 + ccd065c commit 620fb9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 1 addition & 6 deletions cmd/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
)

type publishOptions struct {
kubeconfig string
multiClusterMode bool
kubeconfig string
}

func defaultPublishOptions() *publishOptions {
Expand All @@ -31,7 +30,6 @@ func publishExtensionCmd() *cobra.Command {
RunE: o.publish,
}
cmd.Flags().StringVar(&o.kubeconfig, "kubeconfig", "", "kubeconfig file path of the target cluster")
cmd.Flags().BoolVar(&o.multiClusterMode, "multi-cluster-mode", false, "enable multi-cluster installation mode for the extension")
return cmd
}

Expand All @@ -51,9 +49,6 @@ func (o *publishOptions) publish(cmd *cobra.Command, args []string) error {
}
defer os.RemoveAll(dir) // nolint

if o.multiClusterMode {
ext.Metadata.InstallationMode = "Multicluster"
}
filePath := path.Join(dir, "extension.yaml")
if err = os.WriteFile(filePath, ext.ToKubernetesResources(), 0644); err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions pkg/extension/templates/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ dependencies:
condition: frontend.enabled
- name: backend
condition: backend.enabled
# installationMode describes how to install subcharts, it can be HostOnly or Multicluster.
#installationMode: Multicluster
# external dependencies example
#externalDependencies:
# - name: a
Expand Down
2 changes: 1 addition & 1 deletion pkg/extension/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type Metadata struct {
Icon string `json:"icon" validate:"required"`
Screenshots []string `json:"screenshots,omitempty"`
Dependencies []*chart.Dependency `json:"dependencies,omitempty"`
InstallationMode string `json:"-"`
InstallationMode string `json:"installationMode,omitempty"`
}

func (md *Metadata) Validate() error {
Expand Down

0 comments on commit 620fb9b

Please sign in to comment.