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

Make capact install "internetless" if needed #480

Merged
merged 7 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CMD ["/app"]

FROM alpine:3.13.5 as generic-alpine
ARG COMPONENT

ARG BRANCH=main
# Copy common CA certificates from Builder image (installed by default with ca-certificates package)
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

Expand All @@ -47,6 +47,9 @@ RUN apk add --no-cache 'git=>2.30' 'openssh=~8.4' && \
chmod 700 /root/.ssh && \
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

# hadolint ignore=DL3059
RUN git clone --depth 1 --branch $BRANCH https://github.com/capactio/hub-manifests.git /hub-manifests

LABEL [email protected]:capactio/capact.git
LABEL app=$COMPONENT

Expand Down
11 changes: 5 additions & 6 deletions cmd/cli/cmd/alpha/archive-images/helm_charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func NewFromHelmCharts() *cobra.Command {
opts := archiveimages.HelmArchiveImagesOptions{
CapactOpts: capact.Options{
DryRun: true,
Replace: true,
ClientOnly: true,
},
}
Expand All @@ -30,10 +29,10 @@ func NewFromHelmCharts() *cobra.Command {
# Archive images from the stable Capact Helm repository from version 0.5.0
<cli> alpha archive-images helm --version 0.5.0 --output ./capact-images-0.5.0.tar

# Archive images from Helm Chart released from the the '0fbf562' commit on the main branch
<cli> alpha archive-images helm --version 0.4.0-0fbf562 --helm-repo-url @latest --output-stdout > ./capact-images-0.4.0-0fbf562.tar
# Archive images from the Helm Chart released from the '0fbf562' commit on the main branch
<cli> alpha archive-images helm --version 0.4.0-0fbf562 --helm-repo @latest --output-stdout > ./capact-images-0.4.0-0fbf562.tar

# You can use gzip to save the image file and make the backup smaller.
# You can use gzip to compress the output and make the backup smaller.
<cli> alpha archive-images helm --version 0.5.0 --output ./capact-images-0.5.0.tar.gz --compress gzip

# You can pipe output to use custom gzip
Expand Down Expand Up @@ -62,7 +61,7 @@ func NewFromHelmCharts() *cobra.Command {
}

cmd.Flags().StringVar(&opts.CapactOpts.Parameters.Version, "version", capact.LatestVersionTag, "Capact version. Possible values @latest, @local, 0.3.0, ...")
cmd.Flags().StringVar(&opts.CapactOpts.Parameters.Override.HelmRepoURL, "helm-repo-url", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
cmd.Flags().StringVar(&opts.CapactOpts.Parameters.Override.HelmRepo, "helm-repo", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository location. It can be relative path to current working directory or URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
cmd.Flags().StringVarP(&opts.Output.Path, "output", "o", "", "Write output to a file, instead of standard output.")
cmd.Flags().BoolVar(&opts.Output.ToStdout, "output-stdout", false, "Write output to a standard output, instead of file.")
cmd.Flags().StringVar(&opts.Compress, "compress", "", fmt.Sprintf("Use a given compress algorithm. Allowed values: %s", archiveimages.CompressGzip))
Expand All @@ -72,7 +71,7 @@ func NewFromHelmCharts() *cobra.Command {
return []string{archiveimages.CompressGzip}, cobra.ShellCompDirectiveNoFileComp
})
_ = cmd.RegisterFlagCompletionFunc("version", cobra.NoFileCompletions)
_ = cmd.RegisterFlagCompletionFunc("helm-repo-url", cobra.NoFileCompletions)
_ = cmd.RegisterFlagCompletionFunc("helm-repo", cobra.NoFileCompletions)
_ = cmd.RegisterFlagCompletionFunc("output-stdout", cobra.NoFileCompletions)

return cmd
Expand Down
3 changes: 2 additions & 1 deletion cmd/cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func NewInstall() *cobra.Command {
flags.DurationVar(&opts.Timeout, "timeout", 10*time.Minute, `Maximum time during which the upgrade process is being watched, where "0" means "infinite". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`)
flags.BoolVar(&opts.UpdateHostsFile, "update-hosts-file", true, "Updates /etc/hosts with entry for Capact GraphQL Gateway.")
flags.BoolVar(&opts.UpdateTrustedCerts, "update-trusted-certs", true, "Add Capact GraphQL Gateway certificate.")
flags.StringVar(&opts.Parameters.Override.HelmRepoURL, "helm-repo-url", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
flags.StringVar(&opts.Parameters.Override.HelmRepo, "helm-repo", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository location. It can be relative path to current working directory or URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
flags.StringVar(&opts.Parameters.ActionCRDLocation, "crd", capact.CRDUrl, "Capact Action CRD location.")
flags.BoolVar(&opts.LocalRegistryEnabled, "enable-registry", false, "If specified, Capact images are pushed to Capact local Docker registry.")
flags.StringSliceVar(&opts.Parameters.Override.CapactStringOverrides, "capact-overrides", []string{}, "Overrides for Capact component.")
flags.StringSliceVar(&opts.Parameters.Override.IngressStringOverrides, "ingress-controller-overrides", []string{}, "Overrides for Ingress controller component.")
Expand Down
3 changes: 2 additions & 1 deletion cmd/cli/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ func NewUpgrade() *cobra.Command {

flags := cmd.Flags()
flags.StringVar(&opts.Parameters.Version, "version", capact.LatestVersionTag, "Capact version.")
flags.StringVar(&opts.Parameters.Override.HelmRepoURL, "helm-repo-url", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
flags.StringVar(&opts.Parameters.Override.HelmRepo, "helm-repo", capact.HelmRepoStable, fmt.Sprintf("Capact Helm chart repository URL. Use %s tag to select repository which holds the latest Helm chart versions.", capact.LatestVersionTag))
flags.StringVar(&opts.Parameters.Override.CapactValues.Global.ContainerRegistry.Tag, "override-capact-image-tag", "", "Allows you to override Docker image tag for Capact components. By default, Docker image tag from Helm chart is used.")
flags.StringVar(&opts.Parameters.Override.CapactValues.Global.ContainerRegistry.Path, "override-capact-image-repo", "", "Allows you to override Docker image repository for Capact components. By default, Docker image repository from Helm chart is used.")
flags.BoolVar(&opts.Parameters.IncreaseResourceLimits, "increase-resource-limits", true, "Enables higher resource requests and limits for components.")
flags.BoolVar(&opts.Parameters.Override.CapactValues.Engine.TestSetup.Enabled, "enable-test-setup", false, "Enables test setup for the Capact E2E validation scenarios.")
flags.BoolVar(&opts.Parameters.Override.CapactValues.Notes.PrintInsecure, "print-insecure-helm-release-notes", false, "Prints the base64-encoded Gateway password directly in Helm release notes.")
flags.StringVar(&opts.Parameters.ActionCRDLocation, "crd", capact.CRDUrl, "Capact Action CRD location.")
flags.StringVar(&opts.ActionNamePrefix, "action-name-prefix", "capact-upgrade-", "Specifies Capact upgrade Action name prefix.")
flags.DurationVar(&opts.Timeout, "timeout", 10*time.Minute, `Maximum time during which the upgrade process is being watched, where "0" means "infinite". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`)
flags.BoolVarP(&opts.Wait, "wait", "w", true, `Waits for the upgrade process until it's finished or the defined "--timeout" has occurred.`)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ capact [flags]
```
-c, --config string Path to the YAML config file
-h, --help help for capact
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This command consists of multiple subcommands to interact with target Actions

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ capact action create INTERFACE [flags]

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ capact action delete --name-regex='upgrade-*' --namespace=foo

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ capact action get funny-stallman -ojson

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ capact action run ACTION [flags]

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_action_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ capact action watch @latest

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Subcommand for alpha features in the CLI

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_alpha_archive-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Subcommand for various manifest generation operations

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
10 changes: 5 additions & 5 deletions cmd/cli/docs/capact_alpha_archive-images_helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ capact alpha archive-images helm [flags]
# Archive images from the stable Capact Helm repository from version 0.5.0
capact alpha archive-images helm --version 0.5.0 --output ./capact-images-0.5.0.tar

# Archive images from Helm Chart released from the the '0fbf562' commit on the main branch
capact alpha archive-images helm --version 0.4.0-0fbf562 --helm-repo-url @latest --output-stdout > ./capact-images-0.4.0-0fbf562.tar
# Archive images from the Helm Chart released from the '0fbf562' commit on the main branch
capact alpha archive-images helm --version 0.4.0-0fbf562 --helm-repo @latest --output-stdout > ./capact-images-0.4.0-0fbf562.tar

# You can use gzip to save the image file and make the backup smaller.
# You can use gzip to compress the output and make the backup smaller.
capact alpha archive-images helm --version 0.5.0 --output ./capact-images-0.5.0.tar.gz --compress gzip

# You can pipe output to use custom gzip
Expand All @@ -31,7 +31,7 @@ capact alpha archive-images helm --version 0.5.0 --output-stdout | gzip > myimag

```
--compress string Use a given compress algorithm. Allowed values: gzip
--helm-repo-url string Capact Helm chart repository URL. Use @latest tag to select repository which holds the latest Helm chart versions. (default "https://storage.googleapis.com/capactio-stable-charts")
--helm-repo string Capact Helm chart repository location. It can be relative path to current working directory or URL. Use @latest tag to select repository which holds the latest Helm chart versions. (default "https://storage.googleapis.com/capactio-stable-charts")
-h, --help help for helm
-o, --output string Write output to a file, instead of standard output.
--output-stdout Write output to a standard output, instead of file.
Expand All @@ -43,7 +43,7 @@ capact alpha archive-images helm --version 0.5.0 --output-stdout | gzip > myimag

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_alpha_manifest-gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Subcommand for various manifest generation operations

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_alpha_manifest-gen_implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Generate new Implementation manifests for various tools.
-c, --config string Path to the YAML config file
-o, --output string Path to the output directory for the generated manifests (default "generated")
--overwrite Overwrite existing manifest files
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ capact alpha manifest-gen implementation helm [MANIFEST_PATH] [HELM_CHART_NAME]
-c, --config string Path to the YAML config file
-o, --output string Path to the output directory for the generated manifests (default "generated")
--overwrite Overwrite existing manifest files
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ capact alpha manifest-gen implementation terraform cap.implementation.gcp.clouds
-c, --config string Path to the YAML config file
-o, --output string Path to the output directory for the generated manifests (default "generated")
--overwrite Overwrite existing manifest files
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_alpha_manifest-gen_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ capact alpha content interface cap.interface.database.postgresql install
-c, --config string Path to the YAML config file
-o, --output string Path to the output directory for the generated manifests (default "generated")
--overwrite Overwrite existing manifest files
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ capact completion [bash|zsh|fish|powershell] [flags]

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Display or change configuration settings for the Hub

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_config_get-contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ capact config get-contexts

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_config_set-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ capact config set-context localhost:8080

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This command consists of multiple subcommands to interact with a Capact environm

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_environment_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This command consists of multiple subcommands to create a Capact environment

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/capact_environment_create_k3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ capact environment create k3d [flags]

```
-c, --config string Path to the YAML config file
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - tracing (default 0 - disable)
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable)
```

### SEE ALSO
Expand Down
Loading