Skip to content

Commit

Permalink
Merge pull request #457 from nickgerace/master-revert-values-from
Browse files Browse the repository at this point in the history
Revert valuesFrom
  • Loading branch information
nickgerace authored Jul 12, 2021
2 parents 0a33ace + 0c3e593 commit d80d59b
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 429 deletions.
128 changes: 0 additions & 128 deletions charts/fleet-crd/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,38 +111,6 @@ spec:
type: string
nullable: true
type: array
valuesFrom:
items:
properties:
configMapKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
secretKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
nullable: true
type: array
version:
nullable: true
type: string
Expand Down Expand Up @@ -478,38 +446,6 @@ spec:
type: string
nullable: true
type: array
valuesFrom:
items:
properties:
configMapKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
secretKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
nullable: true
type: array
version:
nullable: true
type: string
Expand Down Expand Up @@ -957,38 +893,6 @@ spec:
type: string
nullable: true
type: array
valuesFrom:
items:
properties:
configMapKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
secretKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
nullable: true
type: array
version:
nullable: true
type: string
Expand Down Expand Up @@ -1100,38 +1004,6 @@ spec:
type: string
nullable: true
type: array
valuesFrom:
items:
properties:
configMapKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
secretKeyRef:
nullable: true
properties:
key:
nullable: true
type: string
name:
nullable: true
type: string
namespace:
nullable: true
type: string
type: object
type: object
nullable: true
type: array
version:
nullable: true
type: string
Expand Down
32 changes: 0 additions & 32 deletions docs/gitrepo-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ helm:
valuesFiles:
- values1.yaml
- values2.yaml
# Allow to use values files from configmaps or secrets
# NOTE: this feature is slated to be available in Fleet v0.3.6
valuesFrom:
- configMapKeyRef:
name: configmap-values
# default to namespace of bundle
namespace: default
key: values.yaml
secretKeyRef:
name: secret-values
namespace: default
key: values.yaml
# Override immutable resources. This could be dangerous.
force: false

Expand Down Expand Up @@ -184,26 +172,6 @@ targetCustomizations:

After secret is created, specify the secret to `gitRepo.spec.helmSecretName`. Make sure secret is created under the same namespace with gitrepo.

### Using ValuesFrom

The examples below include filler `values` data for a generic Helm chart.
These examples showcase the style and format for using `valuesFrom`.

Recommended `ConfigMap` contents for the `data` field:

```yaml
values.yaml: |-
replication: true
replicas: 2
serviceType: NodePort
```

Recommended `Secret` contents for the `data` field (to be converted into bytes):

```yaml
replication: true\nreplicas: 2\nserviceType: NodePort
```

## Per Cluster Customization

The `GitRepo` defines which clusters a git repository should be deployed to and the `fleet.yaml` in the repository
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ require (
github.com/rancher/wrangler-cli v0.0.0-20200815040857-81c48cf8ab43
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.1.1
github.com/stretchr/testify v1.6.1
go.mozilla.org/sops/v3 v3.6.1
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3 // indirect
Expand Down
2 changes: 1 addition & 1 deletion modules/agent/pkg/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Register(ctx context.Context, leaderElect bool,
}

helmDeployer, err := helmdeployer.NewHelm(agentNamespace, defaultNamespace, labelPrefix, appCtx,
appCtx.Core.ServiceAccount().Cache(), appCtx.Core.ConfigMap().Cache(), appCtx.Core.Secret().Cache())
appCtx.Core.ServiceAccount().Cache())
if err != nil {
return err
}
Expand Down
31 changes: 0 additions & 31 deletions pkg/apis/fleet.cattle.io/v1alpha1/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,43 +227,12 @@ type HelmOptions struct {
Version string `json:"version,omitempty"`
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
Values *GenericMap `json:"values,omitempty"`
ValuesFrom []ValuesFrom `json:"valuesFrom,omitempty"`
Force bool `json:"force,omitempty"`
TakeOwnership bool `json:"takeOwnership,omitempty"`
MaxHistory int `json:"maxHistory,omitempty"`
ValuesFiles []string `json:"valuesFiles,omitempty"`
}

// Define helm values that can come from configmap, secret or external. Credit: https://github.com/fluxcd/helm-operator/blob/0cfea875b5d44bea995abe7324819432070dfbdc/pkg/apis/helm.fluxcd.io/v1/types_helmrelease.go#L439
type ValuesFrom struct {
// The reference to a config map with release values.
// +optional
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
// The reference to a secret with release values.
// +optional
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
}

type ConfigMapKeySelector struct {
LocalObjectReference `json:",inline"`
// +optional
Namespace string `json:"namespace,omitempty"`
// +optional
Key string `json:"key,omitempty"`
}

type SecretKeySelector struct {
LocalObjectReference `json:",inline"`
// +optional
Namespace string `json:"namespace,omitempty"`
// +optional
Key string `json:"key,omitempty"`
}

type LocalObjectReference struct {
Name string `json:"name"`
}

type BundleDeploymentSpec struct {
StagedOptions BundleDeploymentOptions `json:"stagedOptions,omitempty"`
StagedDeploymentID string `json:"stagedDeploymentID,omitempty"`
Expand Down
83 changes: 0 additions & 83 deletions pkg/apis/fleet.cattle.io/v1alpha1/zz_generated_deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d80d59b

Please sign in to comment.