Skip to content

Commit f632e08

Browse files
Update-upp-proxy-role (#176)
* dev * app-proxy cm generator: added env variable 'env=production' * add literal resource 'env=production' when context.url is the default url (g.codefresh) * bump app-proxy * bump * added argoWorkflowsInsecure to app-proxy env vars * bump * bump
1 parent 5f66aa9 commit f632e08

File tree

8 files changed

+38
-6
lines changed

8 files changed

+38
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.164
1+
VERSION=v0.0.165
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/runtime.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,13 +1039,22 @@ func configureAppProxy(ctx context.Context, opts *RuntimeInstallOptions, rt *run
10391039
return err
10401040
}
10411041

1042+
literalResources := []string{
1043+
fmt.Sprintf("cfHost=%s", cfConfig.GetCurrentContext().URL),
1044+
"argoWorkflowsInsecure=true",
1045+
}
1046+
1047+
if cfConfig.GetCurrentContext().IsProduction() {
1048+
literalResources = append(literalResources, "env=production")
1049+
}
1050+
10421051
// configure codefresh host
10431052
kust.ConfigMapGenerator = append(kust.ConfigMapGenerator, kusttypes.ConfigMapArgs{
10441053
GeneratorArgs: kusttypes.GeneratorArgs{
10451054
Name: store.Get().AppProxyServiceName + "-cm",
10461055
Behavior: "merge",
10471056
KvPairSources: kusttypes.KvPairSources{
1048-
LiteralSources: []string{fmt.Sprintf("cfHost=%s", cfConfig.GetCurrentContext().URL)},
1057+
LiteralSources: literalResources,
10491058
},
10501059
},
10511060
})

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.164/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.165/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.164/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.165/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

manifests/app-proxy/app-proxy.deploy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ spec:
3535
name: cap-app-proxy-cm
3636
key: env
3737
optional: true
38+
- name: ARGO_WORKFLOWS_INSECURE
39+
valueFrom:
40+
configMapKeyRef:
41+
name: cap-app-proxy-cm
42+
key: argoWorkflowsInsecure
43+
optional: true
3844
- name: RUNTIME_TOKEN
3945
valueFrom:
4046
secretKeyRef:

manifests/app-proxy/app-proxy.role.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ rules:
1717
- patch
1818
- list
1919
- watch
20+
- apiGroups:
21+
- argoproj.io
22+
resources:
23+
- workflows
24+
verbs:
25+
- get
26+
- create
27+
- delete
28+
- update
29+
- patch
30+
- list
31+
- watch

manifests/app-proxy/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Kustomization
33
images:
44
- name: quay.io/codefresh/cap-app-proxy
55
newName: quay.io/codefresh/cap-app-proxy
6-
newTag: v0.0.8
6+
newTag: v0.0.9
77
resources:
88
- app-proxy.deploy.yaml
99
- app-proxy.svc.yaml

manifests/runtime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: '{{ namespace }}'
66
spec:
77
defVersion: 1.0.0
8-
version: 0.0.164
8+
version: 0.0.165
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

pkg/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/spf13/viper"
3636

3737
"github.com/codefresh-io/cli-v2/pkg/log"
38+
"github.com/codefresh-io/cli-v2/pkg/store"
3839
"github.com/codefresh-io/cli-v2/pkg/util"
3940
"github.com/codefresh-io/go-sdk/pkg/codefresh"
4041
)
@@ -80,6 +81,10 @@ type AuthContext struct {
8081
DefaultRuntime string `mapstructure:"defaultRuntime" json:"defaultRuntime"`
8182
}
8283

84+
func (ac *AuthContext) IsProduction() bool {
85+
return ac.URL == store.Get().DefaultAPI
86+
}
87+
8388
func AddFlags(f *pflag.FlagSet) *Config {
8489
conf := &Config{path: defaultPath}
8590

0 commit comments

Comments
 (0)