-
Notifications
You must be signed in to change notification settings - Fork 3
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
install operator with no custom values in install2 #1756
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
40f61ea
install operator with no custom values in install2
laverya 1505722
check installation state is installed in install2 tests
laverya 2133d0c
use CRD based installation type
laverya e94a3e5
use correct CRD kind, apply multiple CRDs, wait for right condition
laverya 7dbb24d
recreate crd object for second loop
laverya e32c438
add loading spinner, decrease wait times, remove debug logs
laverya c107c59
allow crd to be taken over by helm
laverya 226950b
remove prefix from installation name
laverya 0ddbf85
formatting
laverya 1b6cd62
set installation status after upgrade
laverya 5d05f1a
Revert "set installation status after upgrade"
laverya d29da10
Revert "remove prefix from installation name"
laverya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package charts | ||
|
||
// this package is used to embed the installation CRD file into the binary | ||
|
||
import _ "embed" | ||
|
||
//go:embed embedded-cluster-operator/charts/crds/templates/resources.yaml | ||
var InstallationCRDFile string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pkg/addons2/embeddedclusteroperator/embeddedclusteroperator.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package embeddedclusteroperator | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/pkg/errors" | ||
"github.com/replicatedhq/embedded-cluster/pkg/release" | ||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
type EmbeddedClusterOperator struct{} | ||
|
||
const ( | ||
releaseName = "embedded-cluster-operator" | ||
namespace = "embedded-cluster" | ||
) | ||
|
||
var ( | ||
//go:embed static/values.tpl.yaml | ||
rawvalues []byte | ||
// helmValues is the unmarshal version of rawvalues. | ||
helmValues map[string]interface{} | ||
//go:embed static/metadata.yaml | ||
rawmetadata []byte | ||
// Metadata is the unmarshal version of rawmetadata. | ||
Metadata release.AddonMetadata | ||
) | ||
|
||
func init() { | ||
if err := yaml.Unmarshal(rawmetadata, &Metadata); err != nil { | ||
panic(errors.Wrap(err, "unable to unmarshal metadata")) | ||
} | ||
hv, err := release.RenderHelmValues(rawvalues, Metadata) | ||
if err != nil { | ||
panic(errors.Wrap(err, "unable to unmarshal values")) | ||
} | ||
helmValues = hv | ||
} | ||
|
||
func (a *EmbeddedClusterOperator) Name() string { | ||
return "Embedded Cluster Operator" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package embeddedclusteroperator | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/pkg/errors" | ||
"github.com/replicatedhq/embedded-cluster/pkg/helm" | ||
"github.com/replicatedhq/embedded-cluster/pkg/spinner" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
func (o *EmbeddedClusterOperator) Install(ctx context.Context, kcli client.Client, hcli *helm.Helm, writer *spinner.MessageWriter) error { | ||
if err := o.prepare(); err != nil { | ||
return errors.Wrap(err, "prepare metrics operator") | ||
} | ||
|
||
_, err := hcli.Install(ctx, helm.InstallOptions{ | ||
ReleaseName: releaseName, | ||
ChartPath: Metadata.Location, | ||
ChartVersion: Metadata.Version, | ||
Values: helmValues, | ||
Namespace: namespace, | ||
}) | ||
if err != nil { | ||
return errors.Wrap(err, "install metrics operator") | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package embeddedclusteroperator | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func (a *EmbeddedClusterOperator) prepare() error { | ||
if err := a.generateHelmValues(); err != nil { | ||
return errors.Wrap(err, "generate helm values") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (a *EmbeddedClusterOperator) generateHelmValues() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# this file is automatically generated by buildtools. manual edits are not recommended. | ||
# to regenerate this file, run the following commands: | ||
# | ||
# $ make buildtools | ||
# $ output/bin/buildtools update addon <addon name> | ||
# | ||
version: 1.19.0+k8s-1.30 | ||
location: oci://proxy.replicated.com/anonymous/registry.replicated.com/library/embedded-cluster-operator | ||
images: | ||
embedded-cluster-operator: | ||
repo: proxy.replicated.com/anonymous/replicated/embedded-cluster-operator-image | ||
tag: | ||
amd64: v1.19.0-k8s-1.30 | ||
arm64: v1.19.0-k8s-1.30 | ||
utils: | ||
repo: proxy.replicated.com/anonymous/replicated/ec-utils | ||
tag: | ||
amd64: latest | ||
arm64: latest |
10 changes: 10 additions & 0 deletions
10
pkg/addons2/embeddedclusteroperator/static/values.tpl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
global: | ||
labels: | ||
replicated.com/disaster-recovery: infra | ||
replicated.com/disaster-recovery-chart: embedded-cluster-operator | ||
{{- if .ReplaceImages }} | ||
image: | ||
repository: '{{ (index .Images "embedded-cluster-operator").Repo }}' | ||
tag: '{{ index (index .Images "embedded-cluster-operator").Tag .GOARCH }}' | ||
utilsImage: '{{ ImageString (index .Images "utils") }}' | ||
{{- end }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this down